Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys.stdin.isatty() raise exception - ValueError: I/O operation on closed file #96

Closed
seth1002 opened this issue Jun 23, 2020 · 2 comments · Fixed by #97 or #98
Closed

sys.stdin.isatty() raise exception - ValueError: I/O operation on closed file #96

seth1002 opened this issue Jun 23, 2020 · 2 comments · Fixed by #97 or #98

Comments

@seth1002
Copy link

Describe the bug
i cannot figure out reason, zelos python script will raise exception when it works with parallel sometimes. can you please take a look?
e.g. cat test.case.list | parallel -j 5 python base_test.py {}

src/zelos/handles/base_handles.py

15:56:16:syscall_ma:ERROR_:Error in thread 7401_thread_0 (0x7401), PRI: 0, parent: None, IP: 0x409370, blocks_exec'd: 0x0, ThreadState.RUNNING while executing syscall fork Args:
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 232, in 'calling callback function'
File "/home//Envs/zelos/lib/python3.7/site-packages/unicorn-1.0.2rc1-py3.7-linux-x86_64.egg/unicorn/unicorn.py", line 494, in _hook_intr_cb
cb(self, intno, data)
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/hooks.py", line 638, in interrupt_hook_wrapper
self._hook_interrupt(self._z.api, intno)
File "/home//Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/hooks.py", line 677, in _hook_interrupt
handler(zelos.process)
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/ext/platforms/linux/syscall_manager.py", line 403, in syscall_handler_wrapper
self.handle_syscall(current_process)
File "/home//Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/ext/platforms/linux/syscall_manager.py", line 415, in handle_syscall
super(MIPSSyscallManager, self).handle_syscall(*args, kwargs)
File "/home//Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/ext/platforms/linux/syscall_manager.py", line 133, in handle_syscall
status = super(LinuxSyscallManager, self).handle_syscall(process)
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/plugin/syscall_manager_base.py", line 198, in handle_syscall
raise e
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/plugin/syscall_manager_base.py", line 188, in handle_syscall
retval = sys_fn(self, process)
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/ext/platforms/linux/syscalls/syscalls.py", line 1252, in sys_fork
child_process = _new_process(sm, p)
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/ext/platforms/linux/syscalls/syscalls.py", line 1258, in _new_process
child_pid = processes.new_process()
File "/home/
/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/processes.py", line 338, in new_process
hook(process)
File "/home/
**/Envs/zelos/lib/python3.7/site-packages/zelos-0.1.1.dev0-py3.7.egg/zelos/handles/base_handles.py", line 320, in init_handles
if not sys.stdin.isatty() and isinstance(
ValueError: I/O operation on closed file

@kvalakuzhyzp kvalakuzhyzp linked a pull request Jun 23, 2020 that will close this issue
@kvalakuzhyzp kvalakuzhyzp reopened this Jun 23, 2020
@kvalakuzhyzp kvalakuzhyzp linked a pull request Jun 23, 2020 that will close this issue
@kvalakuzhyzp
Copy link
Contributor

Thanks for filing the issue. I believe this should fix your problem.

@seth1002
Copy link
Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants