-
Notifications
You must be signed in to change notification settings - Fork 56
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
virtme: always print kernel panic / oops in interactive mode #227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to change the log level in non-verbose mode!
Just one question to avoid exiting if stderr is not accessible.
3be4f32
to
ebf93bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the new version!
It looks good to me! I just have a couple of questions, just to be sure we don't want to look at alternatives. If not, feel free to merge :)
else: | ||
print( | ||
"WARNING: not a valid pts, try to run vng inside tmux or screen", | ||
file=sys.stderr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be sure: can we still write to stderr here if we cannot access /proc/self/fd/2
?
Also, compared to before, this warning will always be printed in such environment, when stderr is not accessible. I guess it will not be an issue, right?
ebf93bd
to
98cef38
Compare
98cef38
to
503e9da
Compare
As mentioned in #217 it would be nice to always print the output of critical kernel errors (oops / panic), instead of suppressing all the kernel logs completely by default. Therefore, keep suppressing the boot kernel log, but always dump panic/oops to stderr by default when running in interactive mode. Example with this change applied: arighi@virtme-ng~/s/linux (master)> vng _ _ __ _(_)_ __| |_ _ __ ___ ___ _ __ __ _ \ \ / / | __| __| _ _ \ / _ \_____| _ \ / _ | \ V /| | | | |_| | | | | | __/_____| | | | (_| | \_/ |_|_| \__|_| |_| |_|\___| |_| |_|\__ | |___/ kernel version: 6.13.0-virtme x86_64 (CTRL+d to exit) arighi@virtme-ng~/s/linux (master)> echo c | sudo tee /proc/sysrq-trigger [ 8.923672] sysrq: Trigger a crash [ 8.923980] Kernel panic - not syncing: sysrq triggered crash [ 8.924183] CPU: 0 UID: 0 PID: 198 Comm: tee Not tainted 6.13.0-virtme #2 [ 8.924632] Call Trace: [ 8.924704] <TASK> [ 8.924783] panic+0x349/0x3b0 [ 8.925055] sysrq_handle_crash+0x36/0x80 [ 8.925181] __handle_sysrq+0xed/0x270 [ 8.925274] write_sysrq_trigger+0x6a/0x90 [ 8.925380] proc_reg_write+0x56/0xa0 [ 8.925489] vfs_write+0x105/0x590 [ 8.925600] ksys_write+0x74/0xf0 [ 8.925682] do_syscall_64+0xbb/0x1d0 [ 8.925767] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 8.925891] RIP: 0033:0x7fdfed54ba84 Signed-off-by: Andrea Righi <[email protected]>
503e9da
to
19c7f39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update!
As mentioned in #217 it would be nice to always print the output of critical kernel errors (oops / panic), instead of suppressing all the kernel logs completely by default.
Therefore, keep suppressing the boot kernel log, but always dump panic/oops to stderr by default when running in interactive mode.
Example with this change applied:
Closes: #217