public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/15115] New: lockup on Windows 7 (64 bit)
@ 2013-02-07 12:37 moorel at ntlworld dot com
  2013-02-08  8:56 ` [Bug remote/15115] " moorel at ntlworld dot com
  0 siblings, 1 reply; 2+ messages in thread
From: moorel at ntlworld dot com @ 2013-02-07 12:37 UTC (permalink / raw)
  To: gdb-prs

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.


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

* [Bug remote/15115] lockup on Windows 7 (64 bit)
  2013-02-07 12:37 [Bug remote/15115] New: lockup on Windows 7 (64 bit) moorel at ntlworld dot com
@ 2013-02-08  8:56 ` moorel at ntlworld dot com
  0 siblings, 0 replies; 2+ messages in thread
From: moorel at ntlworld dot com @ 2013-02-08  8:56 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Lee Moore <moorel at ntlworld dot com> 2013-02-08 08:56:37 UTC ---
Hi Support,

Quick update.
I have now reproduced this same issue, but much less frequently on a Windows XP
(32-bit) machine. 
I have not yet proven that the workaround to calling WaitForMultipleObjects
(described earlier) on the Windows 7 (64-bit) build, fixes the same issue in
the Windows XP (32-bit) build.

Thx
Lee Moore

-- 
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] 2+ messages in thread

end of thread, other threads:[~2013-02-08  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 12:37 [Bug remote/15115] New: lockup on Windows 7 (64 bit) moorel at ntlworld dot com
2013-02-08  8:56 ` [Bug remote/15115] " moorel at ntlworld dot com

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).