Re: [arm-gnu] pthread_mutex_lock issue with buildroot external toolchain CS 2010.09
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] pthread_mutex_lock issue with buildroot external toolchain CS 2010.09



On Fri, Jul 1, 2011 at 11:15 PM, Dwi Sasongko Supriyadi
<ruckuus@xxxxxxxxx>wrote:

> On Fri, Jul 1, 2011 at 10:45 PM, Carlos O'Donell
> <carlos@xxxxxxxxxxxxxxxx> wrote:
> > On 7/1/2011 3:08 AM, Dwi Sasongko Supriyadi wrote:
> >>
> >> On Thu, Jun 30, 2011 at 9:55 PM, Carlos O'Donell
> >> <carlos@xxxxxxxxxxxxxxxx>  wrote:
> >>>
> >>> On 6/30/2011 4:21 AM, Dwi Sasongko Supriyadi wrote:
> >>>>
> >>>> 1. Buildroot version: buildroot-2011.02 from git
> >>>>
> >>>> 2. External toolchain from Code Sourcery 2010.09
> >>>>
> >>>> 3. Running kernel on the target linux-2.6.28.6
> >>>>
> >>>> Has anyone faced the same issue (related with libpthread from CS
> >>>> toolchain) and came up with solutions?
> >>>>
> >>>> I really appreciate any feedback/suggestion from all of you.
> >>>
> >>> Did you install the CodeSourcery provided libpthread on the target?
> >>>
> >>
> >> Yes, I did. When selecting gdb for the target, libpthread and
> >> libthread_db from external toolchain will be copied to the target.
> >
> > You need more than that, you need all of the sysroot libraries on the
> > target.
> >
>
> Understood.
>
> > The last time I looked at buildroot in 2010 it was still incorrectly
> copying
> > the sysroot for a multilib'd toolchain and required patching.
> >
> > You don't have to patch buildroot, you just need to copy the correct
> sysroot
> > to the target as a post-build step.
> >
>
> Thank you for your suggestion. I will try it later today, and see how it
> goes.
>
>
I have copied sysroot libs to the target and following is the gdb bactrace

# gdb /usr/sbin/pcscd
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-unknown-linux-gnueabi"...
(no debugging symbols found)
(gdb) run --foreground --debug --apdu
Starting program: /usr/sbin/pcscd --foreground --debug --apdu
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
debuglog.c:277:DebugLogSetLevel() debug level=debug
debuglog.c:306:DebugLogSetCategory() Debug options: APDU
pcscdaemon.c:550:main() pcsc-lite 1.7.2 daemon ready.
[New Thread 0x400c4000 (LWP 128)]
[New Thread 0x40b15470 (LWP 131)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x40b15470 (LWP 131)]
0x401254e8 in pthread_mutex_lock () from /lib/libpthread.so.0
(gdb) info threads
* 2 Thread 0x40b15470 (LWP 131)  0x401254e8 in pthread_mutex_lock ()
   from /lib/libpthread.so.0
  1 Thread 0x400c4000 (LWP 128)  0x4012be64 in read ()
   from /lib/libpthread.so.0
(gdb) bt
#0  0x401254e8 in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x401beec4 in ?? () from /usr/lib/libusb-1.0.so.0
Cannot access memory at address 0x1

Seems there is no change unless two threads are now created, and the issue
in pthread_mutex_lock() remains the same.

I also catch the log during configure time as follow

:
checking whether
/opt/buildroot/buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi-gcc
--sysroot=/opt/buildroot/buildroot/output/host/usr/arm-unknown-linux-gnueabi/sysroot
and cc understand -c and -o together... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for pthread_cancel... yes
:
:

Any suggestion?

Many thanks in advance,
DWI