This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug testsuite/12649] New: reproducer for races of expect incompletereads


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]