Previously kern_exec silently failed, killing the process with SIGABRT.
Posted for discussion. My take is that ENOMEM is a useful error to report, but others may not have much value.
Differential D2731
Report error to user if image activator fails with ENOMEM emaste on Jun 3 2015, 8:09 PM. Authored by Tags None Referenced Files
Details
Previously kern_exec silently failed, killing the process with SIGABRT. Posted for discussion. My take is that ENOMEM is a useful error to report, but others may not have much value.
Diff Detail
Event TimelineComment Actions I would not object against addition of the uprintf(), possibly managed to silence with some sysctl. Look at the kern_exec.c disallow_high_osrel which might be covered by the same knob. But I think that to be useful, we should add uprintf() to image activators error situations, and not to the summary error path in the kern_exec.c. I.e. I suggest to annotate with uprintf() imgact_elf.c. You would be able to provide much more precise and up to the point diagnostic there. Like, in your case, "text segment too large". Comment Actions Ok, I agree that will provide a much better user-facing error, and will post a new patch shortly. Comment Actions This could be made much shorter if you create a local variable of type char *, initialized to NULL. In the 'then' blocks of if()s, the var is asssigned a message, nothing more. Then, the final if(var != NULL) {PROC_UNLOCK(); uprintf();return();} is added. Also, there are several other places in the imgact_elf.c where similar messages could be added in load_file(), e.g. e_type check, check for headers living in the first page, alignment etc. Comment Actions Use error message string pointer as suggested by kib, and add reporting for the other failure cases
|