mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <>
To: "Kenny, Joseph P" <>
Cc: "" <>
Subject: Re: [musl] Re: [EXTERNAL] [musl] C++ segfault on riscv64
Date: Sat, 19 Mar 2022 09:44:14 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

* Kenny, Joseph P <> [2022-03-18 16:48:11 +0000]:
> Sorry for the confusing post. I get the same behavior on qemu for both riscv64 and riscv32. I posted output from riscv32.
> Here is the C++ code:
> $ cat
> #include <iostream>
> int main() {
> std::cout << "Hello\n";
> return 0;
> }
> From: "Kenny, Joseph P" <>
> Reply-To: "" <>
> Date: Friday, March 18, 2022 at 9:42 AM
> To: "" <>
> Subject: [EXTERNAL] [musl] C++ segfault on riscv64
> I’m getting segfaults with musl for C++ code on riscv64. I have tested mipsel using qemu user mode as described below and found no issues.
> I’m cross-compiling using the latest riscv64-linux-musl-cross.tgz (23-Nov-2021) from on x86_64/Fedora 35. I have confirmed that I get the following behavior for both riscv64 hardware and qemu user mode.
> C++ segfaults:
> $ riscv32-linux-musl-g++ -static -g -Og -o hello
> $ qemu-riscv32 hello
> Segmentation fault (core dumped)
> GDB confirms the segfault in __dynamic_cast on both qmeu and riscv64 hardware. I’ll paste in the assembly below. Segfault occurs on the last instruction shown [ld      a5,0(a0)].
> I’ve taken this as far as my skills allow. Any ideas what’s going on here or how to debug further?

listdc++ iostreams initializers call __dynamic_cast many times (this is
all in libstdc++, nothing to do with musl).

you need to figure out which cast fails and why the type info is corrupt.

e.g. build libstdc++ with debug info and printing the backtrace may help.

      reply	other threads:[~2022-03-19  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 16:41 Kenny, Joseph P
2022-03-18 16:48 ` [musl] Re: [EXTERNAL] " Kenny, Joseph P
2022-03-19  8:44   ` Szabolcs Nagy [this message]

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:

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

  git send-email \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 NNTP newsgroup(s).