From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 382D4389850A; Mon, 5 Dec 2022 09:56:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 382D4389850A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670234176; bh=ewPkgalGic1GIzS3jRS+RuHNqk4XEgHbcPgz7ia1glA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=l/IhMMFNLwqUh8i9kqckNlVywMptFMnCLj+duYx72KFzu/jFZcSV46s4dTtTgT+or B9+FIo9HKmS2uZ+FgibxLdamwYS+ocXb+/SUPmoEpmPwDXZB5zsCOzk3FktYSLIJjh TL0jaYWiy5Uf27r6LAn+DPXZhHpCMNUUNEwV2jS4= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/107078] LTO is causing that firebird build is core dumping Date: Mon, 05 Dec 2022 09:56:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107078 Martin Li=C5=A1ka changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|WAITING |RESOLVED --- Comment #20 from Martin Li=C5=A1ka --- Thanks, now I can reproduce and it: Thread 1 "isql" received signal SIGSEGV, Segmentation fault. 0x00007ffff634da54 in Firebird::MemPool::releaseMemory (flagExtent=3Dfalse, object=3D) at /home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2402 2402 pool->releaseBlock(block, !flagExtent); (gdb) bt #0 0x00007ffff634da54 in Firebird::MemPool::releaseMemory (flagExtent=3Dfa= lse, object=3D) at /home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2402 #1 Firebird::MemPool::deallocate (block=3D) at /home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2683 #2 Firebird::MemPool::globalFree (block=3D) at /home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2671 #3 Firebird::MemoryPool::globalFree (block=3D) at /home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2836 it crashes because releaseMemory is called with object =3D=3D NULL: void MemPool::releaseMemory(void* object, bool flagExtent) FB_NOTHROW { if (object) { LTO create a .part clone where it assumes object can't be null. That's true= for 'this' pointer, which should never be null. can be fixed with: -O2 -flto=3Dauto -flifetime-dse=3D1 -fno-delete-null-pointer-checks please build the software with -fsanitize=3Dundefined,address and investiga= te where it violates that.=