libstdc++/7168: C++ Exceptions in Multithreaded Applications Crash (cygwin)

lprimak@hope.nyc.ny.us lprimak@hope.nyc.ny.us
Sat Jun 29 21:31:00 GMT 2002


>Number:         7168
>Category:       libstdc++
>Synopsis:       C++ Exceptions in Multithreaded Applications Crash (cygwin)
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 29 14:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Lenny Primak
>Release:        2.95.3-5 (cygwin special)
>Organization:
>Environment:
Cygwin stock cygwin.com 1.3 install, MS Windows  (any)
>Description:
Superceeds gnats/7167,
using the C++ exception system from multiple threads corrupts the gcc's internal exception stack, due to not including the thread-specific exception context in the compile.
>How-To-Repeat:
The attached program will determine whether the exception context is thread-specific or not
>Fix:
Looking for one
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc_exception.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc_exception.C"

I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxwdGhyZWFkLmg+CiNpbmNsdWRlIDxzeXMvcG9s
bC5oPgoKCmV4dGVybiAiQyIgdm9pZCAqCl9fZ2V0X2VoX2NvbnRleHQgKCk7CgoKc3RhdGljIHZv
aWQqIHNhdmVkX2VoX2NvbnRleHQgPSAwOwoKc3RhdGljIHZvaWQqIGZ1bmModm9pZCopIHRocm93
KGNoYXIqKQp7Cgl2b2lkKiBlaF9jbnR4dCA9IF9fZ2V0X2VoX2NvbnRleHQoKTsKCXByaW50Zigi
ZnVuYygpIC0gZWhfY29udGV4dCA9ICVYXG4iLCBlaF9jbnR4dCk7CglpZihzYXZlZF9laF9jb250
ZXh0ID09IDApCgl7CgkJc2F2ZWRfZWhfY29udGV4dCA9IGVoX2NudHh0OwoJfQoJZWxzZQoJewoJ
CWlmKGVoX2NudHh0ID09IH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