When using both OpenCL (AMD APP SDK 2.8 for development) and binary boost libraries (here for example the threads library, boost 1.50). in the same program, compiled in x64 mode and run in VS 2008, on program start-up I receive the following VS message:
"Windows has triggered a breakpoint in program.exe. This may be due to a corruption of the heap, which indicates a bug in program.exe or any of the DLLs it has loaded".
I don't receive this error when just linking to either the OpenCL or boost libraries alone (i.e., only if used in combination it appears). I don't receive the error for x86 compilations. The dlls loaded are the same. Besides this VS message the program itself appears to run perfectly fine. If the program is run outside VS, of course no message appears.
Any experience or ideas? Are there some compiler options that the AMD APP enforces on compilation of external libraries due to the ABI? Is that more likely a VS issue, or the hint for something more severe going on under the hood without having shown severe symptoms yet?
Is there an AMD x64 sample project which does use (link against) a boost library component?
hmmmm, well Bolt is using boost. That's why i suggested that.
Well I have never tried to integrate the boost and OpenCL together. Probably you can upload a small repro-case here. Other developers may pinpoint any error.
Some links which may be helpful:
Does Bolt make use of any library which needs to be linked against (i.e., precompiled usually) or, headers-only?
I will investigate the issue with the new boost 1.54 release and try to post a repro case here. Could be some incompatible options used during compilation of boost causing the troubles.
I have tested the new Boost 1.54 library release, the problem remains. However I have tracked down the issue being related specifically to the boost::threads library (no errors with e.g. boost::regex or boost::chrono, which all depend on compiled libraries).
In order to reproduce the issue (VS 2008, 64-bit compilation) please do as follows:
1) install boost (www.boost.org; I can confirm the problem for 1.52 and 1.54 at a minimum) and build libraries for VS 2008, x64
2) Pick a sample included in the AMD APP samples, e.g. I used the EigenValue sample.
3) #include the boost::threads through adding this line to EigenValue.cpp (I have put it right before the #include "EigenValue.hpp" statement):
4) make sure the boost::threads library is used and associated DLLs are loaded through a dummy-usage of it (insert these two lines in main; I have put them right before the "return SDK_SUCCESS;" line:
5) run the program - compiled in x64 mode (debug) - from _within_ the VS2008 IDE (of course, include the boost library and link against it in project settings).
6) the error message should pop-up righ on program initialization, i.e. before the main-code gets entered - it must be hit during global initialization of the boost library. The program itself runs fine through.
As mentioned, no error occurs if either only the sample is compiled in x64, or the boost::threads library is used in an x64 application without OpenCL -> have hit the error only if both OpenCL and boost::threads are used concurrently, and only in x64.