#8586 closed Bugs (duplicate)
Boost Thread .join() causes exception. Intel C++ 13.1.1. Windows XP SP3
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | thread |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | Cc: |
Description (last modified by )
Hello, sorry for my bad english.
I just compiled a test example:
#include <boost/thread/thread.hpp> #include <iostream> void hello_world() { std::cout << "Hello from thread!" << std::endl; } int main() { boost::thread my_thread(&hello_world); my_thread.join(); }
And when my_thread.join(); calls I get an exception.
Boost 1.53.0: One error: http://i.imgur.com/J2zpjQ0.png Boost 1.52.0: Two errors: http://i.imgur.com/CekLb8O.png Boost 1.51.0: No errors. Boost 1.48.0: No errors.
I use Intel C++ Compiler 13.1.1. Windows XP SP3. I compile Boost: call bjam toolset="intel" ---build-type=complete threading=multi link=static runtime-link=static
Change History (18)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 9 years ago
comment:4 by , 9 years ago
Replying to viboes:
Does it works for Intel 12.x?
Hello, I compiled this example on Intel 12.0.1 too, same results for all four versions of boost I used before:
Thread_Boost1.53.0_ICC13.1.1.exe - bug Thread_Boost1.52.0_ICC13.1.1.exe - bug Thread_Boost1.51.0_ICC13.1.1.exe - works fine Thread_Boost1.48.0_ICC13.1.1.exe - works fine Thread_Boost1.53.0_ICC12.0.1.exe - bug Thread_Boost1.52.0_ICC12.0.1.exe - bug Thread_Boost1.51.0_ICC12.0.1.exe - works fine Thread_Boost1.48.0_ICC12.0.1.exe - works fine
It's ok if I provide executable files for all results? You can grab it here: http://rghost.ru/46127334. I tried to debug Thread_Boost1.53.0_ICC13.1.1.exe in OllyDBG and that what I got: http://i.imgur.com/VyDtVL1.png. I hope it helps. Please tell me if you need more information from me.
follow-up: 6 comment:5 by , 9 years ago
No the executables are of any use. However the fact that both version match the results mean that the problem should come from an evolution on Boost 1.52 that doesn't works correctly with Intel compiler.
I was expecting a symbolic stack :( This is a must to take care of a crash.
Could you tell me if adding a sleep on the thread function avoid the crash?
follow-up: 7 comment:6 by , 9 years ago
Replying to viboes:
No the executables are of any use. However the fact that both version match the results mean that the problem should come from an evolution on Boost 1.52 that doesn't works correctly with Intel compiler.
I was expecting a symbolic stack :( This is a must to take care of a crash.
I tried to get call stack and what I got:
- When I attach to process after exception - http://i.imgur.com/ke7ze5v.png
- When I start to debug process from beginning - http://i.imgur.com/uvFO9k8.png
I'm sorry if it's might be not helpful, I use Visual Studio very rare, so I'm not very experienced in it.
Could you tell me if adding a sleep on the thread function avoid the crash?
I tried to add this code
boost::this_thread::sleep_for(boost::chrono::milliseconds(10000));
after "Hello from thread!" message, but no difference, still crashes.
follow-up: 8 comment:7 by , 9 years ago
Replying to Alexey <lakmus@…>:
Replying to viboes:
No the executables are of any use. However the fact that both version match the results mean that the problem should come from an evolution on Boost 1.52 that doesn't works correctly with Intel compiler.
I was expecting a symbolic stack :( This is a must to take care of a crash.
I tried to get call stack and what I got:
- When I attach to process after exception - http://i.imgur.com/ke7ze5v.png
Thanks for this execution context. Could you show the complete symbolic stack?
- When I start to debug process from beginning - http://i.imgur.com/uvFO9k8.png
I'm sorry if it's might be not helpful, I use Visual Studio very rare, so I'm not very experienced in it.
Could you tell me if adding a sleep on the thread function avoid the crash?
I tried to add this code
boost::this_thread::sleep_for(boost::chrono::milliseconds(10000));after "Hello from thread!" message, but no difference, still crashes.
OK. At lest we know it is around the thread destruction.
follow-up: 9 comment:8 by , 9 years ago
Replying to viboes:
Thanks for this execution context. Could you show the complete symbolic stack?
I'm not sure where is complete symbolic stack in MSVS, but I managed to dig this windows when I loaded pdb information in debugger:
http://i.imgur.com/SBGlCOp.png
http://i.imgur.com/Ys8taGg.png
Is this helpful?
comment:9 by , 9 years ago
Replying to Alexey <lakmus@…>:
Replying to viboes:
Thanks for this execution context. Could you show the complete symbolic stack?
I'm not sure where is complete symbolic stack in MSVS, but I managed to dig this windows when I loaded pdb information in debugger:
http://i.imgur.com/SBGlCOp.png
http://i.imgur.com/Ys8taGg.png
Is this helpful?
Not too much :(
follow-up: 11 comment:10 by , 9 years ago
I don't reach to reproduce the error. Please, could you try defining BOOST_THREAD_DONT_USE_ATOMIC?
comment:11 by , 9 years ago
Replying to viboes:
I don't reach to reproduce the error. Please, could you try defining BOOST_THREAD_DONT_USE_ATOMIC?
Still receive an error.
follow-up: 13 comment:12 by , 9 years ago
Could you try dynamic allocation?
int main() { boost::thread* my_thread = new boost::thread(&hello_world); my_thread->join(); delete my_thread; }
and also
int main() { boost::thread my_thread(&hello_world); boost::this_thread::sleep_for(boost::chrono::milliseconds(10000)); my_thread.join(); }
comment:13 by , 9 years ago
Replying to viboes:
int main() { boost::thread* my_thread = new boost::thread(&hello_world); my_thread->join(); delete my_thread; }
Still error.
int main() { boost::thread my_thread(&hello_world); boost::this_thread::sleep_for(boost::chrono::milliseconds(10000)); my_thread.join(); }
Error after 10 sec. With BOOST_THREAD_DONT_USE_ATOMIC both results are the same too.
comment:14 by , 9 years ago
Summary: | Boost Thread .join() causes exception → Boost Thread .join() causes exception. Intel C++ 13.1.1. Windows XP SP3 |
---|
comment:16 by , 9 years ago
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
comment:17 by , 9 years ago
With which options was built Boost? Please show the result of bjam with -d2 option
bjam toolset="intel" ---build-type=complete threading=multi link=static runtime-link=static -d2
And your program?
What is the size of boost::detail::thread_data_base on your program? And in a Boost.Thread test?
Could you report the stack from where the exception is thrown?