Trouble with malloc 4.6.0 in mqueuecreatesupp.c (PR511 problem cause)

Joel Sherrill joel.sherrill at OARcorp.com
Thu Feb 12 14:15:49 UTC 2004


I made a sweep to eliminate use of malloc() in the
POSIX API where it was inappropriate and must have
missed this one.

The malloc should me a _Workspace_Allocate() and I
think it should be something like this:

   name = _Workspace_Allocate(strlen(name));

The real size is something like POSIX NAME_MAX but I would
have to check the OpenGroup specification to be sure.

There is also no "free" operation in mqueuedeletesupp.c
near the _Object_Close.

Please fix this and file a PR with the patch.

Cedric Aubert wrote:
> Hi all,
> 
> I just pass to rtems realease 4.6.0 from 4.6.0-pre4.
> 
> In the 4.6.0-pre4 all works fine. I use some posix
> mqueue without
> problem.
> 
> I just update the rtems release to final 4.6.0 and now
> mqueue doesn't works
> at all.
> 
> malloc(256) in _POSIX_Message_queue_Create_support
> return 0.
> 
> This is normal because malloc now forbid allocation in
> critical section
> (introduce with PR511).
> 
> But _POSIX_Message_queue_Create_support disable
> dispatch at beginning so
> malloc is in critical section.
> 
> What is the correct way to correct this mistake ? (Is
> not a problem to us to
> do a patch)
> 
> Thanks a lot
> 
> --
> Cedric AUBERT
> Ingenieur Recherche et Developpement
> SDEL Controle Commande
> D2A - Rue Nungesser et Coli
> 44860 Saint Aignan de Grand Lieu
> FRANCE
> 
> Tel : +33 (0)2 40 84 50 00
> Poste : 5109
> Fax : +33 (0)2 40 84 51 10
> 
> E-mail : cedric_aubert at yahoo.fr
> Web : http://www.sdelcc.com
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html





More information about the users mailing list