public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie
@ 2023-09-07  3:49 rimvydas.jas at gmail dot com
  2023-09-07  3:58 ` [Bug libstdc++/111315] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rimvydas.jas at gmail dot com @ 2023-09-07  3:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111315
           Summary: libstdc++ stacktrace testsuite failures with
                    --enable-default-pie
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rimvydas.jas at gmail dot com
  Target Milestone: ---

The GCC configured with --enable-default-pie gives:

                === libstdc++ tests ===

Running target unix
FAIL: 19_diagnostics/stacktrace/entry.cc execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc execution test

libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc:39: void
test_members(): Assertion 'e1.source_line() == (__LINE__ - 5)' failed.
libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc:132: void
test_assign(): Assertion 's0.at(0).source_line() == (__LINE__ - 4)' failed.

In both cases source_line() methods return 0.

Also, the -fno-pie option cannot be used when linking these tescases:
/usr/bin/ld: /tmp/ccv2BTff.o: relocation R_X86_64_32 against symbol
`_ZNSt16stacktrace_entry14_S_err_handlerEPvPKci' can not be used when making a
PIE object; recompile with -fPIE

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
@ 2023-09-07  3:58 ` pinskia at gcc dot gnu.org
  2023-09-07 10:34 ` xry111 at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-07  3:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, is libbacktrace not working with PIE applications ...

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
  2023-09-07  3:58 ` [Bug libstdc++/111315] " pinskia at gcc dot gnu.org
@ 2023-09-07 10:34 ` xry111 at gcc dot gnu.org
  2023-09-07 10:38 ` xry111 at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-09-07 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #2 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Rimvydas (RJ) from comment #0)
> The GCC configured with --enable-default-pie gives:
> 
>                 === libstdc++ tests ===
> 
> Running target unix
> FAIL: 19_diagnostics/stacktrace/entry.cc execution test
> FAIL: 19_diagnostics/stacktrace/stacktrace.cc execution test
> 
> libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc:39: void
> test_members(): Assertion 'e1.source_line() == (__LINE__ - 5)' failed.
> libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc:132: void
> test_assign(): Assertion 's0.at(0).source_line() == (__LINE__ - 4)' failed.
> 
> In both cases source_line() methods return 0.
> 
> Also, the -fno-pie option cannot be used when linking these tescases:
> /usr/bin/ld: /tmp/ccv2BTff.o: relocation R_X86_64_32 against symbol
> `_ZNSt16stacktrace_entry14_S_err_handlerEPvPKci' can not be used when making
> a PIE object; recompile with -fPIE

You need to use both -no-pie and -fno-pie.  -fno-pie only tells the compiler
not to emit code for PIE, -no-pie tells the linker not to link the code for
PIE.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
  2023-09-07  3:58 ` [Bug libstdc++/111315] " pinskia at gcc dot gnu.org
  2023-09-07 10:34 ` xry111 at gcc dot gnu.org
@ 2023-09-07 10:38 ` xry111 at gcc dot gnu.org
  2023-10-31 20:06 ` [Bug libbacktrace/111315] " pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-09-07 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-09-07
             Status|UNCONFIRMED                 |NEW

--- Comment #3 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Confirm the issue anyway, I saw it several times recently.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (2 preceding siblings ...)
  2023-09-07 10:38 ` xry111 at gcc dot gnu.org
@ 2023-10-31 20:06 ` pinskia at gcc dot gnu.org
  2023-11-03 10:03 ` xry111 at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |josopait at goopax dot com

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112322 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (3 preceding siblings ...)
  2023-10-31 20:06 ` [Bug libbacktrace/111315] " pinskia at gcc dot gnu.org
@ 2023-11-03 10:03 ` xry111 at gcc dot gnu.org
  2023-11-03 16:26 ` rimvydas.jas at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-11-03 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=112263

--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Maybe related to PR112263 but I'm not sure.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (4 preceding siblings ...)
  2023-11-03 10:03 ` xry111 at gcc dot gnu.org
@ 2023-11-03 16:26 ` rimvydas.jas at gmail dot com
  2023-11-03 16:32 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rimvydas.jas at gmail dot com @ 2023-11-03 16:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Rimvydas (RJ) <rimvydas.jas at gmail dot com> ---
(In reply to Xi Ruoyao from comment #5)
> Maybe related to PR112263 but I'm not sure.

Can confirm that with patch posted at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112263#c7 the stacktrace.cc
testsuite testcases (for both -std=gnu++23 and -std=gnu++26) now able to pass
execution tests when gcc is built with ./configure --enable-bootstrap
--enable-default-pie

--- libstdc++-v3/src/libbacktrace/Makefile.orig
+++ libstdc++-v3/src/libbacktrace/Makefile
@@ -232,3 +232,3 @@
 AWK = gawk
-BACKTRACE_CPPFLAGS =  -DHAVE_ATOMIC_FUNCTIONS=1 -DHAVE_SYNC_FUNCTIONS=1
-DHAVE_FCNTL=1 -DBACKTRACE_ELF_SIZE=64
+BACKTRACE_CPPFLAGS = -D_GNU_SOURCE -DHAVE_ATOMIC_FUNCTIONS=1
-DHAVE_SYNC_FUNCTIONS=1 -DHAVE_DL_ITERATE_PHDR=1 -DHAVE_FCNTL=1
-DBACKTRACE_ELF_SIZE=64
 BACKTRACE_SUPPORTED = 1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (5 preceding siblings ...)
  2023-11-03 16:26 ` rimvydas.jas at gmail dot com
@ 2023-11-03 16:32 ` redi at gcc dot gnu.org
  2023-11-06 23:11 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-03 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Great, let's close it as a dup then.

*** This bug has been marked as a duplicate of bug 112263 ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (6 preceding siblings ...)
  2023-11-03 16:32 ` redi at gcc dot gnu.org
@ 2023-11-06 23:11 ` cvs-commit at gcc dot gnu.org
  2023-11-06 23:12 ` cvs-commit at gcc dot gnu.org
  2023-11-06 23:13 ` cvs-commit at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-06 23:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Ian Lance Taylor <ian@gcc.gnu.org>:

https://gcc.gnu.org/g:2b64e4a54042fb8f75f1c1429eb1c13afb9fa118

commit r14-5173-g2b64e4a54042fb8f75f1c1429eb1c13afb9fa118
Author: Ian Lance Taylor <iant@golang.org>
Date:   Mon Nov 6 15:09:18 2023 -0800

    libstdc++: use -D_GNU_SOURCE when building libbacktrace

            PR libbacktrace/111315
            PR libbacktrace/112263
            * acinclude.m4: Set -D_GNU_SOURCE in BACKTRACE_CPPFLAGS and when
            grepping link.h for dl_iterate_phdr.
            * configure: Regenerate.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (7 preceding siblings ...)
  2023-11-06 23:11 ` cvs-commit at gcc dot gnu.org
@ 2023-11-06 23:12 ` cvs-commit at gcc dot gnu.org
  2023-11-06 23:13 ` cvs-commit at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-06 23:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Ian Lance Taylor
<ian@gcc.gnu.org>:

https://gcc.gnu.org/g:8484e3479fe80aebdc4a2406473aef906055b4f8

commit r13-8006-g8484e3479fe80aebdc4a2406473aef906055b4f8
Author: Ian Lance Taylor <iant@golang.org>
Date:   Mon Nov 6 15:12:05 2023 -0800

    libstdc++: use -D_GNU_SOURCE when building libbacktrace

            PR libbacktrace/111315
            PR libbacktrace/112263
            * acinclude.m4: Set -D_GNU_SOURCE in BACKTRACE_CPPFLAGS and when
            grepping link.h for dl_iterate_phdr.
            * configure: Regenerate.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libbacktrace/111315] libstdc++ stacktrace testsuite failures with --enable-default-pie
  2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
                   ` (8 preceding siblings ...)
  2023-11-06 23:12 ` cvs-commit at gcc dot gnu.org
@ 2023-11-06 23:13 ` cvs-commit at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-06 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Ian Lance Taylor
<ian@gcc.gnu.org>:

https://gcc.gnu.org/g:56909c9d4842925749cd9e061ef4afa0501f85e9

commit r12-9961-g56909c9d4842925749cd9e061ef4afa0501f85e9
Author: Ian Lance Taylor <iant@golang.org>
Date:   Mon Nov 6 15:12:41 2023 -0800

    libstdc++: use -D_GNU_SOURCE when building libbacktrace

            PR libbacktrace/111315
            PR libbacktrace/112263
            * acinclude.m4: Set -D_GNU_SOURCE in BACKTRACE_CPPFLAGS and when
            grepping link.h for dl_iterate_phdr.
            * configure: Regenerate.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-06 23:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07  3:49 [Bug libstdc++/111315] New: libstdc++ stacktrace testsuite failures with --enable-default-pie rimvydas.jas at gmail dot com
2023-09-07  3:58 ` [Bug libstdc++/111315] " pinskia at gcc dot gnu.org
2023-09-07 10:34 ` xry111 at gcc dot gnu.org
2023-09-07 10:38 ` xry111 at gcc dot gnu.org
2023-10-31 20:06 ` [Bug libbacktrace/111315] " pinskia at gcc dot gnu.org
2023-11-03 10:03 ` xry111 at gcc dot gnu.org
2023-11-03 16:26 ` rimvydas.jas at gmail dot com
2023-11-03 16:32 ` redi at gcc dot gnu.org
2023-11-06 23:11 ` cvs-commit at gcc dot gnu.org
2023-11-06 23:12 ` cvs-commit at gcc dot gnu.org
2023-11-06 23:13 ` cvs-commit at gcc dot gnu.org

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).