Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem of malloc re-entrant

807578Oct 11 2002 — edited Dec 11 2002
Hi !!!

I've a problem with malloc re-entrant which I'm not able to resolv. Below are the details for the same.

I've a library and an application linked with this library. My library have a signal handler function for signal type "SIGALRM". The handler function is using malloc and free. The application also uses malloc and free extencively. At some point of time, when malloc in my application is being executed, the signal "SIGALRM" gets generated, and the handler is called. Now this handler is also having calls to malloc and free, i get an error of "malloc re-entrant". (i'm using purify to capture these errors).

The problem is that i can't remove calls for malloc and free either from my library or my application.

Is there a way out.
Is there a way to make these mallocs and free atomic operations, so that the signal generated can't interrupt the execution of malloc.
Is there some re-entrant versin of malloc and free for solaris.

OS is Solaris 5.8, on a Sparc platform. Kernel architecture is sun4u.
I'm using cc from Sun WorkShop 6 update 2 for compilation. The library and the application are 32-bit.

Thanks and regards.
-Sourabh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2003
Added on Oct 11 2002
1 comment
263 views