Igalia / acacia

Library for inspecting accessibility APIs
https://igalia.github.io/acacia
GNU Lesser General Public License v2.1
8 stars 1 forks source link

Problems with catching errors on linux #129

Closed spectranaut closed 6 months ago

spectranaut commented 6 months ago

In python, the following happens:

>>> try:
...   node.get_role_name()
... except:
...   print("caught error!")
... 
caught error!
swig/python detected a memory leak of type 'std::runtime_error *', no destructor found.

And in node, we don't get the error message:

Error: [object Object]
    at REPL3:1:12
    at Script.runInThisContext (node:vm:122:12)
    at REPLServer.defaultEval (node:repl:594:29)
    at bound (node:domain:433:15)
    at REPLServer.runBound [as eval] (node:domain:444:12)
    at REPLServer.onLine (node:repl:924:10)
    at REPLServer.emit (node:events:529:35)
    at REPLServer.emit (node:domain:489:12)
    at [_onLine] [as _onLine] (node:internal/readline/interface:423:12)
    at [_line] [as _line] (node:internal/readline/interface:894:18)
undefined
spectranaut commented 6 months ago

Just confirmed, on mac, we see the error string, and, we don't get a memory leak reported. The versions of nodejs and python3 are not exactly the same, but they are close. Also the swig versions are different, 4.2 on linux and 4.1.1 on mac :/

spectranaut commented 6 months ago

This was fixed by the linked PR