David Thompson <dthomps...@worcester.edu> writes: > Mark H Weaver <m...@netris.org> writes: > >> Interesting. Does it happen with unmodified stable-2.0? If so, I think >> we can treat this as an independent bug. > > Yes, exact same problem on stable-2.0. > >> Can you reproduce the segfault while running meta/gdb-uninstalled-guile >> and get a backtrace? Alternatively, if you provide enough detail to >> reproduce the segfault, I can track it down. > > Here's the output from gdb: > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x7ffff4ea2700 (LWP 13122)] > get_codepoint (port=port@entry=0xe13ff0, > codepoint=codepoint@entry=0x7ffff4ea1334, buf=buf@entry=0x7ffff4ea1330 "(%`", > len=len@entry=0x7ffff4ea1338) at ports.c:1460 > 1460 update_port_lf (*codepoint, port);
Ah yes, this makes sense. Ports in stable-2.0 are not thread-safe even for normal operations, and in this case 'stop-server-and-clients!' is _closing_ a port that's currently in use by another thread. In other words, 'stop-server-and-clients!' is fundamentally unsafe in the way it works, and probably has been since it was introduced. Thanks for the debugging. I'll think about how best to fix this. Mark