ITADN

Bug : Panic in Widgetpedia

#827OpenYinameah 创建于 2026-04-25
Y
Yinameahcommented
I was trying to catch up with dvui today and caught a bug in Widgetpedia. But first : widgetpedia is such a cool idea, love it ! Congrats, looking crazy good. So handy. Back to the bug. I triggered a panic a few times when clicking on the `Options Editor`. It seems related to widgets that do not have options. Most reliable way to reproduce I found is : - Go in `toast` section - Click on `Options Editor` - Jiggle a bit the mouse around <details> <summary>I crash with the following trace : </summary> ``` thread 344191 panic: reached unreachable code /home/aurelien/.local/share/zigup/0.15.2/files/lib/std/debug.zig:559:14: 0x13ac109 in assert (std.zig) if (!ok) unreachable; // assertion failure ^ /home/aurelien/sketchbook/zig/dvui/src/WidgetData.zig:372:21: 0x14de371 in validate (dvui.zig) std.debug.assert(self.id != Id.undef); // Indicates a use after deinit() error. ^ /home/aurelien/sketchbook/zig/dvui/src/Examples/widgetpedia.zig:246:43: 0x1a5f5eb in displayWidgetTemplate__anon_70213 (dvui.zig) _ = widget_display.wd.validate(); ^ /home/aurelien/sketchbook/zig/dvui/src/Examples/widgetpedia.zig:3054:30: 0x1702646 in displayFn (dvui.zig) displayWidgetTemplate(@This()); ^ /home/aurelien/sketchbook/zig/dvui/src/Examples/widgetpedia.zig:123:33: 0x15a9166 in widgetpedia (dvui.zig) current_widget.displayFn(reset_widget); ^ /home/aurelien/sketchbook/zig/dvui/src/Examples.zig:95:24: 0x14eef49 in demo__anon_36363 (dvui.zig) widgetpedia(); ^ /home/aurelien/sketchbook/zig/dvui/examples/sdl-standalone.zig:255:23: 0x14c8adc in gui_frame (sdl-standalone.zig) dvui.Examples.demo(.full); ^ /home/aurelien/sketchbook/zig/dvui/examples/sdl-standalone.zig:80:39: 0x14b5107 in main (sdl-standalone.zig) const keep_running = gui_frame(); ^ /home/aurelien/.local/share/zigup/0.15.2/files/lib/std/start.zig:627:37: 0x14b61f1 in main (std.zig) const result = root.main() catch |err| { ^ ???:?:?: 0x7f82221576c0 in ??? (libc.so.6) Unwind information for `libc.so.6:0x7f82221576c0` was not available, trace may be incomplete ???:?:?: 0x7f82221577f8 in ??? (libc.so.6) ???:?:?: 0x26f7894 in ??? (???) sdl3-standalone └─ run exe sdl3-standalone failure error: the following command terminated unexpectedly: /home/aurelien/sketchbook/zig/dvui/zig-out/bin/sdl3-standalone ``` </details> Backend infos :  (linux) ``` info: SDL version: 3.4.0 info(SDL_SYSTEM): App name: SDL Application info(SDL_SYSTEM): App version: <unspecified> info(SDL_SYSTEM): App ID: <unspecified> info(SDL_SYSTEM): SDL revision: SDL-3.4.0 (https://github.com/castholm/SDL 0.4.0) debug(SDL_SYSTEM): SDL chose video backend 'x11' info(SDL_RENDER): OpenGL shaders: ENABLED debug(SDL_SYSTEM): SDL chose render backend 'opengl' info(SDL_RENDER): Created renderer: opengl info(SDLBackend): SDL3 backend scale 1 ``` I don't have time to dig right now, but please let me know if it's not easy to reproduce and I can provide further assistance.
3 条评论