From nobody Mon Oct 02 11:14:43 2023 X-Original-To: ports-bugs@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 4Rzddc04yfz4vxKJ for ; Mon, 2 Oct 2023 11:14:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rzddb3HYHz3CQC for ; Mon, 2 Oct 2023 11:14:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696245283; a=rsa-sha256; cv=none; b=OhZ8SfFN3V01WuKJXW5uMIR+1gdSWO39EmCmNayWqohKXMF3pu4SS3cYTXzMakUSSJfjI5 SAF4wFvNZ1UbrmugXW7o2QbUwWb0+YsXaAqjuCCHcY+2Wd/CV9LDetywgri5Zv6yJpXCow Ywg/U0Vq2oUPX9VcwOqkiZEMlRfFjgKPNu3wqU9XiPO5M0cnv69bpx2QnOHOaWIJlQ4UUW x0l2m3R8LQfg/Dhx9+XPaqFWu5DpamHtPbTkHyn+Crvwbaj4k9VsCpWFF/QdjJIH7TD0qM 27IT8IkSn5lxTUHVkHSvHIu34AzTBJZuypJAZQNxLbuerPkWT7u5GTDYYPMFvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696245283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z7xkd5kCs7zl4wsttc4/oapHT3Um0xnzLFQ3S9ksJbQ=; b=raLWPNigU1t4i5m5hBA9kYMniWsZwlaMVBXrtZX2vMSFEBjF5AIg2ixjxnIq7awWBJIk9V H2/JJ+04+p5yJsiaC1yNyCfq8x1jo91Dq3HkLR3YWD8spvwf38p+hlgAYvw0SokUlKpbDb QLM+sWQGfDdMix3Y//vABDBjvYoLhdsiiE9e8Jg4gfM1i2VN5nlCAz/mEi5ueC50+yemJ+ EpPkKTh4eJJftHzuB7LeaVgamgPDYYz7HgGa5U9fhbfjJPgHQ8/HXMnyjQPA/6qpQP1bpH 5Zp/uJKLQkcKMKBVSr8KEfGMf8FUEelf4+MHDjW3tXZLq/CBXD7nt6ok/Nl+/g== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rzddb2KVZz18yg for ; Mon, 2 Oct 2023 11:14:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 392BEhKZ095289 for ; Mon, 2 Oct 2023 11:14:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 392BEhLU095288 for ports-bugs@FreeBSD.org; Mon, 2 Oct 2023 11:14:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 274211] lang/tcc: Crashes with SIGSEGV on 14.x / 15.0-CURRENT when compiling hello world Date: Mon, 02 Oct 2023 11:14:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: freebsd@igalic.co X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274211 Bug ID: 274211 Summary: lang/tcc: Crashes with SIGSEGV on 14.x / 15.0-CURRENT when compiling hello world Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: freebsd@igalic.co given the following hello.c: ``` #include int main (int argc, const char **argv) { printf("Hello, World!\n"); return 0; } ``` when invoking tcc to compile a binary (tcc -o hello hello.c) we get a SIGSEGV in tcc_load_object_file. Here's the full lldb output, with= tcc compiled with `-O0 -g`: ``` meena@defbix /u/p/l/t/w/tinycc-release_0_9_26 =E2=9D=AF=E2=9D=AF=E2=9D=AF l= ldb ./tcc -- /home/meena/src/hello.c -o hello (lldb) target create "./tcc" Current executable set to '/usr/ports/lang/tcc/work/tinycc-release_0_9_26/t= cc' (x86_64). (lldb) settings set -- target.run-args "/home/meena/src/hello.c" "-o" "hel= lo" (lldb) run Process 20766 launched: '/usr/ports/lang/tcc/work/tinycc-release_0_9_26/tcc' (x86_64) Process 20766 stopped * thread #1, name =3D 'tcc', stop reason =3D signal SIGSEGV: invalid addres= s (fault address: 0x1c) frame #0: 0x000000000022aa26 tcc`tcc_load_object_file(s1=3D0x00002e6d3ec09000, fd=3D3, file_offset=3D0) = at tccelf.c:2533:51 2530 if (sh->sh_link > 0) 2531 s->link =3D sm_table[sh->sh_link].s; 2532 if (sh->sh_type =3D=3D SHT_RELX) { -> 2533 s->sh_info =3D sm_table[sh->sh_info].s->sh_num; 2534 /* update backward link */ 2535 s1->sections[s->sh_info]->reloc =3D s; 2536 } (lldb) bt all * thread #1, name =3D 'tcc', stop reason =3D signal SIGSEGV: invalid addres= s (fault address: 0x1c) * frame #0: 0x000000000022aa26 tcc`tcc_load_object_file(s1=3D0x00002e6d3ec09000, fd=3D3, file_offset=3D0) = at tccelf.c:2533:51 frame #1: 0x00000000002112fe tcc`tcc_add_file_internal(s1=3D0x00002e6d3ec09000, filename=3D"/usr/lib/crt= 1.o", flags=3D0) at libtcc.c:1181:19 frame #2: 0x0000000000211538 tcc`tcc_add_library_internal(s=3D0x00002e6d3ec09000, fmt=3D"%s/%s", filename=3D"crt1.o", flags=3D0, paths=3D0x00002e6d3ec08010, nb_paths=3D1) at libtcc.c:1254:13 frame #3: 0x00000000002115bf tcc`tcc_add_crt(s=3D0x00002e6d3ec09000, filename=3D"crt1.o") at libtcc.c:1270:15 frame #4: 0x0000000000211864 tcc`tcc_set_output_type(s=3D0x00002e6d3ec0= 9000, output_type=3D1) at libtcc.c:1360:13 frame #5: 0x000000000020e6a3 tcc`main(argc=3D4, argv=3D0x0000000820c887= 78) at tcc.c:302:5 frame #6: 0x0000000822e9dbea libc.so.7`__libc_start1(argc=3D4, argv=3D0x0000000820c88778, env=3D0x0000000820c887a0, cleanup=3D, mainX=3D(tcc`main at tcc.c:245)) at libc_start1.c:157:7 frame #7: 0x000000000020e3c0 tcc`_start at crt1_s.S:83 (lldb)=20 ``` n.b.: Given that this bug only occurs on 14.x / 15.0-CURRENT, chances are t= hat it's got something to do with recent libc/csu changes. also note that setting ARCHLEVEL=3Dscalar doesn't change the behaviour. --=20 You are receiving this mail because: You are the assignee for the bug.=