Bug 17 - possible compiler bug causing loss of tags registry information
possible compiler bug causing loss of tags registry information
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
pre-release
PC Linux
: P1 blocker
Assigned To: Mathieu Lacage
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-16 13:00 UTC by Gustavo J. A. M. Carneiro
Modified: 2007-04-19 04:59 UTC (History)
0 users

See Also:


Attachments
the patch (2.39 KB, patch)
2007-04-16 13:01 UTC, Gustavo J. A. M. Carneiro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2007-04-16 13:00:37 UTC
Basically, after some hours of debugging i discovered that TagRegistry::m_registry was being initialized twice in the same program, causing loss of information added to it before the second initialization.  I suspect a compiler bug, but in any case it was very easy to work around it by lazy-initializing the vector.  I committed a patch to my tree; feel free to include it upstream if you want.
Comment 1 Gustavo J. A. M. Carneiro 2007-04-16 13:01:10 UTC
Created attachment 10 [details]
the patch
Comment 2 Mathieu Lacage 2007-04-18 02:19:21 UTC
I would like to see a test-case which shows the bug first. i.e., if you are willing to send me the code, I can look into this.
Comment 3 Mathieu Lacage 2007-04-19 04:59:06 UTC
I have pushed a similar although more complete patch to lazyly initialize m_sorted too. The real issue here I think is that this code could be subject to static variable initialization order problems which might have looked like a double initialization problem to you. 

So, it would be nice to get some testing feedback on the version I pushed. Marking bug as fixed.