Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault #27

Closed
turingking opened this issue Mar 4, 2018 · 15 comments
Closed

Segmentation fault #27

turingking opened this issue Mar 4, 2018 · 15 comments

Comments

@turingking
Copy link

turingking commented Mar 4, 2018

root@OpenWrt:~# uname -a
Linux OpenWrt 4.9.77 #0 SMP Thu Jan 25 12:45:48 2018 armv7l GNU/Linux
root@OpenWrt:~# zerotier-cli status
Segmentation fault
root@OpenWrt:~# opkg update
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/targets/bcm53xx/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/reboot_core
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/packages/arm_cortex-a9/base/Packages.gz
Updated list of available packages in /var/opkg-lists/reboot_base
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/packages/arm_cortex-a9/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/reboot_luci
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/packages/arm_cortex-a9/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/reboot_packages
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/packages/arm_cortex-a9/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/reboot_routing
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/packages/arm_cortex-a9/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/reboot_telephony
root@OpenWrt:~# opkg remove zerotier
Removing package zerotier from root...
root@OpenWrt:~# opkg install zerotier
Installing zerotier (1.2.4-3) to root...
Downloading http://mirrors.ustc.edu.cn/lede/snapshots/packages/arm_cortex-a9/packages/zerotier_1.2.4-3_arm_cortex-a9.ipk
Configuring zerotier.
root@OpenWrt:~# /etc/init.d/zerotier start
root@OpenWrt:~# zerotier-cli status
Segmentation fault
@mwarning
Copy link
Owner

mwarning commented Mar 4, 2018

Hm, do you use LEDE 17.01.4? I haven't tested any older releases.
I don't have that platform (armv7l) available to reproduce the problem.

If you don't mind using a development build, you should use images from here https://downloads.openwrt.org/snapshots/targets/
Then do "opkg update" and "opkg install zerotier".

@miegl
Copy link

miegl commented Mar 30, 2018

Getting the same exact error on latest snapshot build.

@miegl
Copy link

miegl commented Mar 30, 2018

The older zerotier 1.1.14-4 package from 17.01.4 repo seems to be working fine.

@mwarning
Copy link
Owner

Can you reproduce the problem? If yes, how? What device is affected in your case?

@miegl
Copy link

miegl commented Mar 30, 2018

root@gateway:~# opkg install zerotier
Installing zerotier (1.2.4-3) to root...
Downloading http://downloads.lede-project.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/zerotier_1.2.4-3_arm_cortex-a15_neon-vfpv4.ipk
Configuring zerotier.
root@gateway:~# nano /etc/config/zerotier
root@gateway:~# /etc/init.d/zerotier stop
root@gateway:~# /etc/init.d/zerotier start
sh: /var/lib/zerotier-one: unknown operand
Generate secret - please wait...
Segmentation fault
cat: can't open '/tmp/zt.sample_config.secret': No such file or directory
rm: can't remove '/tmp/zt.sample_config.secret': No such file or directory
root@gateway:~# /etc/init.d/zerotier start
sh: /var/lib/zerotier-one: unknown operand
root@gateway:~# zerotier-cli
Segmentation fault

The sh: /var/lib/zerotier-one: unknown operand error is probably caused by newer busybox.

My device is zyxel nbg6817.

@delandtj
Copy link

For the segfault, I haven't been able to track it down, as building it with debug makes the problem go away :-/ (Heisenberg)

But the segfault always happens on mvebu (LinkSys WRT 1900*,3200ACM) when ZT isn't built with debug info.

the unknown operand is due to :
https://github.com/openwrt/packages/blob/master/net/zerotier/files/zerotier.init#L31 , where config_path isn't set

add option config_path '/var/lib/zerotier' to have this error go away, didn't dig deeper than that

@mwarning
Copy link
Owner

mwarning commented Apr 10, 2018

ah, ok. The unknown operand error is easy to fix ("$config_path"). But I do not know about the segfault. My testing device is broken and I wait for the new shipment for a month now...

@mwarning
Copy link
Owner

@miegl
Copy link

miegl commented Apr 12, 2018

Thu Apr 12 14:33:59 2018 daemon.notice procd: /etc/rc.d/S90zerotier: Generate secret - please wait...
Thu Apr 12 14:33:59 2018 daemon.notice procd: /etc/rc.d/S90zerotier: Segmentation fault
Thu Apr 12 14:33:59 2018 daemon.notice procd: /etc/rc.d/S90zerotier: cat: can't open '/tmp/zt.sample_config.secret': No such file or directory
Thu Apr 12 14:33:59 2018 daemon.notice procd: /etc/rc.d/S90zerotier: rm: can't remove '/tmp/zt.sample_config.secret': No such file or directory

@mwarning
Copy link
Owner

@miegl thanks, I can reproduce the error now. :-)

@delandtj
Copy link

@miegl how did you get that output from procd ?

@mwarning
Copy link
Owner

@delandtj
Copy link

@mwarning do you have a branch or commit ? did you find to fix the segfault ?

@mwarning
Copy link
Owner

mwarning commented Apr 12, 2018

@delandtj I hope to have fixed it in 2ef2c02 (remove -pie from linker options)
.. though, it is not a bugfix.

@mwarning mwarning reopened this Apr 12, 2018
@miegl
Copy link

miegl commented Apr 12, 2018

@mwarning wow it actually seems to work! Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants