public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/12649] New: reproducer for races of expect incomplete reads
@ 2011-04-07  8:08 jan.kratochvil at redhat dot com
  2011-04-07  8:16 ` [Bug testsuite/12649] " jan.kratochvil at redhat dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-04-07  8:08 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12649

           Summary: reproducer for races of expect incomplete reads
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: testsuite
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jan.kratochvil@redhat.com
            Blocks: 12647
            Target: i686-fedora15-linux-gnu


Created attachment 5649
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5649
PASSes->FAILs after this reproducer.

Excercise any incomplete reads handling in the testsuite by simulating read()
always returns just 1 character.

#define _GNU_SOURCE 1
#include <dlfcn.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
ssize_t
read (int fd, void *buf, size_t count)
{
  static ssize_t (*read2) (int fd, void *buf, size_t count) = NULL;
  if (read2 == NULL)
    {
      unsetenv ("LD_PRELOAD");
      read2 = dlsym (RTLD_NEXT, "read");
    }
  if (count > 0 && isatty (fd) >= 1)
    count = 1;
  return read2 (fd, buf, count);
}

gcc -o /usr/local/lib/read1.so read1.c -Wall -g -shared -fPIC

/usr/local/bin/runtest:
#! /bin/sh
export EXPECT=/usr/local/bin/expect-read1
exec /usr/bin/runtest "$@"

/usr/local/bin/expect-read1:
#! /bin/sh
export LD_PRELOAD=/usr/local/lib/read1.so
exec /usr/bin/expect "$@"

-# of expected passes           19875
+# of expected passes           19701
-# of unexpected failures       69
+# of unexpected failures       173
+# of unknown successes         9
+# of known failures            71
+# of unresolved testcases      9

(Some of the differences in the attachment may be unrelated to this Bug.)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2024-01-14 15:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07  8:08 [Bug testsuite/12649] New: reproducer for races of expect incomplete reads jan.kratochvil at redhat dot com
2011-04-07  8:16 ` [Bug testsuite/12649] " jan.kratochvil at redhat dot com
2011-04-07  8:22 ` jan.kratochvil at redhat dot com
2011-04-07 10:35 ` pedro at codesourcery dot com
2011-04-12  9:26 ` mpolacek at redhat dot com
2011-05-02 17:52 ` cvs-commit at gcc dot gnu.org
2011-05-27 14:41 ` mpolacek at redhat dot com
2011-10-29 14:01 ` jan.kratochvil at redhat dot com
2011-11-25 23:53 ` cvs-commit at gcc dot gnu.org
2011-12-02 12:44 ` cvs-commit at gcc dot gnu.org
2011-12-10 23:05 ` cvs-commit at gcc dot gnu.org
2012-05-15 13:10 ` cvs-commit at gcc dot gnu.org
2012-07-04 14:57 ` cvs-commit at gcc dot gnu.org
2013-05-21 15:00 ` cvs-commit at gcc dot gnu.org
2014-06-02 15:22 ` polacek at redhat dot com
2014-08-20 18:23 ` cvs-commit at gcc dot gnu.org
2024-01-14 14:50 ` ssbssa at sourceware dot org
2024-01-14 15:04 ` vries 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).