Bug 274535 - vlc(1) from Focal hangs on futex
Summary: vlc(1) from Focal hangs on futex
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 247219
  Show dependency treegraph
 
Reported: 2023-10-17 16:07 UTC by Edward Tomasz Napierala
Modified: 2023-11-09 18:42 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Tomasz Napierala freebsd_committer freebsd_triage 2023-10-17 16:07:16 UTC
VLC from amd64 Ubuntu Focal "hangs" on futex on startup.  VLC from a previous version (Bionic) doesn't exhibit this problem.

Running under strace(1) shows the following:

mmap(NULL, 16488, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x804f88000
mmap(0x804f89000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x1000) = 0x804f89000
mmap(0x804f8a000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x2000) = 0x804f8a000
mmap(0x804f8b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x2000) = 0x804f8b000
close(4)                                = 0
mprotect(0x804f8b000, 4096, PROT_READ)  = 0
futex(0x80224ede8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x10b75b0, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=0, tv_nsec=0}, FUTEX_BITSET_MATCH_ANYstrace: detach: tkill(2718,0): Invalid argument
strace: Process 2718 detached
 <detached ...>

Note that there are other applications hanging on futex, notably glxinfo(1).  The strange thing is, the same glxinfo works when run under strace(1) or FreeBSD's native ktrace(1).  Race condition of some kind?
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2023-10-17 16:12:19 UTC
Hmm, maybe related to https://reviews.freebsd.org/D40481 ?
Comment 2 Gleb Smirnoff freebsd_committer freebsd_triage 2023-10-17 16:41:00 UTC
The panic fixed by D40481 happens on futex syscall with FUTEX_REQUEUE flag. Here we don't have it, neither we have a panic. Edward, are there any FUTEX_REQUEUE requests in the entire strace/ktrace history?
Comment 3 Edward Tomasz Napierala freebsd_committer freebsd_triage 2023-10-17 18:29:24 UTC
I don't think so; just in case I've put the full strace output at https://people.freebsd.org/~trasz/vlc.txt
Comment 4 Edward Tomasz Napierala freebsd_committer freebsd_triage 2023-10-17 18:37:56 UTC
Also, I've tested the patch at D40481, just in case, and predictably it doesn't change anything wrt VLC or glxinfo hanging on futex.
Comment 5 Dmitry Chagin freebsd_committer freebsd_triage 2023-10-17 21:56:33 UTC
(In reply to Edward Tomasz Napierala from comment #4)
Well, the trace is weird as I don’t see any wake call on 0x10b75b0 futex. strace -f?
or ktrace -di to see any childs.
Comment 6 Edward Tomasz Napierala freebsd_committer freebsd_triage 2023-10-18 12:23:00 UTC
I'm not sure.  I've redone the strace (https://people.freebsd.org/~trasz/vlc.txt) and also added ktrace (https://people.freebsd.org/~trasz/vlc-ktrace.txt), just in case.