Very few implementations of malloc are reentrant.  Making malloc thread safe 
without locking is not a trivial task. Using malloc within a signal trap is 
frowned upon in my experience.

ASE


On Jul 9, 2014, at 6:36 AM, Dr. Werner Fink <wer...@suse.de> wrote:

> Hi,
> 
> even with _AST_std_malloc==0 and _map_malloc==1 I see sometimes that
> the test suite hangs for ever in signal.sh.  After attaching the gdb
> to such a hanging ksh process I can identify that this happens in
> the signal handler sh_fault() if the Siginfo structure is allocated.
> The back trace shows that the ksh hanging at last in a nanosleep()
> call within tvsleep() called below src/lib/libast/vmalloc/
> 
> In other words even the libast variant of memory allocation is not
> reentrant.
> 
> Werner
> 
> -- 
>  "Having a smoking section in a restaurant is like having
>          a peeing section in a swimming pool." -- Edward Burr
> _______________________________________________
> ast-developers mailing list
> ast-developers@lists.research.att.com
> http://lists.research.att.com/mailman/listinfo/ast-developers

_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to