Closed wiwichips closed 3 months ago
stack looks like
Thread 1 "python" received signal SIGSEGV, Segmentation fault. 0x00007ffff768597e in FuncType::getPyObject (cx=0x55555561b3f0, fval=...) at /home/philippe/Sources/PythonMonkey/src/FuncType.cc:19 19 proxy->jsFunc->set(&fval.toObject()); (gdb) bt
at /home/philippe/Sources/PythonMonkey/src/FuncType.cc:19
at /home/philippe/Sources/PythonMonkey/src/pyTypeFactory.cc:108
at /home/philippe/Sources/PythonMonkey/src/internalBinding/timers.cc:34
@wiwichips This is due to quit not being async, (all other functions in the example are async) and is thus not supported without an async wrapper such as
async def async_quit(): quit()
my_j.on('accepted', lambda: async_quit())
Even if its unsupported, it should result in an exception, not a segmentation fault
also works fine if not using lambda: def non_async_quit(): quit()
my_j.on('accepted', non_async_quit())
just made an incorrect pr closes comment
note same result if call exit or sys.exit
Issue type
Bug
How did you install PythonMonkey?
None
OS platform and distribution
Ubuntu 22.04.4 LTS x86_64
Python version (
python --version
)3.10
PythonMonkey version (
pip show pythonmonkey
)0.7.0
Bug Description
Not sure why in more detail, but when you call
quit()
on a job.on('accepted') listener, it seg faults every time!Standalone code to reproduce the issue
Relevant log output or backtrace
Additional info if applicable
No response
What branch of PythonMonkey were you developing on? (If applicable)
No response