On Mon, 12 Jul 2004, Dan Nelson wrote: > In the last episode (Jul 12), John Polstra said: > > On 12-Jul-2004 Bill Paul wrote: > > > When a kernel module doesn't load correctly, this is your cue to > > > run "dmesg" and look at the messages printed in the kernel message > > > buffer. That will tell you why it didn't load. Of course, nobody > > > ever remembers this, and apparently running xconsole is no longer > > > in vogue. > > > > > > This needs to be a FAQ. > > > > No, it needs to be fixed. It's printing a totally incorrect error > > message, and nobody should have to use dmesg to find out what's really > > happened. > > Maybe a uprintf would be useful here? imgact_elf.c does that to add a > little more info before returning ENOEXEC. uprintf is worse than printf in most ways, since its output doesn't even get logged. Try associating the message in imgact_elf.c with the process that caused the error when you run something like "make -k world | tee world.out". This is not fixed in the following patch. The patch just attempts to add printing of the name of what was not found and fixes some style bugs (error messages are conventionally not termited by a "."). I'm not sure that imgp->stringbase is the correct name. The process name should be printed too, like err(3) would do it. I'm not sure if one is available. IIRC, userland can't print a message in the usual way because we've committed to an exec and have destroyed too much of the original process to return to it. We may have destroyed its name too. %%% Index: imgact_elf.c =================================================================== RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v retrieving revision 1.151 diff -u -2 -r1.151 imgact_elf.c --- imgact_elf.c 5 Jun 2004 02:18:28 -0000 1.151 +++ imgact_elf.c 5 Jun 2004 06:51:25 -0000 _at__at_ -694,6 +693,6 _at__at_ brand_info = __elfN(get_brandinfo)(hdr, interp); if (brand_info == NULL) { - uprintf("ELF binary type \"%u\" not known.\n", - hdr->e_ident[EI_OSABI]); + uprintf("%s: ELF binary type \"%u\" not known.\n", + imgp->stringbase, hdr->e_ident[EI_OSABI]); error = ENOEXEC; goto fail; _at__at_ -828,5 +827,6 _at__at_ &imgp->entry_addr, sv->sv_pagesize); if (error != 0) { - uprintf("ELF interpreter %s not found\n", interp); + uprintf("%s: ELF interpreter %s not found\n", + imgp->stringbase, interp); goto fail; } %%% BruceReceived on Wed Jul 14 2004 - 09:00:56 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:01 UTC