multithreading on linux

almatea
Posts: 29
Joined: Mon Nov 02, 2009 10:15 am

multithreading on linux

Post by almatea »

it is some changes of subject with new version of bullet?

output of multithreading demo:

Code: Select all

$ ./AppMultiThreadedDemo 
startThreads creating 4 threads.
starting thread 0
started thread 0 
starting thread 1
started thread 1 
starting thread 2
started thread 2 
starting thread 3
started thread 3 
startThreads creating 4 threads.
starting thread 0
started thread 0 
starting thread 1
started thread 1 
starting thread 2
started thread 2 
starting thread 3
started thread 3 
sizeof SpuGatherAndProcessWorkUnitInput: 16
Segmentation fault
bullet v.2.77, svn

debian lenny, amd64
Last edited by almatea on Sun Nov 07, 2010 1:08 pm, edited 1 time in total.
Kakarott2003
Posts: 1
Joined: Sun Nov 07, 2010 9:39 am

Re: multithreading on linux

Post by Kakarott2003 »

I also get something like this:
./AppMultiThreadedDemo
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
sizeof SpuGatherAndProcessWorkUnitInput: 16
Segmentation fault
And that:
./AppThreadingDemo
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
thread started
thread started
thread started
thread 2 processed number 98
thread 2 processed number 97
thread 2 processed number 96
thread 2 processed number 95
thread 2 processed number 94
thread 2 processed number 93
thread 2 processed number 92
thread 2 processed number 91
thread 2 processed number 90
thread 2 processed number 89
thread 2 processed number 88
thread 2 processed number 87
thread 2 processed number 86
thread 2 processed number 85
thread 2 processed number 84
thread 2 processed number 83
thread 2 processed number 82
thread 2 processed number 81
thread 2 processed number 80
thread 2 processed number 79
thread 2 processed number 78
thread 2 processed number 77
thread 2 processed number 76
thread 2 processed number 75
thread 2 processed number 74
thread 2 processed number 73
thread 2 processed number 72
thread 2 processed number 71
thread 2 processed number 70
thread 2 processed number 69
thread 2 processed number 68
thread 2 processed number 67
thread 2 processed number 66
thread 2 processed number 65
thread 2 processed number 64
thread 2 processed number 63
thread 2 processed number 62
thread 2 processed number 61
thread 2 processed number 60
thread 2 processed number 59
thread 2 processed number 58
thread 2 processed number 57
thread 2 processed number 56
thread 2 processed number 55
thread 2 processed number 54
thread 2 processed number 53
thread 2 processed number 52
thread 2 processed number 51
thread 2 processed number 50
thread 2 processed number 49
thread 2 processed number 48
thread 2 processed number 47
thread 2 processed number 46
thread 2 processed number 45
thread 2 processed number 44
thread 2 processed number 43
thread 2 processed number 42
thread 2 processed number 41
thread 2 processed number 40
thread 2 processed number 39
thread 2 processed number 38
thread 2 processed number 37
thread 2 processed number 36
thread 2 processed number 35
thread 2 processed number 34
thread 2 processed number 33
thread 2 processed number 32
thread 2 processed number 31
thread 2 processed number 30
thread 2 processed number 29
thread 2 processed number 28
thread 2 processed number 27
thread 2 processed number 26
thread 2 processed number 25
thread 2 processed number 24
thread 2 processed number 23
thread 2 processed number 22
thread 2 processed number 21
thread 2 processed number 20
thread 2 processed number 19
thread 2 processed number 18
thread 2 processed number 17
thread 2 processed number 16
thread 2 processed number 15
thread 2 processed number 14
thread 2 processed number 13
thread 2 processed number 12
thread 2 processed number 11
thread 2 processed number 10
thread 2 processed number 9
thread 2 processed number 8
thread 2 processed number 7
thread 2 processed number 6
thread 2 processed number 5
thread 2 processed number 4
thread 2 processed number 3
thread 2 processed number 2
thread 2 processed number 1
finished
finished waiting for response: 2 0
thread started
finished
thread 1 processed number 99
finished
finished waiting for response: 3 0
finished waiting for response: 1 0
thread 0 processed number 100
finished
finished waiting for response: 0 0
stopping threads
stopSPU: Thread 0 used: 1
Thread with taskId 0 exiting
Thread TERMINATED
destroy semaphore
semaphore destroyed
stopSPU: Thread 1 used: 1
Thread with taskId 1 exiting
Thread TERMINATED
destroy semaphore
semaphore destroyed
PThread problem at line 250 in file /home/kakarott/projects/bullet-read-only/src/BulletMultiThreaded/PosixThreadSupport.cpp: 3 0
stopSPU: Thread 2 used: 1
Thread with taskId 2 exiting
Thread TERMINATED
destroy semaphore
semaphore destroyed
PThread problem at line 250 in file /home/kakarott/projects/bullet-read-only/src/BulletMultiThreaded/PosixThreadSupport.cpp: 3 0
stopSPU: Thread 3 used: 1
Thread with taskId 3 exiting
Thread TERMINATED
destroy semaphore
semaphore destroyed
PThread problem at line 250 in file /home/kakarott/projects/bullet-read-only/src/BulletMultiThreaded/PosixThreadSupport.cpp: 3 0
destroy main semaphore
main semaphore destroyed
Press ENTER to quit
And finaly this one:
./AppBenchmarks
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
sizeof SpuGatherAndProcessWorkUnitInput: 16
Segmentation fault
I tested with 2.77 and SVN.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: multithreading on linux

Post by Erwin Coumans »

This is about the Bullet/Demos/ThreadingDemo, right?

This is some new work-in-progress code, using a critical section. There might be a bug in the demo. If someone can track it down, please let us know!
Thanks,
Erwin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: multithreading on linux

Post by Erwin Coumans »

This should be finally be fixed now in latest trunk:

http://code.google.com/p/bullet/source/detail?r=2361
Thanks for the report,
Erwin
almatea
Posts: 29
Joined: Mon Nov 02, 2009 10:15 am

Re: multithreading on linux

Post by almatea »

Erwin Coumans wrote:This should be finally be fixed now in latest trunk:

http://code.google.com/p/bullet/source/detail?r=2361
Thanks for the report,
Erwin
I download last trunk but result is same: segmentation fault on MultiThreadedDemo

system is debian linux 2.6.32-5 x86_64, dual xeon
Erwin Coumans wrote:This is about the Bullet/Demos/ThreadingDemo, right?
no, it is about Bullet/Demos/MultiThreadedDemo.

Bullet/Demos/ThreadingDemo work normal
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: multithreading on linux

Post by Erwin Coumans »

Strange, how did you build the demo exactly (build system, all flags/settings etc)?

Have you tried a 32bit build?
Thanks,
Erwin
almatea
Posts: 29
Joined: Mon Nov 02, 2009 10:15 am

Re: multithreading on linux

Post by almatea »

Erwin Coumans wrote:Strange, how did you build the demo exactly (build system, all flags/settings etc)?
system is debian linux 2.6.32-5 x86_64, dual xeon, gcc is 4.4

cmake command:

Code: Select all

cmake .. -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=... -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"
Erwin Coumans wrote: Have you tried a 32bit build?
I do not - I use 64 build. In production 32 bit is not needed.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: multithreading on linux

Post by Erwin Coumans »

The code wasn't tested properly on 64bit systems yet.

Can you try the latest trunk?
Thanks,
Erwin
ymhsieh
Posts: 4
Joined: Thu Nov 15, 2012 12:39 pm

Re: multithreading on linux

Post by ymhsieh »

I am also trying the MultiThreadedDemo (checked out from the latest SVN trunk) on Linux (64-bit Gentoo).

The good news that it does not segfault. However, it is still problematic. I got graphical window with profiling info. showing on top, but nothing in the dynamics world. In the console window, the application shows the following message...

============================
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
startThreads creating 4 threads.
starting thread 0
started thread 0
starting thread 1
started thread 1
starting thread 2
started thread 2
starting thread 3
started thread 3
sizeof SpuGatherAndProcessWorkUnitInput: 16
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
PThread problem at line 97 in file /home/ymhsieh/Work/bullet/bullet-2.81-rev2613/src/BulletMultiThreaded/PosixThreadSupport.cpp: 0 4
Overflow in AABB, object removed from simulation
If you can reproduce this, please email bugs@continuousphysics.com

Please include above information, your Platform, version of OS.

Thanks.
============================


Thanks for your great work :-)

:D
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: multithreading on linux

Post by Erwin Coumans »

So this is an unmodified MultiThreadedDemo from Bullet 2.81?

Does it happen every time you run the demo?
ymhsieh
Posts: 4
Joined: Thu Nov 15, 2012 12:39 pm

Re: multithreading on linux

Post by ymhsieh »

1. Yes, it is unmodified MultiThreadedDemo from Bullet 2.81. It also happens from the latest trunk.
2. Yes, it always happens.
jdowner
Posts: 7
Joined: Fri Jan 06, 2012 1:04 pm

Re: multithreading on linux

Post by jdowner »

I am getting sporadic (but frequent) segfaults with the multi-threading demo on gentoo (AMD 64) for version 2.81.

It seems to happen when blocks I shoot at the stack first collide with the stack (but it is not 100% of the time). I briefly looked at the demo code and I wasn't sure where the 'block shooting' code was, is it a part of the glut base class? And does that play nicely with threaded code?


[New Thread 0x7ffff2b5f700 (LWP 26328)]
started thread 0
starting thread 1
[New Thread 0x7ffff235e700 (LWP 26329)]
started thread 1
starting thread 2
[New Thread 0x7ffff1b5d700 (LWP 26330)]
started thread 2
starting thread 3
[New Thread 0x7ffff135c700 (LWP 26331)]
started thread 3
startThreads creating 4 threads.
starting thread 0
[New Thread 0x7ffff0818700 (LWP 26332)]
started thread 0
starting thread 1
[New Thread 0x7ffff0017700 (LWP 26333)]
started thread 1
starting thread 2
[New Thread 0x7fffef816700 (LWP 26334)]
started thread 2
starting thread 3
[New Thread 0x7fffef015700 (LWP 26335)]
started thread 3
[New Thread 0x7fffed191700 (LWP 26336)]
[New Thread 0x7fffec990700 (LWP 26337)]
sizeof SpuGatherAndProcessWorkUnitInput: 16
*** glibc detected *** /tmp/bullet-2.81-rev2613/build_cmake/Demos/MultiThreadedDemo/AppMultiThreadedDemo: corrupted double-linked list: 0x000000000251ac50 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7a446)[0x7ffff6962446]
/lib64/libc.so.6(+0x7bee9)[0x7ffff6963ee9]
/usr/lib64/dri/swrast_dri.so(+0x20a12f)[0x7fffed5c712f]
/usr/lib64/dri/swrast_dri.so(+0x205aa9)[0x7fffed5c2aa9]
/lib64/libpthread.so.0(+0x7da6)[0x7ffff74a6da6]
/lib64/libc.so.6(clone+0x6d)[0x7ffff69d2ebd]
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Re: multithreading on linux

Post by Granyte »

i get the same issue with multi threaded on windows x64 i can never launch even the x86 built does not run properly on my system.


not counting a previous issue i had when moving a ghost object around when using multi threaded