This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: mt_allocator (rev 1.28) has static initilization problems?


On Tue, May 18, 2004 at 06:14:30PM +0200, Paolo Carlini wrote:
> > Example gdb output from a run of the second program linked against the
> > debug libstdc++:
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x0804961d in __gnu_cxx::__mt_alloc<int*>::deallocate
> > (this=0xbffff5a0, __p=0x8061c68, __n=8) at mt_allocator.h:461
> > 461 __block->_M_next = __bin._M_first[0];
> 
> If, the problem really is that the _S_options are not initialized and
> stuck at zero, why line 461 is ever reached? Deallocate should have
> returned *much* earlier!

IIRC, the _S_options are stuck at zero, but when you call allocate()
it tries to use those zeros to initialize _S_binmap and so on.  That
"works", but doesn't make the proper _S_binmap, etc, and it ends up
crashing in deallocate().

-- 
------------------------------------------------------------------
Brad Spencer - spencer@infointeractive.com - "It's quite nice..."
Systems Architect | InfoInterActive Corp. | A Canadian AOL Company


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