Re: /usr/src/lib/libc/string/strsignal.c:96

From: Sean McNeil (sean_at_mcneil.com)
Date: 03/06/05

  • Next message: Sam Lawrance: "Re: Swapped out procs not brought in immediately after child exits"
    To: Maxime Henrion <mux@FreeBSD.org>
    Date: Sat, 05 Mar 2005 18:43:53 -0800
    
    

    On Sun, 2005-03-06 at 01:27 +0100, Maxime Henrion wrote:
    > Sean McNeil wrote:
    > > Hi folks,
    > >
    > > It looks like strsignal is busted. All I have to do is hit ctrl-c while
    > > running gmake and I get this core:
    > >
    > > #0 strsignal (num=2) at /usr/src/lib/libc/string/strsignal.c:96
    > > ebuf = "Interrupt", '\0' <repeats 2038 times>
    > > tmp = "2\000\000\000\000\000\000\000\002\000\000\000\000\000\000
    > > \000\000\000\000"
    > > signum = 0
    > > n = 4326031
    > > t = 0x7fffffffd151 ""
    > > p = 0x800d5b82f <Address 0x800d5b82f out of bounds>
    > >
    > > This is because n is uninitialized when num > 0 && num < sys_nsig.
    >
    > Indeed. Can you confirm that this patch fixes the problem?
    >
    > %%
    > --- strsignal.c.orig Tue Mar 1 20:28:14 2005
    > +++ strsignal.c Sun Mar 6 01:24:18 2005
    > @@ -64,7 +64,7 @@
    > #endif
    >
    > if (num > 0 && num < sys_nsig) {
    > - strlcpy(ebuf,
    > + n = strlcpy(ebuf,
    > #if defined(NLS)
    > catgets(catd, 2, num, sys_siglist[num]),
    > #else
    > %%

    Yes, this has the desired affect and no more core dump :)

    Thanks,
    Sean

    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Sam Lawrance: "Re: Swapped out procs not brought in immediately after child exits"

    Relevant Pages

    • Re: devfs kernel panic
      ... On Jan 25, Maxime Henrion wrote: ... > Richard Cox wrote: ... > following patch fixes the problem for me. ... I'm Cc'ing Matthew Kanner ...
      (freebsd-current)
    • Re: /usr/src/lib/libc/string/strsignal.c:96
      ... Sean McNeil wrote: ... > Hi folks, ... All I have to do is hit ctrl-c while ... > running gmake and I get this core: ...
      (freebsd-current)
    • Re: /usr/src/lib/libc/string/strsignal.c:96
      ... Sean McNeil wrote: ... Can you confirm that this patch fixes the problem? ... this has the desired affect and no more core dump:) ...
      (freebsd-current)