From eugen@grosbein.net Sat Mar 5 21:26:10 2022 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B38CF1A0E4C6 for ; Sat, 5 Mar 2022 21:27:17 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K9yVD1msLz4Z18; Sat, 5 Mar 2022 21:27:16 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 225LQheO063460 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 5 Mar 2022 21:26:44 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: pmc@citylink.dinoex.sub.org Received: from [10.58.0.11] ([10.58.0.11]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 225LQHIH001951 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 6 Mar 2022 04:26:42 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Program crashes on stable/13 (but not on 12.3) To: Peter , freebsd-stable@freebsd.org, Konstantin Belousov References: From: Eugene Grosbein Message-ID: Date: Sun, 6 Mar 2022 04:26:10 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.2 X-Spam-Report: * -0.0 SHORTCIRCUIT No description available. * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4K9yVD1msLz4Z18 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=fail (mx1.freebsd.org: domain of eugen@grosbein.net does not designate 2a01:4f8:c2c:26d8::2 as permitted sender) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-0.50 / 15.00]; ARC_NA(0.00)[]; R_SPF_FAIL(1.00)[-all]; FREEFALL_USER(0.00)[eugen]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_LONG(-0.98)[-0.977]; NEURAL_SPAM_MEDIUM(0.58)[0.578]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-stable]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 06.03.2022 2:26, Peter wrote: Adding kib@ to CC: in case this is connected to recent commit by him. > 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 > #include > #include > > 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/ fflush() in our libc recently got some change due to very old PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=76398 That change was merged to stable/13 after 13.0-RELEASE: https://cgit.freebsd.org/src/commit/?id=afa9a1f5ec9974793a8744c55036ef5c4d08903d I wonder if it could be connected to the problem in question, so adding kib@ to CC: (I am sorry, Konstantin).