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

mod_sysop: Segmentation fault on shutdown #12

Closed
InterLinked1 opened this issue Jun 13, 2023 · 1 comment
Closed

mod_sysop: Segmentation fault on shutdown #12

InterLinked1 opened this issue Jun 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@InterLinked1
Copy link
Owner

If any remote consoles are active at shutdown, any attempts to shutdown or restart (whether from the foreground or a remote console) will cause a segfault during module unload. No segfault when replicated with valgrind.

This is likely more serious memory corruption since there appears to be stack corruption in the backtrace, no further details are available:

Other threads appear to be all right, which is a strong hint this is corruption caused when trying to unload mod_sysop. Possibly related to recent changes to try to move away from pthread_cancel in that module and some others?

Thread 1 (Thread 0x7f99cdffb6c0 (LWP 88031)):
#0  0x00007f99f0401a2a in  ()
#1  0x00007f99d8001270 in  ()
#2  0x0000002000000020 in  ()
#3  0x7900000000000000 in  ()
#4  0x0001003b00000020 in  ()
#5  0x0000000000000020 in  ()
#6  0x26bdeb69d0b5d354 in  ()
#7  0x00007f99cdffabc0 in  ()
#8  0x00007f99d80012c0 in  ()
#9  0x00007f99eaffc850 in  ()
#10 0x00007f99cd7fb000 in  ()
#11 0x26bdeb69d435d354 in  ()
#12 0x26bd9016a3e1d354 in  ()
#13 0x0000000000000000 in  ()
@InterLinked1 InterLinked1 added the bug Something isn't working label Jun 13, 2023
@InterLinked1 InterLinked1 self-assigned this Jun 13, 2023
@InterLinked1
Copy link
Owner Author

May or may not be related, but logging can also get stuck here due to write blocking forever:

RWLIST_RDLOCK(&remote_log_fds);
RWLIST_TRAVERSE(&remote_log_fds, rfd, entry) {
	if (fd_logging[rfd->fd]) {
		write(rfd->fd, fullbuf, (size_t) bytes);
	}
}
RWLIST_UNLOCK(&remote_log_fds);

InterLinked1 added a commit that referenced this issue Jul 4, 2023
Remote consoles are still created using detached
threads, but are now cleaned up more properly.

Consequently, the concept of "killable" threads,
which was a kludge from the beginning, is now
removed, since nothing else uses it.

Closes #12
InterLinked1 added a commit that referenced this issue Jul 4, 2023
Remote consoles are still created using detached
threads, but are now cleaned up more properly.

Consequently, the concept of "killable" threads,
which was a kludge from the beginning, is now
removed, since nothing else uses it.

Closes #12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant