mwarning / zerotier-openwrt

A OpenWrt package for ZeroTier One - Pull requests are welcome!
697 stars 146 forks source link

Illegal instruction with v1.2.8 on WNDR3700 (OpenWrt 18.06.0) #37

Closed alexforencich closed 4 years ago

alexforencich commented 6 years ago

Not much else to say. Seems to work on WNDR4300v1, fails with illegal instruction on WNDR3700v2. It appears both are using the same mips_24kc package.

mwarning commented 6 years ago

I don't think I can debug this without hardware. What image did you use (compiled it yourself or downloaded from openwrt.org)? And how did you install Zerotier?

alexforencich commented 6 years ago

I downloaded the latest build of 18.06.0 from OpenWrt and installed zerotier through the web interface, so I presume it came from the OpenWrt package archive for 18.06.0. If there is anything I can do to help debug this, I can certainly run stuff on the router in question.

mwarning commented 6 years ago

I think the problem are stack protection flags used for building ZT. Some flags would need to be tested. But I do not have the time right now.

zyclonite commented 6 years ago

see the same behavior on WNDR3700v2, when i upgrade to zt 1.2.12 i get a seq fault... interesting is... it does not fail immediately, most of the time its works some minutes, creates the interface, joins the network a.s.o. but suddenly crashes

i tried to build everything from scratch as well... no luck yet

@mwarning what stack protection flags are you referring to?

mwarning commented 6 years ago

ZeroTier defines a few: https://github.com/zerotier/ZeroTierOne/blob/master/make-linux.mk#L66 I had to change it a bit to run on my test platform (and thought this would be sufficient..) https://github.com/openwrt/packages/tree/master/net/zerotier/patches

zyclonite commented 6 years ago

built (against 18.06.0) without stack-protection flag works well on a tl-wdr4300-v1

@alexforencich please test this build on your WNDR3700v2 (i cannot reach mine from work) https://router.wsn.at/dist/packages/mips_24kc/packages/zerotier_1.2.12-2_mips_24kc.ipk

mwarning commented 6 years ago

Nice, if this works for @alexforencich as well, then please make a pull request or let me know what you have changed.

zyclonite commented 6 years ago

my tests

removing the -fstack-protector flag did not help

alexforencich commented 6 years ago

Tried it, it seems to be segfaulting

mwarning commented 6 years ago

@zyclonite ZT adds -fstack-protector also to CXXFLAGS in its Makefile and various flags depending on the platform. I suspect the problem to be there.

zyclonite commented 6 years ago

i'll do some more tests/tries but i am off for around a week now

mwarning commented 6 years ago

ok, thank you very much for the testing so far!

zyclonite commented 6 years ago

i did a debug build for the zerotier package, maybe someone can test it (my router seems to be broken, power supply and wan port, so i can not test any longer)

https://router.wsn.at/dist/packages/mips_24kc/packages/zerotier_1.2.12-2_mips_24kc-debug.ipk

mwarning commented 6 years ago

@zyclonite can you get me a openwrt-ramips-mt7620-wt3020-8M-squashfs-sysupgrade.bin? I do not have any other platform available for testing right now.

zyclonite commented 6 years ago

@mwarning here you are (including debug build of zt) https://router.wsn.at/dist/ramips/mt7620/openwrt-ramips-mt7620-wt3020-8M-squashfs-sysupgrade.bin

mwarning commented 6 years ago

@zyclonite ZT/image works for me.

zyclonite commented 6 years ago

i fear its only this wndr3700v2 which does not work...

zyclonite commented 6 years ago

got another wndr370v2 router to test during the weekend, tried the debug version... but it looks like it is always crashing at different situations (at least what the consule output states before the crash)

a bit strange was, the debug version has no symbols... so i could not attach gdb... do i need another flag for the build to include debug symbols?

mwarning commented 6 years ago

The package makefile passes a flag to the Zerotier makefile: https://github.com/mwarning/zerotier-openwrt/blob/master/zerotier/Makefile#L42 Maybe the Makefile do not recognize that flag anymore.

zyclonite commented 6 years ago

i think, that's working because i get debug output but still no debug flags... need to check the zt repo...

alexforencich commented 6 years ago

Same problem under openwrt 18.06.1. Zerotier fails to start with 'illegal instruction'.

qq472870007 commented 6 years ago

i have met the same problem on my wndr3800 zerotier version is 1.2.8,I try to update to 1.2.10, faild 'zerotier-one -d' will be killed without any log Neither official or compiled myself And my openwrt is also 18.06.1 and HUAWEI hg255d is faild too

mwarning commented 6 years ago

What about openwrt nightly? https://downloads.openwrt.org/snapshots/targets/

qq472870007 commented 6 years ago

https://downloads.openwrt.org/snapshots/targets/ar71xx/generic/openwrt-ar71xx-generic-wndr3800-squashfs-sysupgrade.bin (Tue Oct 9 13:37:29 2018 ) && zerotier 1.2.12 the process is been killed too

zyclonite commented 6 years ago

crashes on some other routers as well (tested with tl-wr1043nd v1)... but it can take to several hours until that happens

mwarning commented 6 years ago

@zyclonite do you see the "invalid instruction" in the system log?

zyclonite commented 6 years ago

i'll try to find this out... problem is, this is a remote router and after zt crashed i need to drive there to check (and on avg it happens every after 6 to 8 hours)

qq472870007 commented 6 years ago

it seem the problem is solved on the WNDR3800 the nightly version with zt 1.2.12。 but i meet a new problem with huawei HG255d.

mwarning commented 4 years ago

Please open another ticket for the huawei HG255d if it is still present.