[prev in list] [next in list] [prev in thread] [next in thread]
List: haiku-bugs
Subject: [haiku-bugs] [Haiku] #15090: Some linker situations able to crash a simple C++ program
From: "Haiku" <trac () haiku-os ! org>
Date: 2019-05-28 19:53:36
Message-ID: 042.3b01ebd5b3462c14728f91b0d0edfcb2 () haiku-os ! org
[Download RAW message or body]
--==============f34664952213306129=MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
#15090: Some linker situations able to crash a simple C++ program
----------------------------+------------------------------
Reporter: jpcima | Owner: nobody
Type: bug | Status: new
Priority: normal | Milestone: Unscheduled
Component: - General | Version: R1/Development
Keywords: gcc c++ linker | Blocked By:
Blocking: | Has a Patch: 0
Platform: All |
----------------------------+------------------------------
On attempt to compile a simple C++ hello world with iostream, one can
cause a mix of c++ libraries which crashes before reaching main.
It's based on the situation of a build using hpkg libraries and pkg-
config.
**Example**
This works:
g++ -std=c++11 -o hello hello.cc && ./hello
But this crashes:
g++ -std=c++11 -o hello hello.cc `pkg-config sdl2 libuv uchardet --libs`
&& ./hello
The trouble makers are `-L` flags expanded by pkg-config, which add a path
containing a libstdc++.a static library.
The two tests show different `readelf -d hello` output.
The working case indicated a dynamic link with libstdc++.so, the crashing
case does not.
**Details**
Haiku shredder 1 hrev53167 May 26 2019 19:04:45 x86_64 x86_64 Haiku
gcc version 8.3.0 (2019_05_24)
libsdl2_devel-2.0.9-1
libsdl2-2.0.9-1
libuv_debuginfo-1.29.1-1
libuv_devel-1.29.1-1
libuv-1.29.1-1
uchardet_devel-0.0.6-2
uchardet-0.0.6-2
libiconv_devel-1.15-4
libiconv-1.15-4
Additional notes https://git.io/fjRxD
Report of program hit by linking bug https://git.io/fjRAH
--
Ticket URL: <https://dev.haiku-os.org/ticket/15090>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.
--==============f34664952213306129==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic