* [RFA/windows] Spurious "dll not found" error messages on x64-windows.
@ 2010-02-04 4:13 Joel Brobecker
2010-02-04 22:18 ` Christopher Faylor
0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-02-04 4:13 UTC (permalink / raw)
To: gdb-patches
When running 32bit programs on x64 windows, GDB produces the following
error messages:
(gdb) start
Temporary breakpoint 1 at 0x4015ae: file simple_main.adb, line 4.
Starting program: C:\[...]/simple_main.exe
[New Thread 31464.0x8cd4]
!!! -> Error: dll starting at 0x77a60000 not found.
!!! -> Error: dll starting at 0x77650000 not found.
!!! -> Error: dll starting at 0x77a60000 not found.
!!! -> Error: dll starting at 0x77990000 not found.
Temporary breakpoint 1, simple_main () at simple_main.adb:4
4 simple.test_simple;
This is something that was already discussed previously for gdbserver,
where these events were not well handled and eventually lead to a crash:
http://www.sourceware.org/ml/gdb-patches/2010-02/msg00011.html
A quick investigation showed that there were no dll-load-events that
correspond to these base addresses. A search on the net points at
the WOW layer which interfaces between the 32bit and 64bit worlds.
My first proposal is to silently ignore these spurious events during
the startup phase. We could probably refine this check by also verifying
that we are running a 32bit exe on 64bit Windows. But given that this
error did not trigger in the past, I think that'd be overkill. In fact,
I don't think that ditching the error would be a big loss (we could turn
it into a complaint if we want to be able to see it in special occasions).
gdb/ChangeLog:
* windows-nat.c (handle_unload_dll): Disable unknown-dll error
during the inferior startup phase.
Tested on x86_64-windows using a x86-windows compiler/debugger.
OK to apply?
Thanks,
--
Joel
---
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 2740366..4c2d1d8 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -783,7 +783,16 @@ handle_unload_dll (void *dummy)
return 1;
}
- error (_("Error: dll starting at %s not found."),
+ /* We did not find any DLL that was previously loaded at this address.
+ This is normally an error. However, we have observed that running
+ 32bit applications on x64 Windows causes us to receive 4 mysterious
+ UNLOAD_DLL_DEBUG_EVENTs during the startup phase. These events are
+ apparently caused by the WOW layer (this is the interface between
+ the 32bit and 64bit worlds). Because of these events, we only report
+ the error after the initialization phase is complete (there is not
+ much data that we can use to identify these spurious events). */
+ if (windows_initialization_done)
+ error (_("Error: dll starting at %s not found."),
host_address_to_string (lpBaseOfDll));
return 0;
--
1.6.3.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/windows] Spurious "dll not found" error messages on x64-windows.
2010-02-04 4:13 [RFA/windows] Spurious "dll not found" error messages on x64-windows Joel Brobecker
@ 2010-02-04 22:18 ` Christopher Faylor
2010-02-11 11:22 ` Joel Brobecker
0 siblings, 1 reply; 6+ messages in thread
From: Christopher Faylor @ 2010-02-04 22:18 UTC (permalink / raw)
To: gdb-patches, Joel Brobecker
On Thu, Feb 04, 2010 at 08:12:48AM +0400, Joel Brobecker wrote:
>When running 32bit programs on x64 windows, GDB produces the following
>error messages:
>
> (gdb) start
> Temporary breakpoint 1 at 0x4015ae: file simple_main.adb, line 4.
> Starting program: C:\[...]/simple_main.exe
> [New Thread 31464.0x8cd4]
> !!! -> Error: dll starting at 0x77a60000 not found.
> !!! -> Error: dll starting at 0x77650000 not found.
> !!! -> Error: dll starting at 0x77a60000 not found.
> !!! -> Error: dll starting at 0x77990000 not found.
>
> Temporary breakpoint 1, simple_main () at simple_main.adb:4
> 4 simple.test_simple;
>
>This is something that was already discussed previously for gdbserver,
>where these events were not well handled and eventually lead to a crash:
> http://www.sourceware.org/ml/gdb-patches/2010-02/msg00011.html
>
>A quick investigation showed that there were no dll-load-events that
>correspond to these base addresses. A search on the net points at
>the WOW layer which interfaces between the 32bit and 64bit worlds.
>
>My first proposal is to silently ignore these spurious events during
>the startup phase. We could probably refine this check by also verifying
>that we are running a 32bit exe on 64bit Windows. But given that this
>error did not trigger in the past, I think that'd be overkill. In fact,
>I don't think that ditching the error would be a big loss (we could turn
>it into a complaint if we want to be able to see it in special occasions).
>
>gdb/ChangeLog:
>
> * windows-nat.c (handle_unload_dll): Disable unknown-dll error
> during the inferior startup phase.
>
>Tested on x86_64-windows using a x86-windows compiler/debugger.
>OK to apply?
>
>Thanks,
>--
>Joel
>
>---
>diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
>index 2740366..4c2d1d8 100644
>--- a/gdb/windows-nat.c
>+++ b/gdb/windows-nat.c
>@@ -783,7 +783,16 @@ handle_unload_dll (void *dummy)
> return 1;
> }
>
>- error (_("Error: dll starting at %s not found."),
>+ /* We did not find any DLL that was previously loaded at this address.
>+ This is normally an error. However, we have observed that running
>+ 32bit applications on x64 Windows causes us to receive 4 mysterious
>+ UNLOAD_DLL_DEBUG_EVENTs during the startup phase. These events are
>+ apparently caused by the WOW layer (this is the interface between
>+ the 32bit and 64bit worlds). Because of these events, we only report
>+ the error after the initialization phase is complete (there is not
>+ much data that we can use to identify these spurious events). */
>+ if (windows_initialization_done)
>+ error (_("Error: dll starting at %s not found."),
> host_address_to_string (lpBaseOfDll));
>
> return 0;
Sorry but, I don't think this right. What's the point of issuing the
error after inferior startup? I think it's only during startup that
something like this would be useful.
I think making the error a complaint makes more sense.
cgf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/windows] Spurious "dll not found" error messages on x64-windows.
2010-02-04 22:18 ` Christopher Faylor
@ 2010-02-11 11:22 ` Joel Brobecker
2010-02-11 17:24 ` Christopher Faylor
2010-02-11 19:53 ` Tom Tromey
0 siblings, 2 replies; 6+ messages in thread
From: Joel Brobecker @ 2010-02-11 11:22 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]
> Sorry but, I don't think this right. What's the point of issuing the
> error after inferior startup? I think it's only during startup that
> something like this would be useful.
>
> I think making the error a complaint makes more sense.
Sure. I am not sure when DLLs are unloaded most... I was thinking
more about the case where a user does a LoadLibrary/FreeLibrary.
Regardless, here is a version that transforms the error into a complaint.
So far, complaints appears to be used only for symbol file events.
It's a tiny bit of a strech to include our complaint in that category,
but I think that creating a different category for that might be
a bit overkill. I don't mind doing so, however. I chose the simpler
approach for now, which gives us the following complaint when they
are activated:
[New Thread 94404.0x222a8]
During symbol reading, dll starting at 0x77a60000 not found..
During symbol reading, dll starting at 0x77650000 not found..
[...]
The "During symbol reading" is where the complaint category comes
in play.
Note that the module description in complaints.h says:
Definitions for complaint handling during symbol reading in GDB.
But I don't see why this couldn't be used for other purposes (and
hence why we couldn't create new categories if necessary).
gdb/ChangeLog:
* windows-nat.c: Add include of complaints.h.
(handle_unload_dll): Change dll-not-found error into a complaint.
Tested on x86_64-windows with an x86-windows toolchain.
--
Joel
[-- Attachment #2: unloaded-dll-not-found.diff --]
[-- Type: text/x-diff, Size: 1146 bytes --]
--- windows-nat.c.orig 2010-02-11 12:09:23.911442400 +0100
+++ windows-nat.c 2010-02-11 11:22:29.060598600 +0100
@@ -64,6 +64,7 @@
#include "windows-tdep.h"
#include "windows-nat.h"
#include "i386-nat.h"
+#include "complaints.h"
#define AdjustTokenPrivileges dyn_AdjustTokenPrivileges
#define DebugActiveProcessStop dyn_DebugActiveProcessStop
@@ -783,8 +784,15 @@ handle_unload_dll (void *dummy)
return 1;
}
- error (_("Error: dll starting at %s not found."),
- host_address_to_string (lpBaseOfDll));
+ /* We did not find any DLL that was previously loaded at this address,
+ so register a complaint. We do not report an error, because we have
+ observed that this may be happening under some circumstances. For
+ instance, running 32bit applications on x64 Windows causes us to receive
+ 4 mysterious UNLOAD_DLL_DEBUG_EVENTs during the startup phase (these
+ events are apparently caused by the WOW layer, the interface between
+ 32bit and 64bit worlds). */
+ complaint (&symfile_complaints, _("dll starting at %s not found."),
+ host_address_to_string (lpBaseOfDll));
return 0;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/windows] Spurious "dll not found" error messages on x64-windows.
2010-02-11 11:22 ` Joel Brobecker
@ 2010-02-11 17:24 ` Christopher Faylor
2010-02-12 4:55 ` Joel Brobecker
2010-02-11 19:53 ` Tom Tromey
1 sibling, 1 reply; 6+ messages in thread
From: Christopher Faylor @ 2010-02-11 17:24 UTC (permalink / raw)
To: gdb-patches, Joel Brobecker
On Thu, Feb 11, 2010 at 03:21:57PM +0400, Joel Brobecker wrote:
>> Sorry but, I don't think this right. What's the point of issuing the
>> error after inferior startup? I think it's only during startup that
>> something like this would be useful.
>>
>> I think making the error a complaint makes more sense.
>
>Sure. I am not sure when DLLs are unloaded most... I was thinking
>more about the case where a user does a LoadLibrary/FreeLibrary.
>
>Regardless, here is a version that transforms the error into a complaint.
>So far, complaints appears to be used only for symbol file events.
>It's a tiny bit of a strech to include our complaint in that category,
>but I think that creating a different category for that might be
>a bit overkill. I don't mind doing so, however. I chose the simpler
>approach for now, which gives us the following complaint when they
>are activated:
>
> [New Thread 94404.0x222a8]
> During symbol reading, dll starting at 0x77a60000 not found..
> During symbol reading, dll starting at 0x77650000 not found..
> [...]
>
>The "During symbol reading" is where the complaint category comes
>in play.
>
>Note that the module description in complaints.h says:
>
> Definitions for complaint handling during symbol reading in GDB.
>
>But I don't see why this couldn't be used for other purposes (and
>hence why we couldn't create new categories if necessary).
>
>gdb/ChangeLog:
>
> * windows-nat.c: Add include of complaints.h.
> (handle_unload_dll): Change dll-not-found error into a complaint.
>
>Tested on x86_64-windows with an x86-windows toolchain.
Looks good to me. Thanks.
cgf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/windows] Spurious "dll not found" error messages on x64-windows.
2010-02-11 11:22 ` Joel Brobecker
2010-02-11 17:24 ` Christopher Faylor
@ 2010-02-11 19:53 ` Tom Tromey
1 sibling, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2010-02-11 19:53 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> Note that the module description in complaints.h says:
Joel> Definitions for complaint handling during symbol reading in GDB.
Joel> But I don't see why this couldn't be used for other purposes (and
Joel> hence why we couldn't create new categories if necessary).
For the record, I agree.
In this case I don't mind if you want to reuse the existing category.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/windows] Spurious "dll not found" error messages on x64-windows.
2010-02-11 17:24 ` Christopher Faylor
@ 2010-02-12 4:55 ` Joel Brobecker
0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2010-02-12 4:55 UTC (permalink / raw)
To: gdb-patches
> >gdb/ChangeLog:
> >
> > * windows-nat.c: Add include of complaints.h.
> > (handle_unload_dll): Change dll-not-found error into a complaint.
>
> Looks good to me. Thanks.
Thanks! Now checked in.
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-02-12 4:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04 4:13 [RFA/windows] Spurious "dll not found" error messages on x64-windows Joel Brobecker
2010-02-04 22:18 ` Christopher Faylor
2010-02-11 11:22 ` Joel Brobecker
2010-02-11 17:24 ` Christopher Faylor
2010-02-12 4:55 ` Joel Brobecker
2010-02-11 19:53 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox