Closed L3rd closed 8 years ago
Sorry, I currently don't have an ARMv5 platform configured. My ARMv7 router is a bit "busy" right now, but I will try to reproduce this when possible.
Can I help somehow? FYI, it is blocking to work MC and other packages...
Maybe it is related: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591075
strace /opt/bin/glib-compile-schemas execve("/opt/bin/glib-compile-schemas", ["/opt/bin/glib-compile-schemas"], [/* 24 vars */]) = 0 readlinkat(AT_FDCWD, "/proc/self/exe", 0xbe9bf710, 4096) = -1 ENOSYS (Function not implemented) mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40006000 open("/opt/lib/libglib-2.0.so.0", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=1146556, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 A\1\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 1212416, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 mmap2(0x40017000, 1141172, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x40017000 mmap2(0x4013e000, 2488, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x117000) = 0x4013e000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libintl.so.8", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=34524, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h\25\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 102400, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4013f000 mmap2(0x4013f000, 31112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x4013f000 mmap2(0x40157000, 660, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x8000) = 0x40157000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\20\277\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 712704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40158000 mmap2(0x40158000, 620956, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x40158000 mmap2(0x401ff000, 4784, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x97000) = 0x401ff000 mmap2(0x40201000, 18160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40201000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libiconv.so.2", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=904800, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\220\20\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 970752, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40206000 mmap2(0x40206000, 900772, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x40206000 mmap2(0x402f2000, 2584, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xdc000) = 0x402f2000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libpthread.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=116452, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\220F\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 159744, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x402f3000 mmap2(0x402f3000, 79440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x402f3000 mmap2(0x40316000, 4124, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x13000) = 0x40316000 mmap2(0x40318000, 4328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40318000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libintl.so.8", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=34524, ...}) = 0 close(3) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 close(3) = 0 open("/opt/lib/librt.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=17348, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\25\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 86016, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4031a000 mmap2(0x4031a000, 14084, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x4031a000 mmap2(0x4032d000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x4032d000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libiconv.so.2", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=904800, ...}) = 0 close(3) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 close(3) = 0 stat("/opt/lib/ld-uClibc.so.1", {st_mode=S_IFREG|0755, st_size=25356, ...}) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 close(3) = 0 open("/opt/lib/libdl.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=13224, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\24\f\0\0004\0\0\0"..., 4096) = 4096 mmap2(NULL, 81920, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4032f000 mmap2(0x4032f000, 8805, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x4032f000 mmap2(0x40341000, 4120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x40341000 close(3) = 0 munmap(0x40007000, 4096) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 close(3) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 close(3) = 0 open("/opt/lib/libpthread.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=116452, ...}) = 0 close(3) = 0 open("/opt/lib/libdl.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=13224, ...}) = 0 close(3) = 0 open("/opt/lib/libc.so.1", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=624332, ...}) = 0 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_UNINITIALIZED, -1, 0) = 0x40007000 set_tls(0x40007490, 0x40007000, 0x40007b38, 0x40007490, 0x40015f6c) = 0 open("/dev/urandom", O_RDONLY) = 3 read(3, "\340r\362\312", 4) = 4 close(3) = 0 mprotect(0x401ff000, 4096, PROT_READ) = 0 mprotect(0x40316000, 4096, PROT_READ) = 0 mprotect(0x4032d000, 4096, PROT_READ) = 0 mprotect(0x40015000, 4096, PROT_READ) = 0 mprotect(0x40341000, 4096, PROT_READ) = 0 set_tid_address(0x40007068) = 28817 set_robust_list(0x40007070, 12) = -1 ENOSYS (Function not implemented) rt_sigaction(SIGRTMIN, {0x402fcc10, [], SA_RESTORER|SA_SIGINFO, 0x401647e4}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0x402fca7c, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x401647e4}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 ugetrlimit(RLIMIT_STACK, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} --- +++ killed by SIGSEGV +++ Segmentation fault
armv5 glib-compile-schemas
and mc
work OK on my armv7 router. I can't make anything out from your strace
output: right up till (including)
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
it's the same, but carries on without segfault further:
...
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
brk(0) = 0x28000
brk(0x29000) = 0x29000
gettimeofday({1453729352, 910261}, NULL) = 0
brk(0x2a000) = 0x2a000
brk(0x2d000) = 0x2d000
brk(0x2f000) = 0x2f000
getuid32() = 0
geteuid32() = 0
getgid32() = 0
getegid32() = 0
open("/opt/share/locale/locale.alias", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, TCGETS, 0xbed98628) = -1 ENOTTY (Inappropriate ioctl for device)
read(3, "# Locale name alias data base.\n#"..., 4096) = 3116
brk(0x30000) = 0x30000
read(3, "", 4096) = 0
close(3) = 0
open("/opt/share/locale/en_US.UTF-8/LC_MESSAGES/glib20.mo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/opt/share/locale/en_US.utf8/LC_MESSAGES/glib20.mo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/opt/share/locale/en_US/LC_MESSAGES/glib20.mo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/opt/share/locale/en.UTF-8/LC_MESSAGES/glib20.mo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/opt/share/locale/en.utf8/LC_MESSAGES/glib20.mo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/opt/share/locale/en/LC_MESSAGES/glib20.mo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
write(2, "You should give exactly one dire"..., 43You should give exactly one directory name
) = 43
exit_group(1) = ?
+++ exited with 1 +++
Please first install debug versions of needed libs:
wget -qO- https://github.com/alllexx88/Optware-ng/files/103329/debug.tar.bz2.zip | tar -xjvf - -C /
(this will only install some unstripped libs in /opt/lib
and unstripped /opt/bin/glib-compile-schemas
)
Next please install gdb
(ipkg -force-overwrite install gdb
) and give me the output of:
/opt/bin/gdb /opt/bin/glib-compile-schemas
run
bt full
Probably the error is due to the kernel of the nas: uname -a Linux Heaven 2.6.12.6-arm1 #1 Sun Sep 18 01:42:37 CST 2011 armv5tejl GNU/Linux
I believe version 2.16 of glib2 (glibc 2.16 (30 Jun 2012)) is the last version supported by the kernel in the TS-109Pro (http://man7.org/tlpi/api_changes/#glibc-2.16).
No, GLib and glibc (GNU lib C) are two different matters: https://en.wikipedia.org/wiki/GLib
2.6.12 kernel is very old, but I don't see anything from the stack trace that would support your assumption. Please try gdb
/opt/bin/gdb /opt/bin/glib-compile-schemas GNU gdb (GDB) 7.10.1 Copyright (C) 2015 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-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /opt/bin/glib-compile-schemas...done. (gdb) (gdb) run Starting program: /share/HDA_DATA/.qpkg/Optware/Optware-NG/bin/glib-compile-schemas linux-nat.c:4715: internal-error: creating event pipe failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) n
This is a bug, please report it. For instructions, see: http://www.gnu.org/software/gdb/bugs/.
linux-nat.c:4715: internal-error: creating event pipe failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) n Command aborted. (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /share/HDA_DATA/.qpkg/Optware/Optware-NG/bin/glib-compile-schemas linux-nat.c:4715: internal-error: creating event pipe failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) n
This is a bug, please report it. For instructions, see: http://www.gnu.org/software/gdb/bugs/.
linux-nat.c:4715: internal-error: creating event pipe failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) y Segmentation fault [/share/HDA_DATA/big-disk/optware-ng] #
Looks like gdb
isn't working due to old incompatible old kernel (the feed is built with 2.6.34 kernel headers). Maybe, the issue with glib
is likewise kernel related. Could you please try to compile gdb
natively (using Optware-ng gcc, if there's no native compiler available from the firmware)? Maybe, I should create another ARMv5 feed with 2.6.12 kernel headers. I take it, your NAS isn't receiving upgrades for a long while now, since it uses 2.6.12 kernel, which was released in the mid 2005?
@L3rd Just to keep you updated, I'm currently working on buildroot-armv5eabi-ng-legacy
feed, which uses linux 2.6.12. When ready, it should work fine on TS-109Pro
Thank you, I'm looking forward to test it.
@L3rd This will take a while, since there're many things to fix, since many contemporary syscalls or features are missing from 2.6.12. Some packages I can only mark as broken due to this reason, some can be patched or configured to not use unsupported parts, while others have to be downgraded. There's still a lot to be done, but I am making progress on this.
@L3rd buildroot-armv5eabi-ng-legacy feed is now online. It's gcc-5.3.0 uclibc-ng-1.0.12 linux-2.6.12 feed. Refer to the README for bootstrapping instructions.
I just tried, I'm getting segmentation fault:
[~] # wget -O - http://ipkg.nslu2-linux.org/optware-ng/bootstrap/buildroot-armv5eabi-ng-legacy-bootstrap.sh | sh --2016-03-18 12:56:24-- http://ipkg.nslu2-linux.org/optware-ng/bootstrap/buildroot-armv5eabi-ng-legacy-bootstrap.sh Resolving ipkg.nslu2-linux.org... 140.211.169.161 Connecting to ipkg.nslu2-linux.org|140.211.169.161|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 378 [text/plain] Saving to:
STDOUT'
100%[===================================================================================================================================================>] 378 --.-K/s in 0.007s
2016-03-18 12:56:25 (55.6 KB/s) - `-' saved [378/378]
--2016-03-18 12:56:27-- http://ipkg.nslu2-linux.org/optware-ng/buildroot-armv5eabi-ng-legacy/ipkg-static_0.99.163-3_arm.ipk Resolving ipkg.nslu2-linux.org... 140.211.169.161 Connecting to ipkg.nslu2-linux.org|140.211.169.161|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 231560 (226K) [text/plain] Saving to: `ipkg-static_0.99.163-3_arm.ipk'
100%[===================================================================================================================================================>] 231,560 217K/s in 1.0s
2016-03-18 12:56:29 (217 KB/s) - `ipkg-static_0.99.163-3_arm.ipk' saved [231560/231560]
./data.tar.gz ./ ./opt/ ./opt/bin/ ./opt/bin/ipkg-static ./opt/bin/ipkg ./opt/bin/update-alternatives ./opt/lib/ ./opt/share/ ./opt/share/ipkg/ ./opt/share/ipkg/intercept/ ./opt/share/ipkg/intercept/update-modules ./opt/share/ipkg/intercept/depmod ./opt/share/ipkg/intercept/ldconfig ./opt/etc/ ./opt/etc/ipkg.conf Bootstraping done [~] # ipkg Segmentation fault [~] # `
@L3rd I suspect that QNAP TS-109Pro kernel has syscalls different from official 2.6.12 kernel. If you can find GPL sourcecode for it, I can try to compile a toolchain with these headers.
FYI, the non-legacy ipkg was working without issue, however here some info regarding the GPL sourcecode: https://sourceforge.net/projects/qosgpl/ (Probably: GPL_TS-20101126-3.3.x.tar.gz) Info on the TS-109 Pro: https://www.cyrius.com/debian/orion/qnap/ts-109/ https://www.qnap.com/i/en/product_x_down/product_down.php?type=1&II=93
The file you linked to has 2.6.33.2 Linux source only. Also, there's an ARM toolchain on the same project page with Linux 2.6.22 headers, but no trace of 2.6.12 anywhere, nor did I manage to find it elsewhere -- that's why I was asking. If you can find me proper headers for your platform, I can try to support your device, without this -- I'm helpless
Also, as per the Debian link you posted, you can get a modern Debian system running on your device, with an up-to-date kernel and lots of pre-compiled Debian packages. If you'd like to use Optware-ng still, you can than use the buildroot-armv5eabi-ng feed with it. I see no point to stick to your archaic 2.6.12 firmware, if you can run Debian :-)
Since this isn't fixable without proper kernel headers, I'm closing the issue
FWIW, QNAP corroborate @L3rd's guess - see this forum post which also has kernel configs (registration required). So it is probably some frankenkernel.
While I'm here, thank you very much for the legacy feed. It is a lifesaver even as is, and is seeing use out there. If it could be kept alive without too much trouble that would be great.
Installing http://optware-ng.zyxmon.org/buildroot-armv5eabi-ng/glib_2.47.3-1_arm.ipk lead to segmentation fault on a QNAP TS-109Pro.
ipkg install glib
Installing glib (2.47.3-1) to root... Downloading http://optware-ng.zyxmon.org/buildroot-armv5eabi-ng/glib_2.47.3-1_arm.ipk Configuring glib Generating /opt/share/glib-2.0/schemas/gschemas.compiled Segmentation fault postinst script returned status 139 ERROR: glib.postinst returned 139 Successfully terminated.