From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A7013858C60; Wed, 26 Apr 2023 15:20:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A7013858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682522406; bh=Gnl4gVgd0F7NJXBwaSncXkD6b548Np38aAKOl8DQ2p8=; h=From:To:Subject:Date:From; b=xudJ8aLa9Nt6AvGUeA8GsV8An2pw9F0yasSZWR6oPKnWGMMYEohVsk8skN8URCD8k gySZKJGqSCxoL+0ZsKeGmjys6b2CWM3DaiiHH4HkS4ajo93+IrsLZXnEKpXEn3UnuU f3mHvNzle6WV/01n0d1y9GYKCoFsGJlkihLWpzJI= From: "gcc_bugzilla at murphyslantech dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/109634] New: Linking Imagick for PHP compiles fine but gives segfault caused by libgomp on runtime Date: Wed, 26 Apr 2023 15:20:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gcc_bugzilla at murphyslantech dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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=3D109634 Bug ID: 109634 Summary: Linking Imagick for PHP compiles fine but gives segfault caused by libgomp on runtime Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: gcc_bugzilla at murphyslantech dot de CC: jakub at gcc dot gnu.org Target Milestone: --- When compiling the imagick (ImageLibrary to use ImageMagick in PHP) this compiles fine (no errors only warnings), but the resulting extension is not working, causing php to crash with a segfault. Disabling the extension agai= n, everything works as expected (except that functions from the extension are = not available). The error is also tracked here: https://github.com/Imagick/imagick/issues/6= 09, but basically this boils down to: =3D=3D272669=3D=3D Memcheck, a memory error detector =3D=3D272669=3D=3D Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward= et al. =3D=3D272669=3D=3D Using Valgrind-3.19.0 and LibVEX; rerun with -h for copy= right info =3D=3D272669=3D=3D Command: php -v =3D=3D272669=3D=3D=20 =3D=3D272669=3D=3D Invalid read of size 8 =3D=3D272669=3D=3D at 0x908AADE: ??? (in /usr/lib/x86_64-linux-gnu/libgo= mp.so.1.0.0) =3D=3D272669=3D=3D by 0x400533D: call_init.part.0 (dl-init.c:70) =3D=3D272669=3D=3D by 0x4005427: call_init (dl-init.c:33) =3D=3D272669=3D=3D by 0x4005427: _dl_init (dl-init.c:117) =3D=3D272669=3D=3D by 0x4001561: _dl_catch_exception (dl-catch.c:211) =3D=3D272669=3D=3D by 0x400C345: dl_open_worker (dl-open.c:808) =3D=3D272669=3D=3D by 0x400C345: dl_open_worker (dl-open.c:771) =3D=3D272669=3D=3D by 0x40014DC: _dl_catch_exception (dl-catch.c:237) =3D=3D272669=3D=3D by 0x400C6BB: _dl_open (dl-open.c:884) =3D=3D272669=3D=3D by 0x5303BEB: dlopen_doit (dlopen.c:56) =3D=3D272669=3D=3D by 0x40014DC: _dl_catch_exception (dl-catch.c:237) =3D=3D272669=3D=3D by 0x4001602: _dl_catch_error (dl-catch.c:256) =3D=3D272669=3D=3D by 0x53036BE: _dlerror_run (dlerror.c:138) =3D=3D272669=3D=3D by 0x5303CA0: dlopen_implementation (dlopen.c:71) =3D=3D272669=3D=3D by 0x5303CA0: dlopen@@GLIBC_2.34 (dlopen.c:81) =3D=3D272669=3D=3D Address 0x0 is not stack'd, malloc'd or (recently) free= 'd =3D=3D272669=3D=3D=20 =3D=3D272669=3D=3D=20 =3D=3D272669=3D=3D Process terminating with default action of signal 11 (SI= GSEGV) =3D=3D272669=3D=3D Access not within mapped region at address 0x0 =3D=3D272669=3D=3D at 0x908AADE: ??? (in /usr/lib/x86_64-linux-gnu/libgo= mp.so.1.0.0) =3D=3D272669=3D=3D by 0x400533D: call_init.part.0 (dl-init.c:70) =3D=3D272669=3D=3D by 0x4005427: call_init (dl-init.c:33) =3D=3D272669=3D=3D by 0x4005427: _dl_init (dl-init.c:117) =3D=3D272669=3D=3D by 0x4001561: _dl_catch_exception (dl-catch.c:211) =3D=3D272669=3D=3D by 0x400C345: dl_open_worker (dl-open.c:808) =3D=3D272669=3D=3D by 0x400C345: dl_open_worker (dl-open.c:771) =3D=3D272669=3D=3D by 0x40014DC: _dl_catch_exception (dl-catch.c:237) =3D=3D272669=3D=3D by 0x400C6BB: _dl_open (dl-open.c:884) =3D=3D272669=3D=3D by 0x5303BEB: dlopen_doit (dlopen.c:56) =3D=3D272669=3D=3D by 0x40014DC: _dl_catch_exception (dl-catch.c:237) =3D=3D272669=3D=3D by 0x4001602: _dl_catch_error (dl-catch.c:256) =3D=3D272669=3D=3D by 0x53036BE: _dlerror_run (dlerror.c:138) =3D=3D272669=3D=3D by 0x5303CA0: dlopen_implementation (dlopen.c:71) =3D=3D272669=3D=3D by 0x5303CA0: dlopen@@GLIBC_2.34 (dlopen.c:81) =3D=3D272669=3D=3D If you believe this happened as a result of a stack =3D=3D272669=3D=3D overflow in your program's main thread (unlikely but =3D=3D272669=3D=3D possible), you can try to increase the size of the =3D=3D272669=3D=3D main thread stack using the --main-stacksize=3D flag. =3D=3D272669=3D=3D The main thread stack size used in this run was 8388608. =3D=3D272669=3D=3D=20 =3D=3D272669=3D=3D HEAP SUMMARY: =3D=3D272669=3D=3D in use at exit: 1,105,972 bytes in 6,392 blocks =3D=3D272669=3D=3D total heap usage: 7,187 allocs, 795 frees, 1,359,342 b= ytes allocated =3D=3D272669=3D=3D=20 =3D=3D272669=3D=3D LEAK SUMMARY: =3D=3D272669=3D=3D definitely lost: 4,448 bytes in 139 blocks =3D=3D272669=3D=3D indirectly lost: 0 bytes in 0 blocks =3D=3D272669=3D=3D possibly lost: 719,088 bytes in 4,998 blocks =3D=3D272669=3D=3D still reachable: 382,436 bytes in 1,255 blocks =3D=3D272669=3D=3D suppressed: 0 bytes in 0 blocks =3D=3D272669=3D=3D Rerun with --leak-check=3Dfull to see details of leaked = memory =3D=3D272669=3D=3D=20 =3D=3D272669=3D=3D For lists of detected and suppressed errors, rerun with:= -s =3D=3D272669=3D=3D ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 f= rom 0) Which in turn points to gcc,libgomp or at least this is my best guess at the moment, the error is persistent when trying to build for different versions= of php. System Environment: - OS Ubuntu 23.04 - gcc: gcc version 12.2.0 (Ubuntu 12.2.0-17ubuntu1) - php versions tried to build: 8.2.5, 8.1.17, 8.1.18 - imagick version: 3.7.0=