4 ms·
What exactly is the purpose of logging all unhandled breakpoint instructions encountered in user-mode code to the syslog, and then continuing...? On Windows, a
by userbinator 11y ago
What exactly is the purpose of logging all unhandled breakpoint instructions encountered in user-mode code to the syslog, and then continuing...? On Windows, a breakpoint instruction encountered outside of a debugger causes the standard error dialog to appear, and if you choose not to attach a debugger, the process terminates. IMHO that's more reasonable behaviour, as breakpoint instructions shouldn't appear in code that's not being debugged (either by a debugger or itself, as is sometimes the case like the author does here.)
because unprivileged user-space code is able to force the kernel to waste a lot of time printing messages, slowing the whole system down
User code can do that already, or even just run in an infinite loop.
- dezgeg 11y ago>>because unprivileged user-space code is able to force >>the kernel to waste a lot of time printing messages, >>slowing the whole system down >User code can do that already[...] I'm pretty sure that'd be considered a kernel bug. After all, there already is a a function (printk_ratelimited) which is supposed to be used in situations where userspace can trigger a kernel print.
- userbinator 11y agoI meant that you can already do these if you want to consume a lot of CPU time: for(;;) printf("Hello world!"); for(;;) ;
- seba_dos1 11y agoConsuming a lot of CPU time and forcing kernel to do that are separate things.
- madez 11y agoBut that won't slow down the whole system, if you didn't mess with the process priorities.
- lultimouomo 11y agosync() will most definitely do.
- caf 11y agoIt doesn't continue, it delivers a SIGTRAP to the process and the default disposition of that signal (if the process isn't being debugged or has otherwise arranged to handle the signal differently) is to have the process dump core and exit.