[fdo-internals] gcc mt_alloc related bugs?
Traian Stanev
traian.stanev at autodesk.com
Fri Feb 16 01:30:46 EST 2007
Yikes! I think a repressed memory is coming back. I gave up on getting my x64 MapGuide build to run after failing to resolve such an error in Xalan strings. I was using gcc 3.4 also.
Traian
-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org on behalf of Frank Warmerdam (External)
Sent: Fri 2/16/2007 3:26 AM
To: FDO Internals Mail List
Cc:
Subject: [fdo-internals] gcc mt_alloc related bugs?
Folks,
I mentioned a couple days ago that I was still seeing crashes under
some circumstances after my 64bit fixes. I have spent more hours than
I wish to contemplate digging into these crashes and have not come up
with a particular satisfying answer.
The crashes seemed to be related to corruption of the freelist
datastructures maintained by the mt_alloc allocator for stl vector
objects (ie. the XalanDOMString).
On Linux with glibc it seems you can define the environment variable
GLIBCXX_FORCE_NEW to force a new and delete to be done each time stl
container allocate or free memory, instead of using the mt_alloc pool
allocator. This seems to avoid the problem. I *thought* when running
in this mode I would finally be able to find the bug in the FDO code
using valgrind, but things run perfectly clean!
Based on a variety of googling, I am now suspecting that my Ubuntu
gcc 3.4 build is suffering from the problem described at:
http://bugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=293466
So, if people are running into strange crashes, and tracebacks in
gcc show it being deep in the glibc mt_allocator while destroying
XalanDOMString's, I would suggest defining the GLIBCXX_FORCE_NEW
environment variable. I results in a 20-30% speed reduction in
the FDO core unit tests, so there is a performance impact. But things
run clean.
I *imagine* this is fixed in newer versions of Debian/Ubuntu. I'm running
one generation behind (Ubuntu Breezy Badger).
God my head hurts.
PS. Google on mt_alloc and GLIBCXX_FORCE_NEW is educational for those
so inclined. Mateusz - please read up on this so you can help me next time
I have this problem, and I've completely forgotten what I learned this time.
:-)
Now enjoying my FDO Core UnitTest results:
OK (102)
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
_______________________________________________
fdo-internals mailing list
fdo-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-internals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-internals/attachments/20070216/0770b783/attachment-0001.html
More information about the fdo-internals
mailing list