Bug 227826 - [FUSEFS]: fuse_main() hangs in pthread_cleanup_pop()
Summary: [FUSEFS]: fuse_main() hangs in pthread_cleanup_pop()
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: threads (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-threads (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-28 14:01 UTC by Ben RUBSON
Modified: 2021-06-02 21:36 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben RUBSON 2018-04-28 14:01:14 UTC
Hi,

I'm facing an issue where, from time to time, unmounting a FUSE FS, threads hang in pthread_cleanup_pop().

For example with sysutils/fusefs-encfs.
When it starts, it enters fuse_main().
And when FS is unmounted, sometimes, main thread hangs in fuse_main(), all threads being stuck in pthread_cleanup_pop().

Here is a backtrace :

(gdb) thread apply all bt
Thread 2 (Thread 802618000 (LWP 100408/encfs)):
#0  0x0000000801da267c in pthread_cleanup_pop () from /lib/libthr.so.3
#1  0x00000008008c8b1b in fuse_session_loop_mt () from /usr/local/lib/libfuse.so.2
#2  0x00000008008cd8c2 in fuse_loop_mt () from /usr/local/lib/libfuse.so.2
#3  0x00000008008d0618 in fuse_main_real () from /usr/local/lib/libfuse.so.2
#4  0x000000000040a246 in ?? ()
#5  0x0000000000408a8f in ?? ()
#6  0x00000008006b4000 in ?? ()
#7  0x0000000000000000 in ?? ()
Thread 1 (Thread 802c69000 (LWP 101304/encfs)):
#0  0x0000000801da267c in pthread_cleanup_pop () from /lib/libthr.so.3
#1  0x0000000801d9f9f3 in pthread_timedjoin_np () from /lib/libthr.so.3
#2  0x000000080069dc72 in _rtld_is_dlopened () from /libexec/ld-elf.so.1
#3  0x000000080069af21 in _rtld_is_dlopened () from /libexec/ld-elf.so.1
#4  0x0000000800698301 in dlopen () from /libexec/ld-elf.so.1
#5  0x0000000801da1f0f in pthread_exit () from /lib/libthr.so.3
#6  0x0000000801da1e3b in pthread_exit () from /lib/libthr.so.3
#7  0x0000000801d94b5d in pthread_create () from /lib/libthr.so.3
#8  0x0000000000000000 in ?? ()

Here are other similar backtraces :
https://pastebin.com/raw/ubxzKck8
https://pastebin.com/raw/FXRy2u22
https://pastebin.com/raw/7CG9BuDq

Process then hangs indefinitely, and only exits upon a SIGKILL.

I also reported this in sysutils/fusefs-encfs, but does not seem to be a port issue.
https://github.com/vgough/encfs/issues/470

Thank you very much for your support !

Best regards,

Ben
Comment 1 Ben RUBSON 2018-04-28 14:04:45 UTC
Of course I know I'm not running the last FreeBSD release :
# uname -r
11.0-RELEASE-p16

But I did not find anything relevant in bugs history regarding pthread_cleanup_pop().

I have a process currently stuck like this, so if needed I'm available for a live debug session.

Thx !
Comment 2 Alan Somers freebsd_committer freebsd_triage 2019-03-05 18:43:01 UTC
Do you still experience this problem?  If you can provide a reliable reproduction case, I'll fix it.
Comment 3 Ben RUBSON 2019-03-06 13:47:00 UTC
Thank you Alan for your comment.
I think I first need to deeply test this with last FreeBSD version, and I'll then update the ticket.
Comment 4 Alan Somers freebsd_committer freebsd_triage 2019-08-08 20:51:05 UTC
Please retest on current using the latest build (Aug-8 or later)
Comment 5 LaneJane 2021-04-23 15:14:39 UTC
MARKED AS SPAM
Comment 6 Alan Somers freebsd_committer freebsd_triage 2021-06-02 21:36:52 UTC
I'm closing this since the poster hasn't retested.  fusefs got a major rewrite in mid 2019, and the original bug may well be fixed now.  If you can still reproduce the issue on 12.2-RELEASE or later, you can reopen.