From c5dbcdce2d1942abb567d03bf9dafb74f06b5769 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Sun, 30 Mar 2025 22:43:09 +0200 Subject: Fix multi-threaded fuse session exit Issue with previous code was that fuse_session_exit() didn't wake up the semaphore in fuse_loop_mt.c. Lock, semaphore and all uses of checking for "exited" are now moved to struct fuse_session to have it available for the signal handler. This also removes internal fuse_session_reset() calls, as that makes testing hard. From git history I also don't see why it was added. Closes: https://github.com/libfuse/libfuse/issues/997 Signed-off-by: Bernd Schubert --- test/test_ctests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/test_ctests.py') diff --git a/test/test_ctests.py b/test/test_ctests.py index feefc07..ae5cc8f 100644 --- a/test/test_ctests.py +++ b/test/test_ctests.py @@ -144,3 +144,14 @@ def test_notify_file_size(tmpdir, notify, output_checker): logger.error(f"Failure in unmount: '{' '.join(cmdline)}'") cleanup(mount_process, mnt_dir) logger.debug("Unmount completed") + +def test_signals(output_checker): + """Test for proper signal handling (issue #1182)""" + logger = logging.getLogger(__name__) + logger.debug("Testing signal handling") + cmdline = [ pjoin(basename, 'test', 'test_signals') ] + logger.debug(f"Command line: {' '.join(cmdline)}") + subprocess.run(cmdline, stdout=output_checker.fd, \ + stderr=output_checker.fd, timeout=10, check=True) + logger.debug("Signal handling test completed successfully") + -- cgit v1.2.3