Hi again all,
I finally managed to get my system installed in such a way that I can have both NPTL and LinuxThreads versions of glibc installed at the same time. However it's proving a headache.
VDR (1.3.21 down to 1.3.19 - I've not tried anything below this) hangs on recording and becomes totally unresponsive - no input from the console is read, no response from SVDRP, nothing is displayed via the DVB card.
I've looked into where the hang happens and its in SpinUpDisk on the line that calls system("sync") - if I comment this line out then everything works perfectly!
Has anyone encountered this problem?
Many thanks, Chris
I've looked into where the hang happens and its in SpinUpDisk on the line that calls system("sync") - if I comment this line out then everything works perfectly!
I worked out what was happening - system(const char *string) uses /bin/sh which in my case is bash - bash is linked to the NTPL version of glibc. I wrote a small test which showed that executing something which uses NTPL threads from an application which uses linuxthreads never returns.
If the caller doesn't use threading the problem doesn't seem to occur.
So I've replaced system("sync") with an fsync(f) before the file descriptor is closed. The disk spins up fine now.
Thanks, Chris
Chris Warren wrote:
I've looked into where the hang happens and its in SpinUpDisk on the line that calls system("sync") - if I comment this line out then everything works perfectly!
I worked out what was happening - system(const char *string) uses /bin/sh which in my case is bash - bash is linked to the NTPL version of glibc. I wrote a small test which showed that executing something which uses NTPL threads from an application which uses linuxthreads never returns.
If the caller doesn't use threading the problem doesn't seem to occur.
So I've replaced system("sync") with an fsync(f) before the file descriptor is closed. The disk spins up fine now.
Looks good - especially since it gets rid of the last 'system()' call in VDR.
I guess I'll use fdatasync(), though, which according to the manual should try even harder to make sure everything is in sync.
Klaus