public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sumbera at volny dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/110956] New: gcc_assert is hit at gcc-13.2.0/libgcc/unwind-dw2-fde.c#L291 with some special library
Date: Wed, 09 Aug 2023 07:33:08 +0000	[thread overview]
Message-ID: <bug-110956-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110956
           Summary: gcc_assert is hit at
                    gcc-13.2.0/libgcc/unwind-dw2-fde.c#L291 with some
                    special library
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sumbera at volny dot cz
  Target Milestone: ---

Following test code on Solaris 11.4 i386 seems to get assertion at:

https://github.com/gcc-mirror/gcc/blob/releases/gcc-13.2.0/libgcc/unwind-dw2-fde.c#L291

$ cat test.c

#include <dlfcn.h>
#include <link.h>
#include <unistd.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
        void *hdl;

        if (argc != 2) {
                return 1;
        }

        printf("Open %s\n", argv[1]);
        hdl = dlopen(argv[1], RTLD_NOW);
        printf("hdl=%p\n", hdl);

        if (hdl) {
                dlclose(hdl);
        } else {
        printf("Error: %s\n", dlerror());
        }
        printf("Closed\n");
        return 0;
}

$ gcc -g -m32 -pthreads -D_GNU_SOURCE test.c
$ ./a.out /usr/lib/ssm/lib/libstorelibir-2.so
Open /usr/lib/ssm/lib/libstorelibir-2.so
hdl=fe6ec2a0
Abort (core dumped)

$ mdb core
Loading modules: [ libc.so.1 libsysevent.so.1 libnvpair.so.1 libuutil.so.1
libcmdutils.so.1 libavl.so.1 ld.so.1 ]
a.out:core> $C
feffe6ac libc_hwcap1.so.1`__lwp_sigqueue+0x15(1, 6, feffe6cc, fe19d9b6)
feffe6cc libc_hwcap1.so.1`raise+0x22((int) 6)
feffe71c libc_hwcap1.so.1`abort+0xf4()
feffe78c libgcc_s.so.1`_Unwind_Find_FDE.cold(fd877404, fd876974, feffe7ac,
fd8153f7)
feffe7ac 0xfd81541c(fe6ee950, feffe7f8, fe6b268a, fe593718, 0, fe6eb2a8)
feffe7b8 libstorelibir-2.so.20.10-0`_fini+0x15(fe593718, 0, fe6eb2a8, fe6e5850,
fe6ee0f8, fe6ee294)
feffe7f8 ld.so.1`call_fini+0x10a((Lm_list *) ld.so.1`lml_main, (Rt_map **)
0xfe593560, (Rt_map *) 0xfe6e5850)
feffe888 ld.so.1`_remove_hdl+0x7eb((Rt_map *) 0xfe6e5850, (APlist **)
0xfeffe8a8, (APlist **) 0xfeffe8ac, (Boolean) 1 (TRUE))
feffe8c8 ld.so.1`remove_hdl+0x48((Grp_hdl *) 0xfe6ec2a0, (Rt_map *) 0xfe6e5850)
feffe8e8 ld.so.1`dlclose_core+0xc5((Grp_hdl *) 0xfe6ec2a0, (Rt_map *)
0xfe6e5850, (Lm_list *) ld.so.1`lml_main)
feffe928 ld.so.1`dlclose_intn+0x28((Grp_hdl *) 0xfe6ec2a0, (Rt_map *)
0xfe6e5850)
feffe978 ld.so.1`dlclose_check+0x92((void *) 0xfe6ec2a0, (Rt_map *) 0xfe6e5850)
feffe9b8 ld.so.1`dlclose+0x46((void *) 0xfe6ec2a0)
feffe9e8 main+0x79(feffeaac, feffea04, 8050c3d)
feffea2c _start+0x46(2, feffeb2e, feffeb36, 0, feffeb5a, feffeb6a)

--

Notes:

- This can be seen with both libgcc from GCC 13.1 and 13.2. But not with libgcc
from GCC 12.2
- libstorelibir-2.so is some Solaris specific library. When used with other
libraries there is no problem
- problem cannot be reproduced on Solaris SPARC

             reply	other threads:[~2023-08-09  7:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  7:33 sumbera at volny dot cz [this message]
2023-08-09 10:40 ` [Bug libgcc/110956] " tneumann at users dot sourceforge.net
2023-08-09 11:09 ` ro at gcc dot gnu.org
2023-08-09 11:15 ` [Bug libgcc/110956] [13, 14 regression] " ro at gcc dot gnu.org
2023-08-09 11:18 ` ro at gcc dot gnu.org
2023-08-09 13:40 ` [Bug libgcc/110956] [13/14 " rguenth at gcc dot gnu.org
2023-08-09 13:53 ` tneumann at users dot sourceforge.net
2023-08-09 17:02 ` ro at manam dot mail-host-address-is-not-set
2023-08-09 22:55 ` tneumann at users dot sourceforge.net
2023-08-10  6:49 ` tneumann at users dot sourceforge.net
2023-08-10  8:44 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-10 11:11 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-11 15:21 ` cvs-commit at gcc dot gnu.org
2023-08-11 15:29 ` cvs-commit at gcc dot gnu.org
2023-10-09  9:57 ` rguenth at gcc dot gnu.org
2024-03-10  3:46 ` law at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110956-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).