Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-11-05 11:12:12


Quite a while ago Jeremy Siek asked for a change to the lock
implementation in Boost.Threads. He needed direct access to the
locking members of all the mutex types in order to create a
locking_ptr<> concept in an efficient manner. We talked about it and
decided that a lock_ops<> template (this will be the first time
Jeremy has seen the name I've chosen) added to the detail::thread
namespace could be employed to reduce coupling for all locking
concepts including his locking_ptr<>.

Well, Friday I made the changes and everything worked wonderfully
with VC++. So I checked things into CVS. Today something told me
I'd better check this with gcc as well before the next release. A
minor code bug was detected and fixed and everything now compiles
cleanly with gcc. Unfortunately, when the regression test
(test\test_thread) is built and run with gcc I receive a seg-fault.
I'm not a gcc expert by any stretch of the imagination and I'm
struggling with the tools while trying to debug this error. When I
run in gdb I get the following results:

(gdb) run
run
Starting program:
C:\home\boost\libs\thread\test\bin\test_thread\gcc\debug\runti
me-link-dynamic/test_thread.exe
10000000:C:\home\boost\libs\thread\test\bin\test_thread\gcc\debug\runt
ime-link-d
ynamic\libboost_threadmon.dll
77e80000:C:\WINNT\system32\KERNEL32.dll
78000000:C:\WINNT\system32\msvcrt.dll

Program received signal SIGSEGV, Segmentation fault.
0x77f827e8 in ?? ()
(gdb) backtrace
backtrace
#0 0x77f827e8 in ?? ()
#1 0x77e86a3d in _libmsvcrt_a_iname ()
#2 0x401d76 in test_condition_notify_one () at test_thread.cpp:239
#3 0x4029f3 in test_condition () at test_thread.cpp:369
#4 0x402e39 in test_main () at test_thread.cpp:447
#5 0x401501 in cpp_main (argc=1, argv=0x3f4ed0)
    at //C/home/boost/boost/test/test_main.cpp:65
#6 0x41ce65 in boost::test::cpp_main_caller::operator()
(this=0x22ff28)
    at //C/home/boost/boost/test/cpp_main.cpp:75
#7 0x41f35a in
catch_exceptions__H1ZQ35boost4test15cpp_main_caller_5boostX01R7o
streamT2_i (function_object={argc = 1, argv = 0x3f4ed0},
out=@0x42b03c,
    err=@0x42b07c)
at //C/home/boost/boost/detail/catch_exceptions.hpp:65
#8 0x40126f in main (argc=1, argv=0x3f4ed0)
    at //C/home/boost/boost/test/cpp_main.cpp:83

I don't have a clue what _libmsvcrt_a_iname() is and
test_condition_notify_one() at test_thread.cpp:239 is a call to
boost::thread::join() which seems to be correct (especially
considering that it works flawlessly with MSVC++).

So, I'd like to ask the list readers a couple of favors. If anyone
can diagnose what's going on here and let me know how to fix things
that would be great. It also would be beneficial for anyone using
Boost.Threads on other platforms to check and insure I've not broken
anything else. We don't have much time left until Beman wants to cut
the next release and I may have to revert to an earlier version in
CVS, but we need to figure out what's wrong here for the long run
even then.

Thanks,
Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk