https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107078

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #20 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks, now I can reproduce and it:

Thread 1 "isql" received signal SIGSEGV, Segmentation fault.
0x00007ffff634da54 in Firebird::MemPool::releaseMemory (flagExtent=false,
object=<optimized out>) 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=false,
object=<optimized out>) at
/home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2402
#1  Firebird::MemPool::deallocate (block=<optimized out>) at
/home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2683
#2  Firebird::MemPool::globalFree (block=<optimized out>) at
/home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2671
#3  Firebird::MemoryPool::globalFree (block=<optimized out>) at
/home/marxin/Programming/firebird-4.0.2/src/common/classes/alloc.cpp:2836

it crashes because releaseMemory is called with object == 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=auto -flifetime-dse=1 -fno-delete-null-pointer-checks

please build the software with -fsanitize=undefined,address and investigate
where it violates that.

Reply via email to