Program is running fine on 1.5.1. I updated poco to latest develop branch and when closing the program I started to get aborted. I'm running on linux (Arch), using clang 3.2 to compile the program (poco was compiled with gcc 4.7.2). Application is based on ServerApplication.
Invalid read of size 4
at 0x4055C97: pthread_detach (in /usr/lib/libpthread-2.17.so)
by 0x8095059: foo::bar::~bar() (bar.h:19)
I get this with three different classes that derive from Runnable and all of them have that same error in valgrind.
Could be related to this:
Can you see if reverting that change makes your problem go away?
NB: I strongly suggest double-checking to make sure you are not running stale binaries somewhere on the system.
EDIT: I did run new tests on Linux and Mac after this change and all passed. We're getting ready to release and I'd really like to know if anyone else is experiencing problems with this code.
I can confirm that reverting #79 will fix the issue.
I get the error everytime the destructor of a runnable class is executed.
I ran the ThreadTest suite and did not get any errors.
This gives me a segfault:
I compile it with
g++ -I xxx/include PocoTest.cpp -o poco-test -L xxx/lib -lpthread -lPocoFoundation
Poco is linked statically.
edit: I just tested and 1.5.1 works fine with this test program.
GH #140: Poco::Runnable threading cleanup issue
Can you please check now? I successfully ran all Threading tests on following platforms/compilers:
~/poco$ uname -a
Linux ubuntu 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64
~/poco$ g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
MacBook-Pro:testsuite alex$ uname -a
MacBook-Pro.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
MacBook-Pro:testsuite alex$ clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Thread model: posix
EDIT: also ran all Threading tests on Windows 8, VS 2012, debug and release builds - all pass
I can confirm that 6719d34 fixed the segfaultting.
great, thanks for reporting and helping with this