[omniORB] Mutex lock in giopRope::acquireClient ?

VEYSSIERE Nicolas nicolas.veyssiere at thalesgroup.com
Tue Feb 15 14:52:05 GMT 2011


Thanks !

I changed my signal handling code by this example : http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_sigmask.html

I hope that it is the good way to do it.


Regards,

Nicolas V.


-----Message d'origine-----
De : Duncan Grisby [mailto:duncan at grisby.org] 
Envoyé : mardi 15 février 2011 12:56
À : VEYSSIERE Nicolas
Cc : omniorb-list at omniorb-support.com
Objet : RE: [omniORB] Mutex lock in giopRope::acquireClient ?

On Tue, 2011-02-15 at 11:23 +0100, VEYSSIERE Nicolas wrote:

> Hello, I am using omniORB 4.1.4
> 
> I put y log as attachement.

The log didn't actually show much of use, but the stack trace did...

        [...]
        // here we are locked
        #3  0x60000000c00fe1f0:0 in pthread_mutex_lock+0x270 ()
        from /usr/lib/hpux32/libpthread.so.1
        #4  0x60000000c8ddcfa0:0 in
        omni::giopRope::acquireClient(omniIOR const*,unsigned char
        const*,unsigned long,omniCallDescriptor*)+0x110 ()
        from /usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/../../../libomniORB4.so
        
        [...]
        #12 0x406de50:0 in post_raffraichissement_info () at
        im_post_main12.cc:1640
        
        // signal callback
        #13 0x4069110:0 in TraiterSignal2 () at im_post_main12.cc:491
        
        // SIGUSR2
        #14 <signal handler called>
        #15 0x60000000c037f1d0:0 in clock_gettime+0x30 ()
        from /usr/lib/hpux32/libc.so.1
        #16 0x60000000c7006d70:0 in omni_thread::get_time(unsigned
        long*,unsigned long*,unsigned long,unsigned long)+0x40 ()
        from /usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/../../../libomnithread.so
        #17 0x60000000c8d3baa0:0 in omniORB::logger::logger(char
        const*)+0x180 ()
        from /usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/../../../libomniORB4.so
        #18 0x60000000c8de5210:0 in
        omni::giopStrand::deleteStrandAndConnection(bool) +0x4f0 ()
        from /usr/local/lib/gcc/ia64-hp-hpux11.23/4.2.3/../../../libomniORB4.so
        

You are making a CORBA call from inside a signal handler, and the signal
handler is running in the context of omniORB handling a connection
closure!  The thread is deadlocked against itself.

It is never safe to make CORBA calls inside a signal handler. You can
only (directly or indirectly) call system functions that are
async-signal-safe. The list guaranteed by Posix is towards the end of
this page:

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html

Note that the list includes sem_post(). The normal way to trigger any
complex behaviour from a signal handler is to have a thread that blocks
on a semaphore, then use sem_post() in the signal handler to trigger the
thread.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --




More information about the omniORB-list mailing list