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

pty.c/mod_sysop: File descriptor leak on shutdown #20

Open
InterLinked1 opened this issue Oct 6, 2023 · 0 comments
Open

pty.c/mod_sysop: File descriptor leak on shutdown #20

InterLinked1 opened this issue Oct 6, 2023 · 0 comments

Comments

@InterLinked1
Copy link
Owner

If a remote console is active during shutdown, a file descriptor leak (sometimes?) occurs of the PTY master, as shown here:

BBS has exited
==24657==
==24657== FILE DESCRIPTORS: 7 open (3 std) at exit.
==24657== Open file descriptor 19: /dev/ptmx
==24657==    at 0x5161E60: open (open64.c:41)
==24657==    by 0x13567D: posix_openpty (pty.c:61)
==24657==    by 0x136C1F: bbs_openpty (pty.c:94)
==24657==    by 0x136C1F: bbs_spawn_pty_master (pty.c:212)
==24657==    by 0x8417815: remote_sysop_listener (mod_sysop.c:508)
==24657==    by 0x145596: thread_run (thread.c:357)
==24657==    by 0x50F3043: start_thread (pthread_create.c:442)
==24657==    by 0x517285F: clone (clone.S:100)
==24657==
==24657== Open file descriptor 18: /dev/ptmx
==24657==    at 0x5161E60: open (open64.c:41)
==24657==    by 0x13567D: posix_openpty (pty.c:61)
==24657==    by 0x136C1F: bbs_openpty (pty.c:94)
==24657==    by 0x136C1F: bbs_spawn_pty_master (pty.c:212)
==24657==    by 0x8417815: remote_sysop_listener (mod_sysop.c:508)
==24657==    by 0x145596: thread_run (thread.c:357)
==24657==    by 0x50F3043: start_thread (pthread_create.c:442)
==24657==    by 0x517285F: clone (clone.S:100)
==24657==
==24657== Open file descriptor 16: /dev/ptmx
==24657==    at 0x5161E60: open (open64.c:41)
==24657==    by 0x13567D: posix_openpty (pty.c:61)
==24657==    by 0x136C1F: bbs_openpty (pty.c:94)
==24657==    by 0x136C1F: bbs_spawn_pty_master (pty.c:212)
==24657==    by 0x8417815: remote_sysop_listener (mod_sysop.c:508)
==24657==    by 0x145596: thread_run (thread.c:357)
==24657==    by 0x50F3043: start_thread (pthread_create.c:442)
==24657==    by 0x517285F: clone (clone.S:100)
==24657==
==24657== Open file descriptor 17: /dev/ptmx
==24657==    at 0x5161E60: open (open64.c:41)
==24657==    by 0x13567D: posix_openpty (pty.c:61)
==24657==    by 0x136C1F: bbs_openpty (pty.c:94)
==24657==    by 0x136C1F: bbs_spawn_pty_master (pty.c:212)
==24657==    by 0x8417815: remote_sysop_listener (mod_sysop.c:508)
==24657==    by 0x145596: thread_run (thread.c:357)
==24657==    by 0x50F3043: start_thread (pthread_create.c:442)
==24657==    by 0x517285F: clone (clone.S:100)
==24657==
==24657==
==24657== HEAP SUMMARY:
==24657==     in use at exit: 82,913 bytes in 764 blocks
==24657==   total heap usage: 14,851 allocs, 14,087 frees, 1,977,640 bytes allocated
==24657==

This is reflected in the (recently added) FD dump at shutdown, where /dev/ptmx is still open:

   16 => /dev/ptmx
Open files: 2 (7) / 1024
[2023-10-06 07:02:04.851]  === Finalizing shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant