Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220319084414.GJ1320090@port70.net>
Date: Sat, 19 Mar 2022 09:44:14 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: "Kenny, Joseph P" <jpkenny@...dia.gov>
Cc: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: Re: Re: [EXTERNAL] C++ segfault on riscv64

* Kenny, Joseph P <jpkenny@...dia.gov> [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 hello.cc
> #include <iostream>
> int main() {
> std::cout << "Hello\n";
> return 0;
> }
> 
> From: "Kenny, Joseph P" <jpkenny@...dia.gov>
> Reply-To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
> Date: Friday, March 18, 2022 at 9:42 AM
> To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
> 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 musl.cc 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 hello.cc -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.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.