Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Mar 2022 20:26:40 +0100
From:      Peter <pmc@citylink.dinoex.sub.org>
To:        freebsd-stable@freebsd.org
Subject:   Program crashes on stable/13 (but not on 12.3)
Message-ID:  <YiO5cO967R/D2cIm@gate.intra.daemon.contact>

next in thread | raw e-mail | index | archive | help

Hija,

 this program crashes SEGV on stable/13 after 135962 iterations,
but continues to run on 12.3.

My stable/13 is still at 22ba2970766 - if You happen to be on a
newer level, then please just try this out.

------------------------------------------------------
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>

main() {
    char buf[] = "12345678901234567890123456789012345678901234567890";
    int fd = open("/dev/null", O_RDONLY);
    int i = 0;

    close(1);
    dup2(fd, 1);
    close(fd);

    while(1) {
      fputs(buf, stdout);
      fflush(stdout);
      i++;
      fprintf(stderr, "%d\n", i);
    }
}
------------------------------------------------------

I know that the code is bogus, but this is exactly what one of our
ports does (and why it started to crash after upgrading to stable/13).

And I think it should not SEGV, anyway.

For the full story, read here:

https://forums.freebsd.org/threads/random-program-crashes-no-coredumps-and-error-94.84285/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YiO5cO967R/D2cIm>