From: Simon Marchi <simon.marchi@polymtl.ca>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix tid-reuse sometimes blocks for a very long (infinite?) time.
Date: Tue, 04 Dec 2018 02:56:00 -0000 [thread overview]
Message-ID: <4542bd17ef8892077e71d0c9231cb589@polymtl.ca> (raw)
In-Reply-To: <20181104200048.2463-1-philippe.waroquiers@skynet.be>
On 2018-11-04 15:00, Philippe Waroquiers wrote:
> A failure that seems to cause a long/infinite time is the following:
>
> For a not clear reason, tid-reuse.c spawner thread sometimes gets an
> error:
> tid-reuse:
> /bd/home/philippe/gdb/git/build_moreaa/gdb/testsuite/../../../moreaa/gdb/testsuite/gdb.threads/tid-reuse.c:58:
> spawner_thread_func: Assertion `rc == 0' failed.
>
> which causes a SIGABRT to be trapped by gdb, and tid-reuse does not
> reach the
> after_count breakpoint:
> Thread 2 "tid-reuse" received signal SIGABRT, Aborted.
> [Switching to Thread 0x7ffff7518700 (LWP 10368)]
> __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
> 51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) FAIL: gdb.threads/tid-reuse.exp: continue to breakpoint:
> after_count
>
> After that, tid-reuse.exp gets the value of reuse_time, but this one
> kept its
> initial value of -1 (as unsigned) :
> print reuse_time
> $1 = 4294967295
> (gdb) PASS: gdb.threads/tid-reuse.exp: get reuse_time
>
> tid-reuse then dies, and the .exp script continues (with some FAIL)
> till it executes:
> set timeout [expr $reuse_time * 2]
>
> leading to the error:
>
> (gdb) ERROR: integer value too large to represent as non-long integer
> while executing
> "expect {
> -i exp8 -timeout 8589934590
> -re ".*A problem internal to GDB has been detected" {
> fail "$message (GDB internal error)"
> gdb_intern..."
> ("uplevel" body line 1)
> invoked from within
> "uplevel $body" ARITH IOVERFLOW {integer value too large to
> represent as non-long integer} integer value too large to represent as
> non-long integer
> ERROR: GDB process no longer exists
>
> and then everything blocks.
> This last 'GDB process no longer exists' is strange, as I still see the
> gdb
> when this all blocks, e.g.
> philippe 16058 31085 0 20:30 pts/15 00:00:00
> /bin/bash -c rootme=`pwd`; export rootme;
> srcdir=../../../binutils-gdb/gdb/testsuite ; export srcdir ;
> EXPECT=`if [
> philippe 16386 16058 0 20:30 pts/15 00:00:00
> expect -- /usr/share/dejagnu/runtest.exp --status GDB_PARALLEL=yes
> --outdir=outputs/gdb.threads/tid-reuse gdb.thre
> philippe 24848 16386 0 20:30 pts/20 00:00:00
>
> /bd/home/philippe/gdb/git/build_binutils-gdb/gdb/testsuite/../../gdb/gdb
> -nw -nx -data-directory /bd/home/philip
>
> This patch gives a default value of 60, so that if ever something wrong
> happens
> in tid-reuse, then the value retrieved by the .exp script stays in a
> reasonable
> range.
> Note that I could not reproduce this failure often enough to be sure
> that
> initializing to 60 ensures it does not block, but in any case, it
> should
> not harm.
I replaced the pthread_create call with the value 1 to simulate a
failure, and the test succeeds to fail quickly with your patch applied.
Without your patch, I get the infinite hang that you describe.
The patch LGTM, thanks!
Simon
next prev parent reply other threads:[~2018-12-04 2:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 20:01 Philippe Waroquiers
2018-11-24 12:58 ` PING " Philippe Waroquiers
2018-12-02 15:59 ` PING^2 " Philippe Waroquiers
2018-12-04 2:56 ` Simon Marchi [this message]
2018-12-04 15:23 ` Pedro Alves
2018-12-04 23:11 ` Philippe Waroquiers
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=4542bd17ef8892077e71d0c9231cb589@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/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).