exception propagation

Norman Feske norman.feske at ...1...
Fri Aug 12 13:57:08 CEST 2011


Hi Daniel,

> I'm trying to catch a Region_conflict exception from a call to 
> env()->rm_ression()->attach(...).  By putting printfs in the Genode code 
> I see the exception is being thrown in the rm-session-component, but it 
> does not seem to be getting propagated back to the client app.
> 
> Can someone check the new GENODE_RPC_THROW macro is working correctly?  
> Fiasco.OC x86_32.

we have observed such a problem before - in a scenario where the first exception was thrown by a thread other than the main thread. Is this the case in your scenario? I.e., is the 'rm_session()->attach()' called from a non-main thread?

If so, the problem here might be that the first 'throw' triggers the lazy initialization of the exception support in gcc's libsupc++. This initialization involves dynamic memory allocation via 'malloc', which tends to consume significant amount of stack space (several KB). There are two ways to remedy this issue: to trigger the first exception at a well-defined place by a thread with a large enough stack (-> the main thread), or increasing the stack size of any thread that might trigger the very first exception. I would go for the first idea. Could you please try to add the following line right after the 'init_exception_handling()' call at the startup code at 'base/src/platform/_main.cc':

  try { throw 1; } catch (...) { }

If your scenario is different, could you please supply us with a code snippet that triggers the issue? This would be greatly appreciated.

Best regards,
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list