qiling
qiling copied to clipboard
Multithreaded mode is missing initialization in Linux
ql.os.thread_class is not properly initialized in multithreaded mode for Linux and thus attempting to run any binary results in an exception.
$ qltool run -f f9ab06de9ffa4b27692b3ed687c1b3ff8717d41a5950e7eaa9a3656b40bed8ca -m --rootfs ~/rootfs
Traceback (most recent call last):
File "/home/fdd/.local/bin/qltool", line 253, in <module>
ql.run(timeout=options.timeout)
File "/home/fdd/.local/lib/python3.10/site-packages/qiling/core.py", line 573, in run
self.os.run()
File "/home/fdd/.local/lib/python3.10/site-packages/qiling/os/linux/linux.py", line 147, in run
thread_management.run()
File "/home/fdd/.local/lib/python3.10/site-packages/qiling/os/linux/thread.py", line 606, in run
self.main_thread = self.ql.os.thread_class.spawn(self.ql, self.ql.loader.elf_entry, self.ql.os.exit_point)
AttributeError: 'NoneType' object has no attribute 'spawn'
Tested in Ubuntu 22.04 / Python 3.10.
Hi there. This multithreaded Linux example works perfectly fine over here:
python3 ./qltool run -f examples/rootfs/x86_linux/bin/x86_multithreading --rootfs examples/rootfs/x86_linux -m
What Qiling version are you using? Can you give more details about this issue?