[cfe-dev] Any known issues with libc++ exceptions and cross-thread exception propagation?

Joe Groff arcata at gmail.com
Sat Jul 21 10:10:20 PDT 2012


Hi everyone. I'm working on getting Intel's Thread Building Blocks
library to compile and run with libc++ on Mac OS X 10.7. I have it
mostly working, but I'm seeing sporadic failures in its test suite
related to the library's exception propagation features. In
particular, exceptions appear occasionally not to get thrown when
expected, and occasionally appear with the wrong type_info. My
attempts at printf debugging however seem to make the problems go away
entirely, so I think there might be threading heisenbugs at fault
here. Before investigating deeper, I wanted to ask first if there are
any known issues with libc++ that would cause problems with passing
exceptions between threads. Is libc++'s exception_ptr implementation
not properly thread safe yet, or are there any other potential
gotchas? TBB currently tries to use the obsolete draft function
"copy_exception" instead of the final standard "make_exception_ptr" to
capture exception objects; are there semantic differences between the
draft and final interfaces that could cause problems?

For reference, here's the current state of the patch against Threading
Building Blocks 4.0 Update 5 I'm working with:

https://gist.github.com/3154264

Thanks for any help!

-Joe



More information about the cfe-dev mailing list