sai2791 / aund

Linux Econet Server (Acorn computers - 8-bit with 32-bit support)
6 stars 4 forks source link

Core dump in posix_spawn unless -f is set for foreground #3

Closed SteveFosdick closed 3 years ago

SteveFosdick commented 3 years ago

When I tried running aund on Linux, without specifying -f I immediately got a core dump. Here is the gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e79944 in __spawnix () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7e79944 in __spawnix () from /usr/lib/libc.so.6
#1  0x00007ffff7e7a08b in __spawni () from /usr/lib/libc.so.6
#2  0x00007ffff7e798af in posix_spawn@@GLIBC_2.15 () from /usr/lib/libc.so.6
#3  0x0000555555557a3e in main (argc=1, argv=0x7fffffffe5b0) at aund.c:166

At a guess I'd say some things that can be left as NULL in that call are not allowed as NULL on Linux.

sai2791 commented 3 years ago

I have noticed that when running in the foreground aund -f the library functions are not working, and we get a channel error. I think this is related.

sai2791 commented 3 years ago

Put the original code back for linux hosts so we call daemon instead of posix_spawn

pushed fix to master