hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

LEDE support for arm_cortex-a15_neon-vfpv4 #159

Open imkebe opened 6 years ago

imkebe commented 6 years ago

Something went wrong with compliation?

Target: ipq806xSubtarget: genericPackage architecture: arm_cortex-a15_neon-vfpv4 Linux kokos 4.4.74 #0 SMP Fri Jul 14 21:36:50 2017 armv7l GNU/Linux

dmesg

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.4.74 (cezary@eko.one.pl) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3101-bce140e) ) #0 SMP Fri Jul 14 21:36:50 2017
[    0.000000] CPU: ARMv7 Processor [512f04d0] revision 0 (ARMv7), cr=10c5787d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] Machine model: TP-Link Archer C2600

cli

root@kokos:~# opkg install cjdns luci-app-cjdns
Installing cjdns (0.17-3) to root...
Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/routing/cjdns_0.17-3_arm_cortex-a15_neon-vfpv4.ipk
Installing luci-app-cjdns (1.3-5) to root...
Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/routing/luci-app-cjdns_1.3-5_arm_cortex-a15_neon-vfpv4.ipk
Configuring cjdns.
Segmentation fault
Segmentation fault
dkjson: no valid JSON value (reached the end) (try cjdroute --cleanconf)
Segmentation fault
Segmentation fault
dkjson: no valid JSON value (reached the end) (try cjdroute --cleanconf)
Segmentation fault
Segmentation fault
dkjson: no valid JSON value (reached the end) (try cjdroute --cleanconf)
Configuring luci-app-cjdns.
root@kokos:~# cjdroute --cleanconf
Segmentation fault

root@kokos:~# gdb cjdroute
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 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-openwrt-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 cjdroute...(no debugging symbols found)...done.
(gdb)
wfleurant commented 6 years ago

you can post a backtrace bt from gdb (see: cjdns/HACKING.md)

or, install strace and run strace /usr/sbin/cjdroute

example output:

root@APU2:~# strace /usr/sbin/cjdroute
execve("/usr/sbin/cjdroute", ["/usr/sbin/cjdroute"], [/* 12 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x7f1df7a3fb48) = 0
set_tid_address(0x7f1df7a3fb80)         = 23730
open("/etc/ld-musl-x86_64.path", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=69736, ...}) = 0
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P)\0\0\0\0\0\0"..., 960) = 960
mmap(NULL, 2170880, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x7f1df75c2000
mmap(0x7f1df77d2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0x7f1df77d2000
close(3)                                = 0
mprotect(0x7f1df77d2000, 4096, PROT_READ) = 0
mprotect(0x7f1df7a3c000, 4096, PROT_READ) = 0
mprotect(0x559fd7702000, 4096, PROT_READ) = 0
open("/dev/urandom", O_RDONLY)          = 3
read(3, "S\324\210Me\222\16:\275\213\202\213S\16\256\370\335\277Q\7%\37~i\336\273\205\253\223\326WI"..., 64) = 64
close(3)                                = 0
open("/proc/sys/kernel/random/uuid", O_RDONLY) = 3
read(3, "a60369bc-e29b-48d7-8ebb-1b140f97"..., 37) = 37
close(3)                                = 0
open("/proc/sys/kernel/random/uuid", O_RDONLY) = 3
read(3, "21d8fbad-3caa-4088-a18c-8b326241"..., 37) = 37
close(3)                                = 0
open("/proc/sys/kernel/random/uuid", O_RDONLY) = 3
read(3, "e2ef3f6a-5118-4c40-8eac-d8e664a6"..., 37) = 37
close(3)                                = 0
open("/proc/sys/kernel/random/uuid", O_RDONLY) = 3
read(3, "2846b071-fc4b-4dbf-a4a2-43695fb4"..., 37) = 37
close(3)                                = 0
getrandom("\xde\xf8\x94\x08\x1a\x06\x3d\x78\xae\x58\xb5\xf0\x5e\xce\xed\xd1\xfa\x24\x58\x7d\xf5\x05\xf0\x73\x2f\x65\xdc\xb5\x83\x07\x35\x02"..., 64, 0) = 64
pipe2([3, 4], O_CLOEXEC)                = 0
write(4, "*", 1)                        = 1
clock_getres(CLOCK_MONOTONIC_COARSE, {tv_sec=0, tv_nsec=10000000}) = 0
epoll_create1(EPOLL_CLOEXEC)            = 5
pipe2([6, 7], O_NONBLOCK|O_CLOEXEC)     = 0
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 9
ioctl(0, TIOCGWINSZ, {ws_row=43, ws_col=97, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=43, ws_col=97, ws_xpixel=0, ws_ypixel=0}) = 0
writev(1, [{iov_base="Cjdns amd64 linux +seccomp", iov_len=26}, {iov_base="\nUsage:\n    cjdroute --help     "..., iov_len=1255}], 2Cjdns amd64 linux +seccomp
Usage:
    cjdroute --help                This information
    cjdroute --genconf [--no-eth]  Generate a configuration file, write it to stdout
                                   if --no-eth is specified then eth beaconing will
                                   be disabled.
    cjdroute --bench               Run some cryptography performance benchmarks.
    cjdroute --version             Print the protocol version which this node speaks.
    cjdroute --cleanconf < conf    Print a clean (valid json) version of the config.
    cjdroute --nobg                Never fork to the background no matter the config.

To get the router up and running.
Step 1:
  Generate a new configuration file.
    cjdroute --genconf > cjdroute.conf

Step 2:
  Find somebody to connect to.
  Check out the IRC channel or https://hyperboria.net/
  for information about how to meet new people and make connect to them.
  Read more here: https://github.com/cjdelisle/cjdns/#2-find-a-friend

Step 3:
  Add that somebody's node to your cjdroute.conf file.
  https://github.com/cjdelisle/cjdns/#3-connect-your-node-to-your-friends-node

Step 4:
  Fire it up!
    sudo cjdroute < cjdroute.conf

For more information about other functions and non-standard setups, see README.md
) = 1281
exit_group(0)                           = ?
+++ exited with 0 +++
imkebe commented 6 years ago

gdb is usefull here, however strace outputs :

root@kokos:~# strace /usr/sbin/cjdroute
execve("/usr/sbin/cjdroute", ["/usr/sbin/cjdroute"], [/* 13 vars */]) = 0
set_tls(0xb6fef540, 0xbef04c10, 0xb6ff00a0, 0, 0xb6fef498) = 0
set_tid_address(0xb6fef4b4)             = 29370
open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=40487, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\10;\0\0004\0\0\0"..., 936) = 936
mmap2(NULL, 106496, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb6f60000
mmap2(0xb6f79000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x9000) = 0xb6f79000
close(3)                                = 0
mprotect(0xb6fed000, 4096, PROT_READ)   = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7f68348c} ---
+++ killed by SIGSEGV +++
Segmentation fault
imkebe commented 6 years ago

Can I help anyhow ?

ringtailedfox commented 2 years ago

I have this issue as well, only on a Netgear Nighthawk X4S R7800 running OpenWrt 21.02.1. The target and architecture are the same...

root@Nighthawk:~# opkg install cjdns Installing cjdns (v21-1) to root... Downloading https://downloads.openwrt.org/releases/21.02.1/packages/arm_cortex-a15_neon-vfpv4/routing/cjdns_v21-1_arm_cortex-a15_neon-vfpv4.ipk Configuring cjdns. Segmentation fault Segmentation fault dkjson: no valid JSON value (reached the end) (try cjdroute --cleanconf) Segmentation fault Segmentation fault dkjson: no valid JSON value (reached the end) (try cjdroute --cleanconf) uci: Parse error (invalid character in name field) at line 1, byte 37 uci: Parse error (invalid command) at line 1, byte 0 uci: Entry not found (invalid command) at line 1, byte 0

uci: Entry not found (invalid command) at line 1, byte 0

Segmentation fault Segmentation fault dkjson: no valid JSON value (reached the end) (try cjdroute --cleanconf) root@Nighthawk:~# cjdroute --cleanconf Segmentation fault

wfleurant commented 2 years ago

i believe these are separate issues but, we can test against the latest build.
find the latest build of cjdns package [1] (downloads for your target board, rename the .ipkg file to .tar.gz, extract, then again with data.tar.gz. keep it all in the /tmp directory and test the /tmp/cjdroute execution. if it works, you can overwrite the broken one.

[1] https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/cjdns_v21-3_arm_cortex-a15_neon-vfpv4.ipk

ringtailedfox commented 2 years ago

i believe these are separate issues but, we can test against the latest build. find the latest build of cjdns package [1] (downloads for your target board, rename the .ipkg file to .tar.gz, extract, then again with data.tar.gz. keep it all in the /tmp directory and test the /tmp/cjdroute execution. if it works, you can overwrite the broken one.

[1] https://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/cjdns_v21-3_arm_cortex-a15_neon-vfpv4.ipk

Well... i still get a segmentation fault, but it's more verbose now:

root@Nighthawk:~# cjdroute Error relocating /usr/sbin/cjdroute: clock_getres_time64: symbol not found Error relocating /usr/sbin/cjdroute: utime64: symbol not found Error relocating /usr/sbin/cjdroute: fstat_time64: symbol not found Error relocating /usr/sbin/cjdroute: __clock_gettime64: symbol not found Error relocating /usr/sbin/cjdroute: utimes_time64: symbol not found Error relocating /usr/sbin/cjdroute: stat_time64: symbol not found Error relocating /usr/sbin/cjdroute: time64: symbol not found Error relocating /usr/sbin/cjdroute: nanosleep_time64: symbol not found Error relocating /usr/sbin/cjdroute: gettimeofday_time64: symbol not found Error relocating /usr/sbin/cjdroute: __lstat_time64: symbol not found Error relocating /usr/sbin/cjdroute: __pthread_cond_timedwait_time64: symbol not found Segmentation fault

Edit: same results with cjdroute --cleanconf as well:

root@Nighthawk:~# cjdroute --cleanconf Error relocating /usr/sbin/cjdroute: clock_getres_time64: symbol not found Error relocating /usr/sbin/cjdroute: utime64: symbol not found Error relocating /usr/sbin/cjdroute: fstat_time64: symbol not found Error relocating /usr/sbin/cjdroute: __clock_gettime64: symbol not found Error relocating /usr/sbin/cjdroute: utimes_time64: symbol not found Error relocating /usr/sbin/cjdroute: stat_time64: symbol not found Error relocating /usr/sbin/cjdroute: time64: symbol not found Error relocating /usr/sbin/cjdroute: nanosleep_time64: symbol not found Error relocating /usr/sbin/cjdroute: gettimeofday_time64: symbol not found Error relocating /usr/sbin/cjdroute: __lstat_time64: symbol not found Error relocating /usr/sbin/cjdroute: __pthread_cond_timedwait_time64: symbol not found Segmentation fault