Skip to content

Conversation

@xander1421
Copy link
Contributor

@xander1421 xander1421 commented Jan 24, 2026

Problem

Crash with:

unhandled exception (type std::exception) in signal handler:
what: in Json::Value::find(begin, end): requires objectValue or nullValue

Root Cause

The JsonParser class uses a shared CharReaderBuilder member that gets accessed concurrently from multiple threads:

  • IPC thread: Event handlers call getSocket1JsonReply()parser_.parse()
  • GTK thread: Update functions call getSocket1JsonReply()parser_.parse()

Each module has its own mutex, but they all share the same IPC::inst() singleton. The module mutexes don't protect the shared parser.

Json::CharReaderBuilder is not thread-safe for concurrent use without synchronization.

Fix

Use a local CharReaderBuilder in parse() instead of a member variable. This makes each parse call independent and thread-safe.

@xander1421 xander1421 force-pushed the fix/json-type-check-crash branch from 366f251 to 1639dec Compare January 24, 2026 21:40
@xander1421 xander1421 changed the title fix(hyprland): add isObject() checks before accessing workspace fields fix(json): use local CharReaderBuilder for thread safety Jan 24, 2026
@Alexays Alexays merged commit 2f94435 into Alexays:master Jan 25, 2026
9 checks passed
@Alexays
Copy link
Owner

Alexays commented Jan 25, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants