public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug testsuite/30132] New: [gdb/testsuite] FAIL: gdb.arch/amd64-disp-step-avx.exp: continue until exit at amd64-disp-step-avx
Date: Fri, 17 Feb 2023 10:59:56 +0000	[thread overview]
Message-ID: <bug-30132-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=30132

            Bug ID: 30132
           Summary: [gdb/testsuite] FAIL:
                    gdb.arch/amd64-disp-step-avx.exp: continue until exit
                    at amd64-disp-step-avx
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On SLE-11, with glibc 2.11.3, I run into:
...
(gdb) PASS: gdb.arch/amd64-disp-step-avx.exp: vex3: var128 has expected value
after
continue^M
Continuing.^M
^M
Program received signal SIGSEGV, Segmentation fault.^M
0x0000000000400283 in _exit (status=0) at
../sysdeps/unix/sysv/linux/_exit.c:33^M
33      ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.^M
(gdb) FAIL: gdb.arch/amd64-disp-step-avx.exp: continue until exit at
amd64-disp-step-avx
...

This not related to gdb, just by running the exec we get the same result.

The problem is that the test-case:
- calls glibc's _exit
- uses -nostartfiles, putting the burden for any necessary initialization for
  calling glibc's _exit on the test-case itself
- uses static, meaning there's no additional initialization by say
  dynamic linker or libc.so initializer

So, when we get to the second insn here:
...
000000000040acb0 <_exit>:
  40acb0:       48 63 d7                movslq %edi,%rdx
  40acb3:       64 4c 8b 14 25 00 00    mov    %fs:0x0,%r10
...
there's insufficient initialization done, and we run into the segfault.

Adding this in start:
...
         .rept 200
         nop
+        call __pthread_initialize_minimal
         .endr
...
is sufficient to fix it.  But that doesn't compile on my development system
with glibc 2.31.

We could just not run through to exit.

Or do the syscall in the test-case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2023-02-17 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 10:59 vries at gcc dot gnu.org [this message]
2023-02-17 14:33 ` [Bug testsuite/30132] " cvs-commit at gcc dot gnu.org
2023-02-17 14:34 ` vries 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-30132-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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).