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 remote/15115] New: lockup on Windows 7 (64 bit)


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

             Bug #: 15115
           Summary: lockup on Windows 7 (64 bit)
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: critical
          Priority: P2
         Component: remote
        AssignedTo: unassigned@sourceware.org
        ReportedBy: moorel@ntlworld.com
    Classification: Unclassified


Hi Support
(complicated description follows ...)

I have encountered an intermittant and difficult to reproduce bug.
The problem is when I connect gdb running on a Windows 7 (64 bit) machine, to a
remote (simulator) server running on the same machine.

I have tried remote targets for ARM and MIPS, and I get the same behavior,
basically a lock up.

I have tracked this down to an issue with the call to WaitForMultipleObjects in
gdb_select() in the file mingw-hdep.c. The call to WaitForMultipleObjects
always uses a timeout of 1 second, it appears that the remotetimeout value is
used in a higher level functions to perform multiple 1 second iterations, so in
pseudo code, something like
for(i=0; i<remotetimeout; i++) {
    WaitForMultipleObjects(timeout = i)
}
rather than
WaitForMultipleObjects(remotetimeout)

Anyway, I have noticed that when the machine is heavily loaded this locks up
when the timeout from a getpkt call (timeout = -1).

I tried an experiment where I increased the stepping for the system call
WaitForMultipleObjects to use 10 second steps instead of 1 second steps, and my
problem went away.
This concerns me, because clearly something bad is happening in the low level
call for WaitForMultipleObjects, and I only see this in a Windows 7 (64 bit)
gdb, the same code compiled for Windows XP (32 bit) does not show the issue.

in other words set 
    // Wait 10x usual 1s timeout
    # define FACTOR 10
    event = WaitForMultipleObjects(num_handles,
                                   handles,
                                   FALSE,
                                   timeout
                                   ? (timeout->tv_sec * 1000 * FACTOR
                                      + timeout->tv_usec / 1000)
                                   : INFINITE);

I have compiled gdb7.5.1 for mips and arm targets, to be hosted on WindowsXP
32-bit using mingw32, and compiled gdb7.5.1 for mips and arm targets, to be
hosted on Windows7 64-bit using mingw64

Thx
Lee

-- 
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]