Repository navigation
crash (bad_any_cast) in CMonitorResources::initFB when a monitor falls back to 640x480 at startup #16727
Replies: 5 comments
|
Same crash here on 0.57.0, and it happens on a cold boot. I have hit it several times since I upgraded from 0.56.2. Hyprland dies right after login with the same My Setup
It looks like the same timing problem. One of my dock monitors is not ready when Hyprland starts, and every mode fails the atomic test, all the way down to 640x480. After the restart, the dock monitors show up under new connector names and then it works normally. I am getting to #6 std::__throw_bad_any_cast() (Hyprland + 0x243c89)
#7 Monitor::CMonitorResources::initFB(...)
#8 Monitor::CMonitorResources::CMonitorResources(...)
#9 Monitor::CMonitor::resources()
#10 Config::Supplementary::CPropRefresher::refreshProp(bool)
#11 wl_event_loop_dispatch_idleThe The blur refresh rebuilds the blur buffer for every monitor, and that includes the one that never got a working mode. 0.57.1 does not touch this path. For now I work around it by keeping the dock monitors disabled for the first 3 seconds after login. I have three crash reports with this stack and can share them or the logs if they help. Crash LogshyprlandCrashReport186.txt |
|
Same crash here on 0.57.1, and I can confirm @uhs-robert's diagnosis. Same bug as #16370 and #16876. Setup: MacBookPro11,5, Intel Iris Pro (i915, eDP-1) + AMD R9 M370X (Southern Islands, amdgpu). The TV is on HDMI-A-3, on the AMD GPU. Hyprland 0.57.1, Mesa 26.2.6, Linux 7.2.15. aquamarine 0.16.0, plus the one-line DRM_FORMAT_MOD_INVALID fix from aquamarine main (ad448433) for multi-GPU blits. The crash below happens with stock 0.16.0 too. With the TV plugged in at startup, one output comes up connected but with no modes. aquamarine logs "drm: No mode on enable commit", and Hyprland aborts with the same backtrace as here: Cause: on REFRESH_BLUR_FB, refreshProp calls resources() for every monitor. That includes a monitor with no mode, whose m_transformedSize is 0x0. Then IFramebuffer::alloc hits the "cannot alloc a FB with negative / zero size!" RASSERT. One-line fix in src/config/supplementary/propRefresher/PropRefresher.cpp:
Tested: with this patch on 0.57.1, Hyprland starts normally with the TV plugged in. The modeless output (here eDP-1, 0x0 with no availableModes) is skipped instead of aborting, and the TV works at 3840x2160@30. A more general fix might be to skip allocation in CMonitor::resources() / CMonitorResources for a 0x0 size, so other callers like renderMirrored (#16335) can't hit the same assert. (Diagnosed with help from an AI assistant. I tested the patch on my own hardware.) |
|
Another confirmation, with a couple of data points that may help. The diagnosis below was done by Claude (Anthropic's AI assistant, running in Claude Code on my machine), which worked through the coredumps and the Hyprland source to find the cause. Setup: Dell XPS 15 9560 (Intel HD 630 driving the outputs; the GTX 1050 is unused), Dell WD22TB4 Thunderbolt dock with an MST output (DP-4), Arch, kernel 7.2.14, aquamarine 0.16.0. What happens: every login with the dock attached since upgrading to 0.57.0 (Nov 1) aborts about 3s after start. 7 aborts on 0.57.0 and 34 on 0.57.1 in a row, with New data points:
Patch: the same guard proposed above, as a diff that applies cleanly to both v0.57.1 and v0.57.2. It fixes the abort here. I built it into Arch's 0.57.2 package. With the dock attached, Hyprland started on the first try, with no safe-mode restart, no crash report and no coredump. The log shows the same startup sequence that aborted every time before (failed test commits, then --- a/src/config/supplementary/propRefresher/PropRefresher.cpp
+++ b/src/config/supplementary/propRefresher/PropRefresher.cpp
@@ -83,6 +83,13 @@ void CPropRefresher::refreshProp(const bool execdAsScheduled) {
if (!m)
continue;
+ // A monitor that has no mode yet (e.g. an MST dock output still training at startup)
+ // has a 0x0 transformed size; building its resources would allocate a 0x0
+ // framebuffer and trip the RASSERT in IFramebuffer::alloc.
+ // Its resources are created normally once it gets a mode.
+ if (m->m_transformedSize.x <= 0 || m->m_transformedSize.y <= 0)
+ continue;
+
m->resources()->refreshBlurFB();
if (*PBLURENABLED) {The guard sits in the refresher, not in |
|
For me I have opted to downgrade nvidia as an interim workaround: ignore for accidental |
Uh oh!
There was an error while loading. Please reload this page.
Hyprland version
0.57.0
Is this a regression?
0.56.2
What's the bug?
On the first Hyprland start after boot, within ~10 s of the system booting
Only when one of the monitors (here DP-2) is not ready when Hyprland starts. The connector has no CRTC on the initial scan, gets picked up on recheck, the configured mode fails the atomic test commit and aquamarine falls back to 640x480.
When the monitor is ready at startup, Hyprland starts normally. After the crash, the watchdog restart (safe mode) came up without crashing.
Reproduction steps
depends on monitor/DRM timing at boot. Observed once so far.
hl.monitorentries for each one.has crtc -1, will be rechecked), its configured mode fails the test commit and it is modeset at 640x480.std::bad_any_castinCMonitorResources::initFB(backtrace below).Attachments
Hyprland Crash Report
Well, at least the crash reporter didn't crash!
Hyprland received signal 6(ABRT)
Version: 0aa6745
Tag: v0.57.0
Date: Wed Oct 28 10:37:05 2026
Flags:
System info:
System name: Linux
Node name:
Release: 7.2.11-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000
GPU:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3080 Lite Hash Rate] [10de:2216] (rev a1) (prog-if 00 [VGA controller])
os-release:
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
Libraries:
Hyprgraphics: built against 0.5.1, system has 0.5.1
Hyprutils: built against 0.14.3, system has 0.14.3
Hyprcursor: built against 0.1.13, system has 0.1.13
Hyprlang: built against 0.6.8, system has 0.6.8
Aquamarine: built against 0.15.1, system has 0.15.1
Backtrace:
#0 | Hyprland(_Z12getBacktracev+0x73) [0x55964c4e9ad3]
getBacktrace()
??:?
#1 | Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0xad4) [0x55964c415b94]
CrashReporter::createAndSaveCrash(int)
??:?
#2 | Hyprland(+0x3fe02e) [0x55964c33d02e]
std::vformat[abi:cxx11](std::basic_string_view<char, std::char_traits >, std::basic_format_args<std::basic_format_context<std::__format::_Sink_iter, char> >)
??:?
#3 | /usr/lib/libc.so.6(+0x3e6f0) [0x7f9001e3e6f0]
??
??:0
#4 | /usr/lib/libc.so.6(+0x9a11c) [0x7f9001e9a11c]
??
??:0
#5 | /usr/lib/libc.so.6(gsignal+0x20) [0x7f9001e3e5d0]
??
??:0
#6 | Hyprland(+0x243c89) [0x55964c182c89]
std::__throw_bad_any_cast()
??:?
#7 | Hyprland(_ZN7Monitor17CMonitorResources6initFBEN9Hyprutils6Memory14CSharedPointerIN6Render12IFramebufferEEE+0xa9) [0x55964c6bdbc9]
Monitor::CMonitorResources::initFB(Hyprutils::Memory::CSharedPointerRender::IFramebuffer)
??:?
#8 | Hyprland(_ZN7Monitor17CMonitorResourcesC2EN9Hyprutils6Memory12CWeakPointerINS_8CMonitorEEEjNS1_4Math8Vector2DENS3_IKN16NColorManagement17CImageDescriptionEEE+0x35c) [0x55964c6be7cc]
Monitor::CMonitorResources::CMonitorResources(Hyprutils::Memory::CWeakPointerMonitor::CMonitor, unsigned int, Hyprutils::Math::Vector2D, Hyprutils::Memory::CWeakPointer<NColorManagement::CImageDescription const>)
??:?
#9 | Hyprland(_ZN7Monitor8CMonitor9resourcesEv+0x162) [0x55964c6a8fe2]
Monitor::CMonitor::resources()
??:?
#10 | Hyprland(_ZN6Config13Supplementary14CPropRefresher11refreshPropEb+0x32d) [0x55964c3e0f6d]
Config::Supplementary::CPropRefresher::refreshProp(bool)
??:?
#11 | Hyprland(+0x6d885e) [0x55964c61785e]
CEventLoopManager::removeReadableWaiter(Hyprutils::Memory::CWeakPointer const&)
??:?
#12 | /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch_idle+0x2b) [0x7f900386c78b]
??
??:0
#13 | /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch+0x36) [0x7f900386c7e6]
??
??:0
#14 | /usr/lib/libwayland-server.so.0(wl_display_run+0x37) [0x7f900386eb87]
??
??:0
#15 | Hyprland(_ZN17CEventLoopManager9enterLoopEv+0x2f3) [0x55964c618ad3]
CEventLoopManager::enterLoop()
??:?
#16 | Hyprland(main+0x1270) [0x55964c1e2550]
main
??:?
#17 | /usr/lib/libc.so.6(+0x27781) [0x7f9001e27781]
??
??:0
#18 | /usr/lib/libc.so.6(__libc_start_main+0x89) [0x7f9001e278b9]
??
??:0
#19 | Hyprland(_start+0x25) [0x55964c325ee5]
_start
??:?
Log tail:
DEBUG from aquamarine ]: drm: Skipping connector HDMI-A-1, has crtc 397 and is connected
DEBUG from aquamarine ]: drm: connector DP-2, has crtc -1, will be rechecked
DEBUG from aquamarine ]: drm: connector HDMI-A-2, has crtc -1, will be rechecked
DEBUG from aquamarine ]: drm: Skipping connector DP-3, has crtc 781 and is connected
DEBUG from aquamarine ]: drm: slot 0 crtc 205 taken by DP-1, skipping
DEBUG from aquamarine ]: drm: slot 1 crtc 397 taken by HDMI-A-1, skipping
DEBUG from aquamarine ]: drm: connected slot 2 crtc 589 assigned to DP-2
DEBUG from aquamarine ]: drm: slot 3 crtc 781 taken by DP-3, skipping
DEBUG from aquamarine ]: drm: Connector DP-2 connected
DEBUG from aquamarine ]: drm: Connecting connector DP-2, CRTC ID 589
DEBUG from aquamarine ]: drm: Dumping detected modes:
DEBUG from aquamarine ]: drm: Mode 0: 640x480@59.94Hz
DEBUG from aquamarine ]: drm: Physical size [Vector2D: x: 0, y: 0] (mm)
DEBUG from aquamarine ]: drm: Description Nvidia 0x0000 (DP-2)
DEBUG from aquamarine ]: drm: connector DP-2 crtc is capable of vrr: props.vrr_capable -> 849, crtc->props.vrr_enabled -> 25
DEBUG from aquamarine ]: drm: Explicit sync supported
DEBUG from aquamarine ]: drm: connector DP-2 crtc supports CTM
DEBUG from aquamarine ]: drm: connector DP-2 crtc supports HDR (8)
DEBUG from aquamarine ]: drm: connector DP-2 crtc supports Colorspace (838)
DEBUG from aquamarine ]: Swapchain: Clearing
DEBUG from aquamarine ]: GBM: Allocated a new buffer with size [Vector2D: x: 2560, y: 1440] and format XR24 with modifier 0x300000000606014 : BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
DEBUG from aquamarine ]: GBM: Allocated a new buffer with size [Vector2D: x: 2560, y: 1440] and format XR24 with modifier 0x300000000606014 : BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
DEBUG from aquamarine ]: GBM: Allocated a new buffer with size [Vector2D: x: 2560, y: 1440] and format XR24 with modifier 0x300000000606014 : BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
DEBUG from aquamarine ]: Swapchain: Reconfigured a swapchain to [Vector2D: x: 2560, y: 1440] XR24 of length 3
DEBUG from aquamarine ]: atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY
DEBUG from aquamarine ]: atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY
DEBUG from aquamarine ]: GBM: Allocated a new buffer with size [Vector2D: x: 640, y: 480] and format XR24 with modifier 0x300000000606014 : BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
DEBUG from aquamarine ]: GBM: Allocated a new buffer with size [Vector2D: x: 640, y: 480] and format XR24 with modifier 0x300000000606014 : BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
DEBUG from aquamarine ]: GBM: Allocated a new buffer with size [Vector2D: x: 640, y: 480] and format XR24 with modifier 0x300000000606014 : BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
DEBUG from aquamarine ]: Swapchain: Reconfigured a swapchain to [Vector2D: x: 640, y: 480] XR24 of length 3
DEBUG from aquamarine ]: drm: Modesetting DP-2 with 640x480@59.94Hz
ERR from aquamarine ]: drm: Cannot commit when a page-flip is awaiting
ERR from aquamarine ]: drm: Cannot commit when a page-flip is awaiting
DEBUG from aquamarine ]: libinput: New device SteelSeries Arctis Nova Pro Wireless: 4152-4832
DEBUG from aquamarine ]: libinput: New device Elgato Stream Deck XL: 4057-108
DEBUG from aquamarine ]: libinput: New device Logitech PRO X 2: 1133-16553
DEBUG from aquamarine ]: libinput: New device Logitech PRO X TKL: 1133-16560
DEBUG from aquamarine ]: libinput: New device Power Button: 0-1
DEBUG from aquamarine ]: libinput: New device Power Button: 0-1
DEBUG from aquamarine ]: libinput: New device Sleep Button: 0-3
DEBUG from aquamarine ]: libinput: New device OpenLinkHub Virtual Keyboard: 5840-5175
DEBUG from aquamarine ]: libinput: New device OpenLinkHub Virtual Mouse: 5840-5175
DEBUG from aquamarine ]: libinput: New device OpenLinkHub Virtual Absolute Mouse: 5840-5175
I acknowledge that:
I have searched all (open and closed) discussions and issues and my problem is not there.
I have read the Code of Conduct and agree to follow it.
I wrote this request with my own hands, my own keyboard, and in my own words.
All reactions