i3ipcpp icon indicating copy to clipboard operation
i3ipcpp copied to clipboard

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

Open airfield20 opened this issue 3 years ago • 3 comments

terminate called after throwing an instance of 'Json::LogicError'
  what():  LargestUInt out of Int range

airfield20 avatar Oct 23 '22 17:10 airfield20

to reproduce:

#include "i3ipc++/ipc.hpp"

int main(){
  i3ipc::connection  conn;
  auto tree = conn.get_tree()->nodes;
}

airfield20 avatar Oct 23 '22 17:10 airfield20

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

airfield20 avatar Oct 23 '22 18:10 airfield20

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

drmgc avatar Nov 20 '23 06:11 drmgc