[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#738575: pthread: segfault in libpthread on Intel Galileo board



Hi,

On 08/05/14 22:11, Aurelien Jarno wrote:
On Thu, May 08, 2014 at 04:45:00PM +0200, Jan Just Keijser wrote:
Hi,

FWIW: I've got a Galileo board and am running into similar issuse
(while running CentOS 5 on it ;))

Exact same error at the exact same location; it's not the
instruction that is not supported , a very small piece of test code
that does
  lock cmpxchgl  %edx, (%eax)
This instruction might work in some cases, but not in all cases.

works just fine - and this instruction is used left and right in the
vmlinux kernel itself anyway.
So it must be the memory offset that is triggering error ...
No it's not. It is a CPU bug, as stated by Intel in their release notes
(p 15), which only happens in "specific circumstances".

http://downloadmirror.intel.com/23197/eng/Quark_SW_RelNotes_330232_001.pdf

OK I hadn't thought of reading the Quark release notes ;)

I did find a workaround, however: if I configure glibc with the extra parameter
  -with-cpu=i386

then the assembly code generated becomes
  __nptl_setxid:
.LFB75:
        .loc 1 1046 0
.LVL87:
        pushl   %ebp
.LCFI27:
        movl    %esp, %ebp
.LCFI28:
        pushl   %edi
.LCFI29:
        pushl   %esi
.LCFI30:
        pushl   %ebx
.LCFI31:
        subl    $8, %esp
.LCFI32:
.LBB79:
        .loc 1 1049 0
        xorl    %eax, %eax
        movl    $1, %ecx
#APP
        lock;cmpxchgl %ecx, stack_cache_lock
        jnz _L_lock_698
        .subsection 1
        .type _L_lock_698,@function

and the segfault does not occur - I can now happily run a 'stock' centos 5 sshd on my galileo board. Here's my setup:
- yocto kernel 3.8.7 (from BSP 0.7.5)
- clanton image based on centos5 i386 image, using stock rpms
- modified /etc/rc.d/rc.sysinit script (don't try to mount /proc/bus/usb)
- modified /lib/libpthread.so.0 symlink to custom libpthread.so

(I'm sure I've missed a few other things ;)

share and enjoy,

JJK / Jan Just Keijser


Reply to: