gcc-3.4.0: mt_allocator crashes due to alignment problems on SPARC targets when sizeof(type) <= 2

Paolo Carlini pcarlini@suse.de
Tue May 4 22:22:00 GMT 2004


Brad Spencer wrote:

>It appears that when sizeof(type) is less than or equal to 2, the
>mt_allocator does not ensure proper alignment of the block_record
>structures when building the freelists.   This causes the allocator
>code itself to crash during initialization.
>  
>
Hi. This issue is well known and already (partially, at least) fixed in 
mainline.
Could you possibly try it?

Anyway, on mainline too, we only ensure currently alignment-4 on 32-bit 
machines
and alignement-8 on 64-bit machines, I have a patch in testing that 
changes it to
8 and 16 respectively, exactly what malloc returns.

Please, be patient for a few days...

>Also, I wasn't aware that the default allocator had become "new", at
>least for Solaris targets.  Was this intentional?
>  
>
Yes. Again, on mainline (or a snapshot of 3.4.1) pool_allocator is also 
available again.

Paolo.



More information about the Libstdc++ mailing list