drmgc / i3ipcpp

MIT License
25 stars 24 forks source link

get_tree()->nodes causes this Json::LogicError #38

Open airfield20 opened 2 years ago

airfield20 commented 2 years ago
terminate called after throwing an instance of 'Json::LogicError'
  what():  LargestUInt out of Int range
airfield20 commented 2 years ago

to reproduce:

#include "i3ipc++/ipc.hpp"

int main(){
  i3ipc::connection  conn;
  auto tree = conn.get_tree()->nodes;
}
airfield20 commented 2 years ago

GDB reports it occuring in this function:

inline rect_t  parse_rect_from_json(const Json::Value&  value) {
    return {
        .x = value["x"].asInt(),
        .y = value["y"].asInt(), //this line specifically
        .width = value["width"].asUInt(),
        .height = value["height"].asUInt(),
    };
}

My system is ubuntu 20 running i3-gaps

drmgc commented 12 months ago

It sounds like a really edgy case. Provide result of i3-msg -t get_tree, if this can still be reproduced