janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.48k stars 225 forks source link

Tests not passing on Raspberry Pi 4B #1377

Closed sarna closed 8 months ago

sarna commented 8 months ago

When trying to run make test on my Raspberry Pi I'm getting this error:

Starting suite test/suite-ev.janet...
error: could not bind to any sockets
  in net/listen [src/core/net.c] on line 643
  in net/server [boot.janet] on line 3782, column 12
  in _while [test/suite-ev.janet] on line 195, column 10
  in _thunk [test/suite-ev.janet] (tailcall) on line 183, column 1
make: *** [Makefile:256: test] Error 1

Thought it's a permission thing, but the result is the same with sudo.

I installed Janet despite the failing tests, but when I tried launching a server from spork/httpf it failed with the same error as above.

I'm happy to provide more details or run any patched versions :)

Full log and system info ``` pi@malina:~ $ cd janet-1.33.0/ pi@malina:~/janet-1.33.0 $ ls assets CHANGELOG.md examples janet_win.rc Makefile meson_options.txt src tools build_win.bat CONTRIBUTING.md janet.1 LICENSE meson.build README.md test pi@malina:~/janet-1.33.0 $ make cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/abstract.boot.o -c src/core/abstract.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/array.boot.o -c src/core/array.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/asm.boot.o -c src/core/asm.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/buffer.boot.o -c src/core/buffer.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/bytecode.boot.o -c src/core/bytecode.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/capi.boot.o -c src/core/capi.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/cfuns.boot.o -c src/core/cfuns.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/compile.boot.o -c src/core/compile.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/corelib.boot.o -c src/core/corelib.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/debug.boot.o -c src/core/debug.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/emit.boot.o -c src/core/emit.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/ev.boot.o -c src/core/ev.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/ffi.boot.o -c src/core/ffi.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/fiber.boot.o -c src/core/fiber.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/gc.boot.o -c src/core/gc.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/inttypes.boot.o -c src/core/inttypes.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/io.boot.o -c src/core/io.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/marsh.boot.o -c src/core/marsh.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/math.boot.o -c src/core/math.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/net.boot.o -c src/core/net.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/os.boot.o -c src/core/os.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/parse.boot.o -c src/core/parse.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/peg.boot.o -c src/core/peg.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/pp.boot.o -c src/core/pp.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/regalloc.boot.o -c src/core/regalloc.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/run.boot.o -c src/core/run.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/specials.boot.o -c src/core/specials.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/state.boot.o -c src/core/state.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/string.boot.o -c src/core/string.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/strtod.boot.o -c src/core/strtod.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/struct.boot.o -c src/core/struct.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/symcache.boot.o -c src/core/symcache.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/table.boot.o -c src/core/table.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/tuple.boot.o -c src/core/tuple.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/util.boot.o -c src/core/util.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/value.boot.o -c src/core/value.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/vector.boot.o -c src/core/vector.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/vm.boot.o -c src/core/vm.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/core/wrap.boot.o -c src/core/wrap.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/boot/array_test.boot.o -c src/boot/array_test.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/boot/boot.boot.o -c src/boot/boot.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/boot/buffer_test.boot.o -c src/boot/buffer_test.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/boot/number_test.boot.o -c src/boot/number_test.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/boot/system_test.boot.o -c src/boot/system_test.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/boot/table_test.boot.o -c src/boot/table_test.c cc -DJANET_BOOTSTRAP -DJANET_BUILD="\"local\"" -O0 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -g -o build/janet_boot build/core/abstract.boot.o build/core/array.boot.o build/core/asm.boot.o build/core/buffer.boot.o build/core/bytecode.boot.o build/core/capi.boot.o build/core/cfuns.boot.o build/core/compile.boot.o build/core/corelib.boot.o build/core/debug.boot.o build/core/emit.boot.o build/core/ev.boot.o build/core/ffi.boot.o build/core/fiber.boot.o build/core/gc.boot.o build/core/inttypes.boot.o build/core/io.boot.o build/core/marsh.boot.o build/core/math.boot.o build/core/net.boot.o build/core/os.boot.o build/core/parse.boot.o build/core/peg.boot.o build/core/pp.boot.o build/core/regalloc.boot.o build/core/run.boot.o build/core/specials.boot.o build/core/state.boot.o build/core/string.boot.o build/core/strtod.boot.o build/core/struct.boot.o build/core/symcache.boot.o build/core/table.boot.o build/core/tuple.boot.o build/core/util.boot.o build/core/value.boot.o build/core/vector.boot.o build/core/vm.boot.o build/core/wrap.boot.o build/boot/array_test.boot.o build/boot/boot.boot.o build/boot/buffer_test.boot.o build/boot/number_test.boot.o build/boot/system_test.boot.o build/boot/table_test.boot.o -lm -lpthread -lrt -ldl build/janet_boot . JANET_PATH '/usr/local/lib/janet' > build/c/janet.c cksum build/c/janet.c 1227349090 2891217 build/c/janet.c cc -O2 -g -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -c build/c/janet.c -o build/janet.o cp src/mainclient/shell.c build/c/shell.c cc -O2 -g -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -c build/c/shell.c -o build/shell.o cc -rdynamic -O2 -g -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -o build/janet build/janet.o build/shell.o -lm -lpthread -lrt -ldl ar rcs build/libjanet.a build/janet.o build/shell.o ./build/janet tools/patch-header.janet src/include/janet.h src/conf/janetconf.h build/janet.h cc -O2 -g -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC -Wl,-soname,libjanet.so.1.33 -shared -o build/libjanet.so build/janet.o build/shell.o -lm -lpthread -lrt -ldl pi@malina:~/janet-1.33.0 $ make test for f in test/suite*.janet; do ./build/janet "$f" || exit; done Starting suite test/suite-array.janet... Finished suite test/suite-array.janet in 0.003 seconds - 20 of 20 tests passed. Starting suite test/suite-asm.janet... Finished suite test/suite-asm.janet in 0.005 seconds - 5 of 5 tests passed. Starting suite test/suite-boot.janet... Finished suite test/suite-boot.janet in 0.055 seconds - 524 of 524 tests passed. Starting suite test/suite-buffer.janet... Finished suite test/suite-buffer.janet in 0.005 seconds - 41 of 41 tests passed. Starting suite test/suite-capi.janet... Finished suite test/suite-capi.janet in 0.001 seconds - 9 of 9 tests passed. Starting suite test/suite-cfuns.janet... Finished suite test/suite-cfuns.janet in 0.000 seconds - 2 of 2 tests passed. Starting suite test/suite-compile.janet... Finished suite test/suite-compile.janet in 0.001 seconds - 10 of 10 tests passed. Starting suite test/suite-corelib.janet... Finished suite test/suite-corelib.janet in 0.010 seconds - 90 of 90 tests passed. Starting suite test/suite-debug.janet... Finished suite test/suite-debug.janet in 0.001 seconds - 1 of 1 tests passed. Starting suite test/suite-ev.janet... error: could not bind to any sockets in net/listen [src/core/net.c] on line 643 in net/server [boot.janet] on line 3782, column 12 in _while [test/suite-ev.janet] on line 195, column 10 in _thunk [test/suite-ev.janet] (tailcall) on line 183, column 1 make: *** [Makefile:256: test] Error 1 pi@malina:~/janet-1.33.0 $ uname -a Linux malina 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux pi@malina:~/janet-1.33.0 $ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" pi@malina:~/janet-1.33.0 $ cc -v Using built-in specs. COLLECT_GCC=cc COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.1 20210110 (Debian 10.2.1-6) ```
pepe commented 8 months ago

Are you sure that the port used by Janet is open? That there is no other service running, or that it is not because of firewall filtering. I am running net servers on RPi without any problem.

sogaiu commented 8 months ago

Based on the output from above and this code from the tests, perhaps port 8000 is worth checking on.

bakpakin commented 8 months ago

I think the port used for testing should at the very least be something less likely to collide, as well as possibly configurable.

bakpakin commented 8 months ago

Just pushed 3a4f86c3d786017addb1874de60e412b033ff422 that allow configuring this and changes the default of 8000 to 8761

iacore commented 8 months ago

can the port be 0 (random)?

sarna commented 8 months ago

Heh, that was it - all tests passed now :) Thanks guys, it didn't occur to me that it was about port 8000, from the error it seemed it couldn't bind to any port.

I'll keep this issue open, feel free to close it at your convenience.