I ran into a crash today and I have found the reason for it. It seems that the 
'this' pointer that is passed to the dtor of a thread_local object is 
corrupted. I have provided a testcase for this problem.
This crash happens on i686 only. 

E:\Desktop>g++ -v
(... omitted ...)
Thread model: win32
gcc version 4.9.0 (i686-win32-sjlj-rev2, Built by MinGW-W64 project)

E:\Desktop>g++ test.cpp -std=c++1y
E:\Desktop>a
ctor of 0    // namespace scoped static
ctor of 2    // local non-static
ctor of 3    // local static
ctor of 4    // local thread_local
dtor of 2
dtor of 3
dtor of 0
dtor of 2686520    // <-   what is this?

E:\Desktop>g++ test.cpp -std=c++1y -static
E:\Desktop>a
ctor of 0
ctor of 2
ctor of 3
ctor of 4
dtor of 2
dtor of 2686628
dtor of 3
dtor of 0

--------------
Best regards,
lh_mouse
2014-06-25

Attachment: test.cpp
Description: Binary data

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to