Poster | Thread |
TheAMIgaOne
| |
OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 21:35:45
| | [ #1 ] |
|
|
|
Cult Member |
Joined: 10-Jan-2004 Posts: 776
From: United Kingdom | | |
|
| been working on my dropbox app on OS4.0 and runs fine, since installing OS4.1.4 i keep getting a pop messege from the ELF library stating 'unable to resolve symbol' 'pthread_mutex_lock'
My app uses the following .so objects
liboauth.so libssl.so libcrypt.so libcurl.so librtmp.so libsqlite3.so think others are built into OS4.0 and OS4.1
Last edited by TheAMIgaOne on 18-Mar-2012 at 09:37 PM.
_________________ Cross-developer on Windows, OS3, OS4, Linux; Current Projects:- Nephele Cloud App OS4 UserProfile System OS4 AmigaOneXE OS4.1.6
TaoSoftwareBlog Youtube |
|
Status: Offline |
|
|
kas1e
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 21:44:25
| | [ #2 ] |
|
|
|
Elite Member |
Joined: 11-Jan-2004 Posts: 3551
From: Russia | | |
|
| @TheAMIgaOne
You need to add "-lpthreads" to your compiling line, so it will attach necessary references to libpthreads.so , which will works if you will have libpthreads.so in sobjs pathes.
But to be note, beware with that pthread crap : pthread_mutex_lock its a fucntion on which many projects give DSI, and the only solution for them its build non_pthread versions of libraries.
Like for exampe in case with my stuff, i can say that about 10 from 100 ports, which use in one or in another way something with phtreads (offten that sdl_mixer and/or mikmod), crashes on that function. For example yesterday we build some stuff which crashes exactly because of pthread, exactly on the pthread_mutex , and all works fine when we build all the necessary libs without pthreads usage.
I didn't find the motivation and time to find out the roots and repot them, but i just currently make for myself one rul "never use pthreads if you do not want problems with it".
ps. You also can do search in the sobjs which you use, on the words "pthread" . Pretty possibl that its only one of them want it (like curl builded with pthreads support or kind), and will be nough to recompile such library without pthreads. Last edited by kas1e on 18-Mar-2012 at 09:47 PM. Last edited by kas1e on 18-Mar-2012 at 09:45 PM.
_________________ Join us to improve dopus5! zerohero's mirror of os4/os3 crosscompiler suites |
|
Status: Offline |
|
|
TheAMIgaOne
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 21:48:03
| | [ #3 ] |
|
|
|
Cult Member |
Joined: 10-Jan-2004 Posts: 776
From: United Kingdom | | |
|
| @kas1e
ahh nice, its probably the libcurl as that can work multi-threaded
il see if it works, thanks.
UPDATE
thanks, problem SOLVED Last edited by TheAMIgaOne on 18-Mar-2012 at 09:50 PM.
_________________ Cross-developer on Windows, OS3, OS4, Linux; Current Projects:- Nephele Cloud App OS4 UserProfile System OS4 AmigaOneXE OS4.1.6
TaoSoftwareBlog Youtube |
|
Status: Offline |
|
|
kas1e
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 21:50:10
| | [ #4 ] |
|
|
|
Elite Member |
Joined: 11-Jan-2004 Posts: 3551
From: Russia | | |
|
| @TheAMIgaOne
Yep, it can works fine, but can give a bugs (i just do not know currently because of what reassons). To add, Curl builded as multi-threaded with usage of phtreads buggy, crashy and just do not works (i test it many times when tryint to build for muiowb version of curl which multithreaded with usage of pthreads). But sure, check everything , maybe you will be lucky one with it :) _________________ Join us to improve dopus5! zerohero's mirror of os4/os3 crosscompiler suites |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 22:29:23
| | [ #5 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| @kas1e
I hear ths pthreads is crap stuff quite a lot.
However I have never come across any issues with it. Well okay not strictly true as during blender developement I came a cross an issue which I managed to describe and report and has been fixed, (since about update 2 I think)
I would be good if we could nail this one down too. If you can't describe a bug to a devloper (especially a busy one) they wont be able to fix it. (It's reasonable to assume that if they found it themselves they would fix it)
Quote:
offten that sdl_mixer and/or mikmod |
SDL itself doesn't use pthreads IIRC. So is it possible mixing SDL and pthread threads causes an issue?
Do these prolems occur in combination with C++ if so our gcc does not create threadsafe c++ so that could be a cause.
Ultimately though we need agood example preferabley simple (though I realise that it isn't always easy to create simple examples) to make the basis of a prper report.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
kas1e
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 22:51:48
| | [ #6 ] |
|
|
|
Elite Member |
Joined: 11-Jan-2004 Posts: 3551
From: Russia | | |
|
| @broadblues
Yeah sure, need to invistigate that one. Knowing that bad bug-report its not bug-report at all, i just hold it all , and only say all of that to desribe what kind of problems he can catch with pthreads.
To add, i remember that i meet with that DSI on mutex_thread_lock even with some non sdl related stuff, but that need to recheck twice of cours.
Lately i got it with mikmod, which used in sdl_based project, but mikmod itself do not use sdl , and crash was somthere in the player.c of mikmod.
Another time (months ago), i got that dsi with some small game port, do not remember the name sadly.
Usually bug happens right at first time. I.e. you run programm/game, and then bah, dsi whih can't be skipped. Then you just build project with libs which compiled without using of pthreads, and all works fine.
If you in interest to worry about it, and help to find the roots, i can do tests, prepare crashlogs, and co. _________________ Join us to improve dopus5! zerohero's mirror of os4/os3 crosscompiler suites |
|
Status: Offline |
|
|
Thematic
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 23:10:27
| | [ #7 ] |
|
|
|
Super Member |
Joined: 28-Oct-2003 Posts: 1616
From: I'm actually flying into a bug! | | |
|
| For SDL projects it seems pthread comes into the picture by sdl_mixer and more specifically mikmod... so if it is stable but does not come with any mod files, you could see what happens when you make it play mods instead of some other format. _________________ : AmigaOneXE (unmod.) 750FX/512 MB +stuff & AmigaOS 4.(0|1) : A1200/68060&96MB/SCSI/EM1200-Voodoo3 & OS 3.5 : A500/1MB : Pegasos (ff) 512 MB & MorphOS Praise seitan. |
|
Status: Offline |
|
|
Chris_Y
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 18-Mar-2012 23:24:00
| | [ #8 ] |
|
|
|
Elite Member |
Joined: 21-Jun-2003 Posts: 3205
From: Beds, UK | | |
|
| @TheAMIgaOne
Quote:
ahh nice, its probably the libcurl as that can work multi-threaded |
Never use the threaded resolver version of libcurl on OS4. It does not work.
Fab does not seem very forthcoming with the source code for the non-pthreads threaded resolver unfortunately, as that would most likely work perfectly on OS4.
_________________ "Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion Avatar is Tabitha by Eric W Schwartz |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 0:19:01
| | [ #9 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| @kas1e
If you can produce a program that crashes and a crashlog that would be a start.
Then we can work from there.
I remeber another place I found some pthread crashes. and that was in my OpenEXR viewer and lib that I built for blender. there reason there was a contructor that attempted to intialise an array of mutexs before the pthreads.libray was open. I fixed that one by an allocation of first access so that the initilsation happened after pthreads.library was open.
Because pthreads.libary is opend within libpthereads,.so or libpthreads.a we have no control over when it's opened so this kind of problem needs to be eliminated. _________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 0:19:59
| | [ #10 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| |
Status: Offline |
|
|
TheAMIgaOne
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 0:43:56
| | [ #11 ] |
|
|
|
Cult Member |
Joined: 10-Jan-2004 Posts: 776
From: United Kingdom | | |
|
| @broadblues
So far seems to be working well, even sqlite which seems to use pthreads work ok, no bug crashes yet, just my own bugs occasionally.
Thou one thing I noticed, using SQLite to insert just 1000 records into a Database stored on a FFS2 drive is amazingly slow, now wonder ppl said to me to start using SFS as it turns minutes into seconds
Now heres the fun part, since using the Database stored on a SFS/01 partition, my 8000 odd record inserts (on my Amigaone XE 800, via IDE) is way faster than a Athlon 64 dual core + usb2 drive lol well done who ever ported the sqlite.so _________________ Cross-developer on Windows, OS3, OS4, Linux; Current Projects:- Nephele Cloud App OS4 UserProfile System OS4 AmigaOneXE OS4.1.6
TaoSoftwareBlog Youtube |
|
Status: Offline |
|
|
kas1e
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 9:55:49
| | [ #12 ] |
|
|
|
Elite Member |
Joined: 11-Jan-2004 Posts: 3551
From: Russia | | |
|
| @broadblues
Quote:
I know that because of my tests with muiowb. Its just absolutly buggy when builded with pthreads support. And we can think that its problem of our realisation because on other oses (such as linux of course) , the same curl-threaded code works fine. But pretty possible its can be all about those "non-safe threads" parts.
Crhis_Y know the same and have the same expirience from Netsurf, when he tryes to build threaded curl with usage of our pthreads.
@TheAmgaOne
Quote:
Thou one thing I noticed, using SQLite to insert just 1000 records into a Database stored on a FFS2 drive is amazingly slow, now wonder ppl said to me to start using SFS as it turns minutes into seconds
|
FFS is uber slow when it comes to handly a lot of small files. For example, if you will install AISS (thousands of small images) on the FFS partition, then every programm whih use AISS icons, will opens in the 10-15 second, instead of 1 second and less when AISS installed on SFS.
By all of this i mean if you will have database full of files (thousands), then point clear in readme that FFS is no go.Last edited by kas1e on 19-Mar-2012 at 10:59 AM. Last edited by kas1e on 19-Mar-2012 at 10:59 AM. Last edited by kas1e on 19-Mar-2012 at 09:57 AM.
_________________ Join us to improve dopus5! zerohero's mirror of os4/os3 crosscompiler suites |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 10:26:51
| | [ #13 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| @kas1e
Quote:
I know that because of my tests with muiowb. Its just absolutly buggy when builded with pthreads support. And we can think that its problem of our realisation because on other oses (such as linux of course) , the same curl-threaded code works fine. But pretty possible its can be all about those "non-safe threads" parts.
Crhis_Y know the same and have the same expirience from Netsurf, when he tryes to build threaded curl with usage of our pthreads.
|
Sure I believe you both when you say it has problems, but I can't take that to a bug report, I need crah logs etc that I can form decent report from.
Last edited by broadblues on 19-Mar-2012 at 10:27 AM.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
kas1e
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 10:35:06
| | [ #14 ] |
|
|
|
Elite Member |
Joined: 11-Jan-2004 Posts: 3551
From: Russia | | |
|
| @broadblues
Well, as you seems brave one to dig in in that pthreads stuff, i will try to prepare something very soon. At least i have some kind right now which crashes in pthread_mutex because of mikmod builded with pthreads, so we can start from it (i will try to reduce code to small one) _________________ Join us to improve dopus5! zerohero's mirror of os4/os3 crosscompiler suites |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 10:52:38
| | [ #15 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| |
Status: Offline |
|
|
spotUP
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 17:58:02
| | [ #16 ] |
|
|
|
Elite Member |
Joined: 19-Aug-2003 Posts: 2896
From: Up Rough Demo Squad | | |
|
| @broadblues
Go on boys! \o/ _________________ AOS4 Betatester, Peg2, G4@1ghz, Radeon 9250 256mb, 1gb RAM.
http://www.asciiarena.com http://www.uprough.net |
|
Status: Offline |
|
|
Chris_Y
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 18:00:38
| | [ #17 ] |
|
|
|
Elite Member |
Joined: 21-Jun-2003 Posts: 3205
From: Beds, UK | | |
|
| @broadblues
Quote:
broadblues wrote: Sure I believe you both when you say it has problems, but I can't take that to a bug report, I need crah logs etc that I can form decent report from.
|
It works for a bit and then crashes with a DSI somewhere in bsdsocket.library. Either bsdsocket.library is not coping with multiple threads (seems a bit unlikely, otherwise multiple simultaneous network accesses would also crash), or pthreads is doing something nasty which is causing bsdsocket.library to crash. As the only difference between the threaded and non-threaded libcurl is the usage of pthreads, that seems the most likely culprit. Of course I'm not discounting the fact that the bug might be in libcurl itself.
I did have a crashlog, but I'm sure that is long gone. I'll dig out my threaded libcurl and see if I can generate another one.
_________________ "Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion Avatar is Tabitha by Eric W Schwartz |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 18:52:03
| | [ #18 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| @Chris_Y
Quote:
It works for a bit and then crashes with a DSI somewhere in bsdsocket.library. Either bsdsocket.library is not coping with multiple threads (seems a bit unlikely, otherwise multiple simultaneous network accesses would also crash), or pthreads is doing something nasty which is causing bsdsocket.library to crash. As the only difference between the threaded and non-threaded libcurl is the usage of pthreads, that seems the most likely culprit. Of course I'm not discounting the fact that the bug might be in libcurl itself.
|
Well the primary difference between the two is that it's threaded. Is bsdsocket.library opened seperately for each for each thread? It needs to be if IIUC.
Quote:
I did have a crashlog, but I'm sure that is long gone. I'll dig out my threaded libcurl and see if I can generate another one.
|
That could be useful.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
Chris_Y
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 20:08:09
| | [ #19 ] |
|
|
|
Elite Member |
Joined: 21-Jun-2003 Posts: 3205
From: Beds, UK | | |
|
| @broadblues
Quote:
Well the primary difference between the two is that it's threaded. Is bsdsocket.library opened seperately for each for each thread? It needs to be if IIUC. |
Good question. I haven't looked at the code and didn't build it, so I don't know. MickJT might.
Quote:
Stack trace: module LIBS:bsdsocket.library at 0x6FBBE994 (section 5 @ 0x3B974) module LIBS:bsdsocket.library at 0x6FBBDA88 (section 5 @ 0x3AA68) module LIBS:bsdsocket.library at 0x6FBBDCE4 (section 5 @ 0x3ACC4) module LIBS:bsdsocket.library at 0x6FBBE25C (section 5 @ 0x3B23C) module LIBS:bsdsocket.library at 0x6FBB06E8 (section 5 @ 0x2D6C8) native kernel module newlib.library.kmod+0x00039970 libcurl.so.7:Curl_ipv4_resolve_r()+0x84 (section 9 @ 0x30dc0) libcurl.so.7:gethostbyname_thread()+0x20 (section 9 @ 0x3dc80) libcurl.so.7:curl_thread_create_thunk()+0x4C (section 9 @ 0x3c1ac) pthreads.library:run()+0x278 (section 1 @ 0x4134) pthreads.library:ThreadCode()+0x35C (section 1 @ 0x44dc) native kernel module dos.library.kmod+0x00022a0c native kernel module kernel+0x0003af48 native kernel module kernel+0x0003afc8
|
full crashlog
_________________ "Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion Avatar is Tabitha by Eric W Schwartz |
|
Status: Offline |
|
|
broadblues
| |
Re: OS4.1.4 'pthread_mutex_lock' problem Posted on 19-Mar-2012 21:16:32
| | [ #20 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4447
From: Portsmouth England | | |
|
| |
Status: Offline |
|
|