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
Debugging interacts with tmxr devices and system timers #1108
Comments
I'm glad you've gotten some combination of details which reproduces this problem. Would you be willing to do a git bisect to see where this behavior first cropped up. I'd start with a commit about 5 years ago and bisect from there to now. If you're not up to it, let me know and I'll get around to it... |
I'd be happy to do that, my environment is already set up for it. |
Thanks a million for doing that digging. I'm sure you read the discussion in #957. I'm very surprised that this is happening when writing debug output to a file since nothing explicitly opens the debug output file non-blocking which should be the only reason that fwrite() would set errno to EAGAIN. fwrite() is used in other places which absolutely assume that fwrite() wouldn't do that. Since you've got this easily reproducible, in scp.c, will you try changing this:
to:
EAGAIN only appears once in scp.c. Let us know if this fixes the problem. Thanks.
|
Yes, that change does resolve the issue! Looks like a good fix. |
The original solution provided in response to #957 needs to be adjusted to reflect that errno is only guaranteed to be set by fwrite() if an error occurred. otherwise a non zero value may have been set by some other call elsewhere in the program. All other cases where errno is explicitly check in simh, it is only done after receiving a return status from a system call. Fix problem reported in #1108
The original solution provided in response to simh#957 needs to be adjusted to reflect that errno is only guaranteed to be set by fwrite() if an error occurred. otherwise a non zero value may have been set by some other call elsewhere in the program. All other cases where errno is explicitly check in simh, it is only done after receiving a return status from a system call. Fix problem reported in simh#1108
Context
I am not able to characterize this issue very well, but there appears to be an undesirable interaction between debug logging and tmxr devices/system timers. The interaction only occurs when debug logging is enabled. It is characterized by the simulator running its clock more and more slowly (trending toward 0 instructions per second) whenever a telnet session to a tmxr MUX is connected. Dropping the telnet connection to the MUX causes the simulator to run at normal speed immediately. It seems to be 100% reproducible as long as debug logging is enabled, and not reproducible at all when debug logging is disabled.
the output of "sim> SHOW VERSION" while running the simulator which is having the issue
how you built the simulator or that you're using prebuilt binaries
the simulator configuration file (or commands) which were used when the problem occurred.
the expected behavior and the actual behavior
When debug logging is disabled, the simulator runs at normal speed when users are connected via telnet to tmxr mux devices (for example, the DZ device in the VAX simulator). I expect that this should be true when debug logging is enabled as well, but when debug logging is turned on, I observe the following behavior:
you may also need to provide specific pointers to data files that may be necessary to demonstrate the problem
I have a pre-configured environment that can reproduce the issue, which is available here:
https://archives.loomcom.com/simh/simh-vax.tar.gz
The included "vax" binary was built on Linux Mint 20.3, but is not needed to reproduce the problem, any current build of the vax binary should work.
The text was updated successfully, but these errors were encountered: