cannot build pam inside a qemu-armel chroot due to segfault in w3m
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Linaro QEMU |
New
|
Undecided
|
Unassigned | |
| qemu-linaro (Ubuntu) |
Medium
|
Unassigned |
Bug Description
I am attempting to build pam inside a lucid-based chroot on top of precise/amd64. In the later stages of the build, xsltproc runs and it ends up segfaulting. The build works fine on real hardware.
I will attempt to narrow it down to a simple command you can run and post that as a comment when I get it.
mfisch@caprica:~$ apt-cache policy qemu-user-static
qemu-user-static:
Installed: 1.0.50-
Candidate: 1.0.50-
Version table:
*** 1.0.50-
500 http://
100 /var/lib/
Matt Fischer (mfisch) wrote : | #1 |
Matt Fischer (mfisch) wrote : | #2 |
strace attached and it seems to indicate that xsltproc is not pulling in the outside URL. This could be a dependency issue, please let me investigate further before anyone else looks at this.
Matt Fischer (mfisch) wrote : | #3 |
I looked at the stacktraces in that file above and the behavior is odd. The failure is actually in w3m, which appears to be horrible broken:
root@caprica:~# w3m
Absurd stack bottom value
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted (core dumped)
It appears that w3m is calling futex and is being told "not implemented":
root@caprica:~# qemu-arm-static -strace /usr/bin/w3m
9923 brk(NULL) = 0x00114000
9923 uname(0x40800058) = 0
9923 access(
9923 mmap2(NULL,
9923 access(
9923 open("/
9923 fstat64(
9923 mmap2(NULL,
9923 close(5) = 0
9923 access(
9923 open("/
9923 read(5,
9923 fstat64(
9923 mmap2(NULL,
9923 mprotect(
9923 mmap2(0x4088e00
9923 close(5) = 0
9923 access(
9923 open("/
9923 read(5,
9923 fstat64(
9923 mmap2(NULL,
9923 mmap2(NULL,
9923 mprotect(
9923 mmap2(0x408a600
9923 mmap2(0x408a800
9923 close(5) = 0
9923 access(
9923 open("/
9923 read(5,
9923 fstat64(
9923 mmap2(NULL,
9923 mprotect(
9923 mmap2(0x408b300
9923 close(5) = 0
9923 access(
9923 open("/
9923 read(5,
9923 fstat64(
9923 mmap2(NULL,
9923 mprotect(
9923 mmap2(0x408d300
9923 mmap2(0x408d500
9923 close(5) = 0
9923 access(
9923 open("/
9923 read(5,
9923 fstat64(
9923 mmap2(NULL,
9...
summary: |
- cannot build pam inside a qemu-armel chroot due to segfault in xsltproc + cannot build pam inside a qemu-armel chroot due to segfault in w3m |
Matt Fischer (mfisch) wrote : | #4 |
Revise my repro steps from #1.
Now you only need to run:
apt-get install w3m
w3m
Changed in qemu-linaro (Ubuntu): | |
importance: | Undecided → Medium |
Steve Langasek (vorlon) wrote : | #5 |
Seems to be related to libgc which w3m uses. Even trying to cross-build a debug version of w3m fails because it tries to run mktables at build time which is also linked to libgc:
gdb-multiarch ./mktable
GNU gdb (Ubuntu/Linaro 7.4-0ubuntu1) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://
Reading symbols from /tmp/w3m-
(gdb) set architecture armv5t
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
[New Remote target]
Reading symbols from /lib/ld-
Loaded symbols for /lib/ld-linux.so.3
[Switching to Remote target]
0x40801c80 in ?? () from /lib/ld-linux.so.3
(gdb) break main
Breakpoint 1 at 0x8920: file mktable.c, line 30.
(gdb) cont
Continuing.
Breakpoint 1, main (argc=1, argv=0x4080061c, envp=0x40800624) at mktable.c:30
30 {
(gdb) stepi
0x00008924 30 {
(gdb)
30 {
(gdb)
0x00008928 30 {
(gdb)
39 GC_INIT();
(gdb)
0x000088f8 in GC_init ()
(gdb) bt
#0 0x000088f8 in GC_init ()
#1 0x0000892e in main (argc=1, argv=0x4080061c, envp=<optimized out>)
at mktable.c:39
(gdb) fin
Run till exit from #0 0x000088f8 in GC_init ()
Program received signal SIGSEGV, Segmentation fault.
0x40834de6 in ?? ()
Changed in qemu-linaro (Ubuntu): | |
status: | New → Triaged |
Steve Langasek (vorlon) wrote : | #6 |
Backtrace, after getting symbols manually loaded:
(gdb) bt
#0 GC_mark_from (mark_stack_
mark_
#1 0x40835dd0 in GC_mark_some (cold_gc_
at mark.c:401
#2 0x4082fc68 in GC_stopped_mark (stop_func=
at alloc.c:504
#3 0x408301b0 in GC_try_
stop_
#4 0x40837216 in GC_init_inner () at misc.c:735
#5 GC_init_inner () at misc.c:474
#6 0x0000892e in main (argc=1, argv=0x4080061c, envp=<optimized out>)
at mktable.c:39
(gdb)
Line 796 is:
deferred = *(word *)limit;
(gdb) print limit
$2 = (ptr_t) 0x408180b8 <Address 0x408180b8 out of bounds>
Peter Maydell (pmaydell) wrote : | #7 |
Oh, boehm gc. There are several known problems with that. The OpenSuSE folks have done some work which deals with this but it's not upstream yet (and at least one of the fixes is a hack which won't get accepted upstream and where the right fix is probably at least several weeks work).
In order to repro this you need to install the following packages inside your chroot: w3m xsltproc
Using the file README.xml that I am attaching below, run the following command:
/usr/bin/xsltproc --path . --xinclude --stringparam generate.toc "none" --nonet http:// docbook. sourceforge. net/release/ xsl/current/ html/docbook. xsl README.xml | /usr/bin/w3m -T text/html -dump > ./README