This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

malloc mutex and exceptions


Hi everyone,

I have been migrating to gcc a server C/C++ based software and I' like to 
control SIGSEGV signal exceptions. So I use sigaction and the corresponding 
handlers to accomplish this target. 

The problem arises when a SIGSEGV happens inside a new operator. I have many 
users connected to the program and the clients suddenly hang.  That's because 
of pthread mutex the malloc and free routines use. The SIGSEGV occurs after 
pthread_mutex_lock call and before pthread_mutex_unlock. 
So, every time a user tries to use this semaphore the program hangs. New and 
delete uses malloc and free with reentrant features. And I'm interested in 
that because of pthread program use, but I have this problem for the 
exception control.

When I have a problem using one of my mutex I can control lock and unlock 
properly, but new and delete mutex relies on library variables.

Is there any way I can control this internal mutex ?

Is there any compiler option to change this behaviour ?

Thanks in advance,

Ignasi Villagrasa.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]