Bug 17

Summary: possible compiler bug causing loss of tags registry information
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: coreAssignee: Mathieu Lacage <mathieu.lacage>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P1    
Version: pre-release   
Hardware: PC   
OS: Linux   
Attachments: the patch

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.