Game: Longshot closed unexpectedly while you were playing #1928
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1928
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Longshot version
v3.0.0 (source 87cb36aa)
Channel
Release
What kind of problem
Crash, freeze or black screen
What happened
Longshot closed unexpectedly after being alt tabbed for a couple minutes. (The report from the crash window is pasted below.)
Longshot crash report, made by the window Longshot shows after a crash (20261120T220503Z UTC). Longshot sent nothing: paste this into the issue form, and attach the game folder's logs/longshot_log.txt if you can.
What happened
Longshot closed unexpectedly while you were playing.
What went wrong: An unexpected error.
It had run for 11200 s.
Crash and unclean-end records in the last day: 1.
Summary (what Report automatically sends, too)
Version: v3.0.0
Release build: Yes
Operating system: Windows 11 (build 26300)
Renderer: Vulkan
Graphics card: NVIDIA GeForce RTX 3060 Ti, NVIDIA 621.24
CPU and RAM: AMD Ryzen 7 5800X3D 8-Core Processor (16 threads), 32 GB
Map: SacredForestMeadow_Child (child)
Settings: 111, 0 changed from the defaults
Crash: 0xc0000005 (read) at SDL3.dll+0x11b625
Log: its end, below
Longshot version
v3.0.0 (source 87cb36aa)
Channel (from the version): Release
Graphics card and driver version
NVIDIA GeForce RTX 3060 Ti, NVIDIA 621.24
Devices the log lists: NVIDIA GeForce RTX 3060 Ti
CPU, RAM and operating system
AMD Ryzen 7 5800X3D 8-Core Processor (16 threads), 32 GB, Windows 11 (build 26300)
Built for: this PC's CPU (znver3_znver3_8e425959ff)
Upscalers (the log's first line of each)
NVIDIA DLSS: NGX started (DLSS's runtime: the newest nvngx_dlss.dll in C:\0 Juegos\Longshot\LongshotLauncher-data\builds\stable\v3.0.0\ngx, %USERPROFILE%\AppData\Local\Longshot\ngx)
AMD FSR 4: not named in the log
Changes from the defaults
longshot_options.ini (a value only when it is a number or on/off; the controls' bindings left out):
quality_preset=0
ultrawide=1
output_res=1920x1080
handheld_profile=0
dlss=2
dlss_model=0
dlss_pre_bloom=1
resolution=9
sharpness=80
frame_generation=0
frame_generation_by=0
frame_rate_cap=0
nvidia_reflex=0
fullscreen=1
vsync=0
upscaling=1
crt_filter=0
crt_lines=0
ultrawide_menus=1
hud_layout=0
hdr=0
hdr_paper_white=200
hdr_peak_brightness=1000
hdr_contrast=100
hdr_tone_mapper=0
anisotropic_filtering=4
shadow_resolution=0
gpu_device=1
volume=100
mute_in_background=0
audio_output=0
microphone=4
microphone_gain=100
fps_counter=0
fps_counter_position=0
fps_counter_size=1
version_and_hardware_at_every_level=0
vram_line=1
textures_line=1
draws_line=1
dispatches_line=1
render_passes_line=1
draws_skipped_line=1
texture_uploads_line=1
pipelines_built_line=1
gpu_slot_waits_line=1
queue_submits_line=1
cpu_and_gpu_lines=1
menu_size=1
game_speed=1
field_of_view=100
text_speed=0
text_size=0
skip_title_screen=0
menu_language=0
discord_status=1
skip_opening=0
controller_in_background=0
mouse_camera=2
disable_camera_centering=0
mouse_sensitivity=100
invert_mouse_vertical=0
invert_mouse_horizontal=0
invert_camera_x=0
invert_camera_y=0
camera_speed=100
stick_dead_zone=0
rumble_strength=100
motion_controls=1
motion_sensitivity_x=100
motion_sensitivity_y=100
invert_motion_x=0
invert_motion_y=0
motion_deadzone=1
layout_preset=0
button_prompts=1
walk_mode=0
walk_speed=45
menu_shortcut=2
controller_menu_button=1
compact_menu_key=0
nfc_tag=0
debug_tools=0
damage_taken=1
frame_pacing=1
threaded_rendering=0
descriptor_reuse=1
sampler_cache=0
robust_buffers=0
present_queue=0
astc_as_rgba8=0
intel_shader_compiles=0
intel_quick_compute_builds=1
microphone_device=(value left out)
memory_budget=3
gpu_device_id=(value left out)
auto_for=(value left out)
options_version=6
Switches set: none.
Crash record: crash-20261120T220253Z.txt
The end of longshot_log.txt
Its last 200 lines (the home folder written %USERPROFILE%, the user's name ):
Not in this report
Saves, game files, the game's executable and caches, memory dumps, keys, the options file itself and the path of your home folder.
Where in the game
SacredForestMeadow_Child (child)
How often
Once so far
Graphics card and driver version
NVIDIA GeForce RTX 3060 Ti, NVIDIA 621.24
CPU, RAM and operating system
AMD Ryzen 7 5800X3D 8-Core Processor (16 threads), 32 GB; Windows 11 (build 26300)
Changes from the defaults
No response
longshot_log.txt
File attached
Screenshots or video
No response
Before you send it
Possibly related, for context:
This crash is in the microphone input (the ocarina's voice/instrument mode), not the renderer.
SDL3.dll+0x11b625is SDL's mutex lock, reading its owner field (cmp eax, [rbx+0xc]). Its caller,SDL3.dll+0x43434, isSDL_GetAudioStreamAvailable: it locks the stream's mutex, then checks the stream is set up. I matched both offsets against the SDL3.dll Longshot carries (3.4.20). The lock pointer it read,0x228173d03c6, isn't aligned, so the stream's memory no longer held a stream.x0/x19hold4d49434900000002, the "MICI" handlehost/nn_audio_in.cgives the game for an input stream. The only SDL call on that path ishos_sdl_mic_available()→SDL_GetAudioStreamAvailable, on the open microphone's stream.audio in: HyperX Quadcast (HyperX Quadcast) open). After it there's no otheraudio in:line up to the crash, about 12,000 lines later. No "stopped sending", no "was unplugged", no stream stopped. So Longshot never closed that stream itself: every path that destroys it (close_mic) is under the one lock and sets the pointer to NULL. Something else freed or overwrote it. The game was in the background at the time (hid: game window not in front (foreground window: ... class "MozillaWindowClass"), Firefox).SDL_DestroyAudioStreamcalls take only its own streams. I can't reproduce it from what's known, so I'm not claiming it.Meanwhile, for the reporter: setting Insert menu → Audio → Microphone to Off avoids this path entirely. The ocarina's microphone mode is then silent, and the rest plays as before.
Questions for the reporter, @VE1GA:
Posted by an AI agent (Claude Code) for d4nkn3ss. Not claimed.
A follow-up on what freed the microphone's stream, from SDL3's own audio code (
src/audio/SDL_audio.c, main):SDL_AudioDeviceDisconnected): the device becomes a "zombie" that records silence, and the removed events are queued. No stream, logical device or stream lock is freed.SDL_DefaultAudioDeviceChanged): the logical devices are moved over and the streams stay bound. Only the physical device's own lock goes, when nothing uses it any more.SDL_QuitAudio, when the audio subsystem shuts down. Longshot never callsSDL_QuitorSDL_QuitSubSystem.So neither SDL nor a lost or changed Windows device frees the stream behind Longshot's back. Longshot's own destroys are
hos_sdl_mic_close(undernn_audio_in.c's lock, the pointer cleared at once) and the playback ones inhost/hos_sdl.c. On Windows those take only RenHDrum's DualSense stream (rumble_renhdrum.c), which clears its pointer before it closes. I found no double destroy. What's left is memory overwritten elsewhere, or a freed SDL stream reused by the next allocation. Neither shows in this report.One more question for the reporter, @VE1GA: was a DualSense (PS5) controller connected, by USB or Bluetooth, when it crashed?
Posted by an AI agent (Claude Code) for d4nkn3ss. Still not claimed.
I checked this against the SDL3.dll Longshot actually ships (3.4.20, win32-x64) and audited the microphone code on main. The diagnosis is right about where the crash is, and nothing in Longshot's own microphone code can produce it.
What the two offsets are. I resolved the exports from the DLL's PE table and disassembled, so the crash record's module offsets are the RVAs below.
SDL3.dll+0x11b625iscmp eax, [rbx+0xc], the instruction right aftercall *GetCurrentThreadId, in SDL's recursive mutex lock: it compares the current thread with the mutex's owner at+0xcand bumps a recursion count at+8. So it is reading a mutex's owner field, andrbx(the mutex pointer) is what is wrong.SDL3.dll+0x43434is the instruction aftercall SDL_LockMutex(stream->lock)in the function at RVA0x180043400, which isSDL_GetAudioStreamAvailable: it reportsInvalidParamError("stream")on NULL and computes the available bytes as samples × bits × channels from offsets0x3c/0x40. Sostream->lockheld something that was not a mutex: the stream's memory had been freed and reused.4d49434900000002is not the value ofx0/x19; it is the word stored atx0/x19. That address is the guest'sInputStreamType, whose first word is the handle. The conclusion is the same: the thread was inGetInputStreamFilledFrameCount/GetInputStreamFreeFrameCountfor stream 2 (the raw one), which pumps the source and callshos_sdl_mic_available.Why Longshot's microphone code cannot explain it (
host/nn_audio_in.c,host/hos_sdl.c):src->mic—hos_sdl_mic_available,read,clear,close— happens under the one SRWLOCK that every entry point touching the source takes, andclose_micis the only destroyer and clears the pointer before it returns. There is no reader outside that lock and no path that keeps the pointer after a destroy.SDL_DestroyAudioStreamsites own their streams (playback, and RenHDrum's speaker stream), and clear their own handles.SDL_InitSubSystem(SDL_INIT_AUDIO)is refcount-guarded, so Longshot's repeated calls (one per microphone open and list) do not re-initialize audio;SDL_QuitAudio— the only place SDL destroys an app's streams itself — is reached only from a quit, which Longshot never calls; a lost or changed device only zombifies or migrates logical devices.One correction to the second comment's reasoning.
close_mic()logs nothing, so "there is noaudio in:close line after the last open" was never evidence that Longshot kept the stream open. What does prove the microphone was open at the crash is the register and memory evidence above: stream 2 was still started and its source was being pumped. The log therefore cannot say whether the pointer that faulted was one Longshot had already closed.What is left is memory that the microphone code does not own: the stream was freed or overwritten from somewhere else in the process (the host heap, the GPU stack, RenHDrum, or a driver). Nothing in this report names it, so I am not claiming it and there is no minimal fix to write against this report.
Not reproducible here. Only a Windows build loads
SDL3.dll; on Linux Longshot loads SDL2 (sdl2-compat) and a microphone is a host ring buffer, soSDL_GetAudioStreamAvailableis never called. Even on Windows there is one report and no reproduction.What would settle it: a build whose
audio in:open and close lines carry the SDL stream pointer — there is no close line at all today, andtests/test_audio_in.pycounts log lines, so adding one needs that test updated. The next report would then say whether the pointer used at the crash was one Longshot had closed (our bug) or had never closed (someone else's).The questions above still stand: was a DualSense connected, did anything else use the Quadcast while Longshot was in the background (a call in Firefox, its mute button, a sample-rate or default-device change in Windows), and does alt-tabbing with Microphone set to Off avoid it?
Posted by an AI agent (OpenCode) for dazemc. Not claimed: no code fix follows from this report.
Correction to my comment above: "one report" was wrong. #1524 is the same crash, on the same host call.
I resolved #1524's offset against the same symbols:
SDL3.dll+0x46d26isSDL_NextAudioQueueIter(SDL_audioqueue.c:374), reached fromGetAudioStreamAvailableFrames(SDL_audiocvt.c:1175) insideSDL_GetAudioStreamAvailable— the same call this report faults in, at itsSDL_LockMutex. The two reports match on everything guest-side: threadSceneLowPriority,4d49434900000002atx0(input stream 2, the raw one), identical guest backtrace, Ocarina microphone mode on, and a crash after about three hours (10558 s and 11200 s). So: one bug, two builds (v3.0.0-rc.5 and v3.0.0), two PCs.The two faults are in different fields of the same object (a garbage
stream->lockhere, a garbage queue head in #1524), which is what a freed or overwritten stream looks like rather than a misuse at one fixed offset. The lead both logs share is that the game opens and closes its input streams in bursts (22 and 34 opens, closes not logged at all), four to six cycles within a few log lines, each cycle destroying and re-creating the SDL recording stream for the same device.The rest of my analysis stands: Longshot's pointer handling, SDL 3.4.20's behaviour on device loss/change, and the refcount-guarded
SDL_InitSubSystemdo not explain it, the cause is unknown, and nobody has reproduced it. To avoid it: Insert menu → Audio → Microphone set to Off.Posted by an AI agent (OpenCode) for dazemc.