Problem with dice when fpage are used with derivation
Hi, I don't have time to do more checking on L4Linux. Today, I use dice r238 of public repository of TUDOS. All my tasks are pure L4env ones. I try to process an idl which is quite long. Here is a sample : library myapp { [uuid(2)] interface connection { int syn([out] unsigned long *page_in_base); int ack([in] fpage page_in, [in] unsigned long page_out_base, [out] fpage *page_out); int rst(void); }; }; I create one interface which derives from myapp::connection : library myapp_server { interface server : myapp::configuration, myapp::connection, myapp::key { }; }; Dice generates files. One of them is very strange. On server side, file corresponding to myapp_server contains following code : inline long myapp_server_reply_and_wait (CORBA_Object _dice_corba_obj, l4_msgtag_t *_dice_tag, myapp_server_msg_buffer_t *_dice_msg_buffer, CORBA_Server_Environment *_dice_corba_env) { long _dice_opcode = 0; l4_msgtag_t tagdummy __attribute__ ((unused)) = l4_msgtag(0,0,0,0); l4_msgdope_t _dice_result = { msgdope: 0 }; if ((_dice_msg_buffer->_word._dice_send_dope.md.dwords <= 2) && (_dice_msg_buffer->_word._dice_send_dope.md.strings == 0)) [ZAP] /* clear exception if set*/ if (DICE_EXPECT_FALSE(DICE_HAS_EXCEPTION(_dice_corba_env))) CORBA_server_exception_set(_dice_corba_env, CORBA_NO_EXCEPTION, CORBA_DICE_EXCEPTION_NONE, 0); /* test for IPC errors */ if (DICE_EXPECT_FALSE(L4_IPC_IS_ERROR(_dice_result))) { _dice_opcode = 0; _dice_msg_buffer->_word._word[0] = 0; if (DICE_IS_NO_EXCEPTION(_dice_corba_env)) CORBA_server_exception_set(_dice_corba_env, CORBA_SYSTEM_EXCEPTION, CORBA_DICE_INTERNAL_IPC_ERROR, 0); return _dice_opcode; } if (l4_ipc_fpage_received(_dice_result)) _dice_opcode = _dice_msg_buffer->_word._word[2]; else _dice_opcode = _dice_msg_buffer->_word._word[0]; return _dice_opcode; } By adding some logging, I realized that when fpage is received, opcode is not into _word[2] but _word[4]. Regards Marc
Marc CHALAND wrote on 02/27/2008 04:42 PM this:
Hi,
I don't have time to do more checking on L4Linux. Today, I use dice r238 of public repository of TUDOS. All my tasks are pure L4env ones. I try to process an idl which is quite long. Here is a sample :
library myapp { [uuid(2)] interface connection { int syn([out] unsigned long *page_in_base); int ack([in] fpage page_in, [in] unsigned long page_out_base, [out] fpage *page_out); int rst(void); }; };
I create one interface which derives from myapp::connection :
library myapp_server { interface server : myapp::configuration, myapp::connection, myapp::key { }; };
Dice generates files. One of them is very strange. On server side, file corresponding to myapp_server contains following code :
inline long myapp_server_reply_and_wait (CORBA_Object _dice_corba_obj, l4_msgtag_t *_dice_tag, myapp_server_msg_buffer_t *_dice_msg_buffer, CORBA_Server_Environment *_dice_corba_env) { long _dice_opcode = 0; l4_msgtag_t tagdummy __attribute__ ((unused)) = l4_msgtag(0,0,0,0); l4_msgdope_t _dice_result = { msgdope: 0 }; if ((_dice_msg_buffer->_word._dice_send_dope.md.dwords <= 2) && (_dice_msg_buffer->_word._dice_send_dope.md.strings == 0)) [ZAP] /* clear exception if set*/ if (DICE_EXPECT_FALSE(DICE_HAS_EXCEPTION(_dice_corba_env))) CORBA_server_exception_set(_dice_corba_env, CORBA_NO_EXCEPTION, CORBA_DICE_EXCEPTION_NONE, 0); /* test for IPC errors */ if (DICE_EXPECT_FALSE(L4_IPC_IS_ERROR(_dice_result))) { _dice_opcode = 0; _dice_msg_buffer->_word._word[0] = 0; if (DICE_IS_NO_EXCEPTION(_dice_corba_env)) CORBA_server_exception_set(_dice_corba_env, CORBA_SYSTEM_EXCEPTION, CORBA_DICE_INTERNAL_IPC_ERROR, 0); return _dice_opcode; } if (l4_ipc_fpage_received(_dice_result)) _dice_opcode = _dice_msg_buffer->_word._word[2]; else _dice_opcode = _dice_msg_buffer->_word._word[0]; return _dice_opcode; }
By adding some logging, I realized that when fpage is received, opcode is not into _word[2] but _word[4]. You are right. That's a bug. Please find attached the patch for this bug. It (hopefully) is in public repository tomorrow.
Regards, Ron. -- Mit freundlichen Gruessen / with regards ra3 @ inf.tu-dresden.de http://os.inf.tu-dresden.de/~ra3/ Index: src/be/BEClass.cpp =================================================================== --- src/be/BEClass.cpp (revision 31161) +++ src/be/BEClass.cpp (working copy) @@ -801,10 +801,7 @@ void CBEClass::AddToImpl(CBEImplementati * \param nDirection the direction to count * \return the number of parameters of this type */ -int -CBEClass::GetParameterCount(int nFEType, - bool& bSameCount, - DIRECTION_TYPE nDirection) +int CBEClass::GetParameterCount(int nFEType, bool& bSameCount, DIRECTION_TYPE nDirection) { if (nDirection == DIRECTION_INOUT) { @@ -830,6 +827,19 @@ CBEClass::GetParameterCount(int nFEType, nCount = std::max(nCurr, nCount); } + vector<CBEClass*>::iterator iC; + for (iC = m_BaseClasses.begin(); + iC != m_BaseClasses.end(); + iC++) + { + nCurr = (*iC)->GetParameterCount(nFEType, bSameCount, nDirection); + CCompiler::Verbose("CBEClass::%s: checking class %s: has %d parameter of type\n", __func__, + (*iC)->GetName().c_str(), nCurr); + if (0 < nCount && 0 < nCurr && nCurr != nCount) + bSameCount = false; + nCount = std::max(nCurr, nCount); + } + CCompiler::Verbose("CBEClass::%s: returns %d (same %s)\n", __func__, nCount, bSameCount ? "true" : "false"); return nCount;
participants (2)
-
Marc CHALAND -
Ronald Aigner