Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Crash in gtkwave on macOS 15.6.1 (Segmentation Fault) #453

@lucaaamaral

Description

@lucaaamaral

Crash in gtkwave on macOS 15.6.1 (Segmentation Fault)

Issue Description

The gtkwave application (GTKWave Analyzer v3.4.0 (w)1999-2022 BSI) crashes on macOS 15.6.1 with a segmentation fault (SIGSEGV) due to an EXC_BAD_ACCESS error. The crash occurs when attempting to access an invalid memory address (0x0000000000000001) in the gw_time_range_get_end function, triggered by a user interaction involving a button release in the GTK-based UI.

NOTE: this report was created with help of AI, crash report is attached, and I am available for follow up. This is a recurring issue for me on macOS.

Environment

  • Application: gtkwave
  • Version: GTKWave Analyzer v3.4.0 (w)1999-2022 BSI
  • Operating System: macOS 15.6.1 (Build 24G90)
  • Architecture: ARM-64 (Apple M4 Pro)
  • System Details:
    • Model: Mac16,8
    • Memory: 24 GB LPDDR5
    • Graphics: Apple M4 Pro, Built-In
    • System Integrity Protection: Enabled
  • Installation Path: /opt/homebrew/*/gtkwave
  • Dependencies:
    • libgtkwave.dylib
    • libgtk-3.0.dylib
    • libgobject-2.0.0.dylib

Steps to Reproduce

The exact steps to reproduce the crash are not fully clear, but it appears to be related to:

  1. Launching gtkwave on macOS 15.6.1.
  2. Interacting with the UI, specifically clicking the refresh button after simmulation rerun.
  3. The crash occurs in the reload_into_new_context_2 function, which calls gw_time_range_get_end.

Crash Details

  • Exception Type: EXC_BAD_ACCESS (SIGSEGV)
  • Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000001
  • Termination Reason: Segmentation fault: 11
  • Crashed Thread: 0 (Main thread, dispatch queue: com.apple.main-thread)
  • Faulting Address: 0x0000000000000001
  • Stack Trace (Top Frames):
    0   libgtkwave.dylib    gw_time_range_get_end + 36
    1   gtkwave             reload_into_new_context_2 + 3432
    2   gtkwave             reload_into_new_context + 20
    3   libgobject-2.0.0.dylib _g_closure_invoke_va + 204
    4   libgobject-2.0.0.dylib signal_emit_valist_unlocked + 860
    5   libgobject-2.0.0.dylib g_signal_emit_by_name + 240
    ...
    10  libgtk-3.0.dylib    gtk_button_do_release + 60
    11  libgtk-3.0.dylib    gtk_real_button_released + 208
    ...
    
  • Thread State:
    x0: 0x0000000141c6bf60   x1: 0x0000000141c6bf60   ...
    pc: 0x0000000104868c78 (libgtkwave.dylib`gw_time_range_get_end + 36)
    far: 0x0000000000000001
    esr: 0x92000006 (Data Abort, byte read Translation fault)
    

Analysis

  • The crash originates in gw_time_range_get_end within libgtkwave.dylib, suggesting a null pointer dereference or invalid memory access.
  • The issue is triggered during a UI interaction (button release), which propagates through GTK's signal handling (gtk_button_do_release, gtk_real_button_released) and leads to a call to reload_into_new_context_2.
  • This may indicate a bug in the handling of time range data or context reloading in gtkwave, possibly due to uninitialized or improperly managed data structures.

Expected Behavior

The application should handle UI interactions (e.g., button clicks) without crashing and should correctly manage memory when reloading contexts or accessing time range data.

Actual Behavior

The application crashes with a segmentation fault when a button is clicked, likely during a reload or refresh operation.

Additional Information

  • Time Since Boot: 600,000 seconds
  • Time Since Wake: 3,392 seconds
  • Crash Timestamp: 2025-09-24 15:22:12.5499 +0800
  • Anonymous UUID: 674B982E-459A-E9BC-C9AC-EFF0C13E2019
  • Parent Process: launchd [1]
  • Responsible Process: Electron [95786] (suggesting gtkwave was launched from within Visual Studio Code or a similar Electron-based application)
  • VM Region Info:
    0x1 is not in any region. Bytes before following region: 4369367039
    REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD
    __TEXT                      1046f4000-1047cc000    [  864K] r-x/r-x SM=COW  /opt/homebrew/*/gtkwave
    

Suggested Next Steps

  1. Investigate gw_time_range_get_end: Check for null pointer dereferences or invalid memory accesses in this function.
  2. Review reload_into_new_context_2: Ensure proper initialization and validation of data structures used during context reloading.
  3. Reproduce the Issue: Attempt to replicate the crash by interacting with UI elements that trigger reload_into_new_context.
  4. Test with Latest Version: Verify if the issue persists in the latest gtkwave version and with updated dependencies.
  5. Debugging: Run gtkwave in a debugger (e.g., lldb) to inspect the state of variables at the crash point.

Attachments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions