* [PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero
@ 2020-09-10 12:27 Jon Turney
2020-09-10 14:04 ` Corinna Vinschen
0 siblings, 1 reply; 4+ messages in thread
From: Jon Turney @ 2020-09-10 12:27 UTC (permalink / raw)
To: cygwin-patches; +Cc: Jon Turney
If the process exited with e.g. STATUS_DLL_NOT_FOUND, also process the
file to look for not found DLLs.
(We currently only do this when a STATUS_DLL_NOT_FOUND exception occurs,
which I haven't managed to observe)
This still isn't 100% correct, as it only examines the specified file
for missing DLLs, not recursively on the DLLs it depends upon.
---
winsup/utils/ldd.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/winsup/utils/ldd.cc b/winsup/utils/ldd.cc
index e1af99e12..1e1863c1c 100644
--- a/winsup/utils/ldd.cc
+++ b/winsup/utils/ldd.cc
@@ -407,6 +407,8 @@ report (const char *in_fn, bool multiple)
}
break;
case EXIT_PROCESS_DEBUG_EVENT:
+ if (ev.u.ExitProcess.dwExitCode != 0)
+ process_fn = fn_win;
print_and_exit:
print_dlls (&dll_list, isdll ? fn_win : NULL, process_fn);
exitnow = true;
--
2.28.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero
2020-09-10 12:27 [PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero Jon Turney
@ 2020-09-10 14:04 ` Corinna Vinschen
2020-09-11 12:33 ` Jon Turney
0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2020-09-10 14:04 UTC (permalink / raw)
To: cygwin-patches
On Sep 10 13:27, Jon Turney wrote:
> If the process exited with e.g. STATUS_DLL_NOT_FOUND, also process the
> file to look for not found DLLs.
>
> (We currently only do this when a STATUS_DLL_NOT_FOUND exception occurs,
> which I haven't managed to observe)
>
> This still isn't 100% correct, as it only examines the specified file
> for missing DLLs, not recursively on the DLLs it depends upon.
Better than nothing? Please push.
Thanks,
Corinna
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero
2020-09-10 14:04 ` Corinna Vinschen
@ 2020-09-11 12:33 ` Jon Turney
2020-09-11 14:08 ` Corinna Vinschen
0 siblings, 1 reply; 4+ messages in thread
From: Jon Turney @ 2020-09-11 12:33 UTC (permalink / raw)
To: Cygwin Patches
On 10/09/2020 15:04, Corinna Vinschen wrote:
> On Sep 10 13:27, Jon Turney wrote:
>> If the process exited with e.g. STATUS_DLL_NOT_FOUND, also process the
>> file to look for not found DLLs.
>>
>> (We currently only do this when a STATUS_DLL_NOT_FOUND exception occurs,
>> which I haven't managed to observe)
>>
>> This still isn't 100% correct, as it only examines the specified file
>> for missing DLLs, not recursively on the DLLs it depends upon.
>
> Better than nothing?
Well, except when people are misled when investigating problems because
they assume the output is accurate. (e.g. [1])
[1] https://cygwin.com/pipermail/cygwin/2020-September/246164.html
I guess what's maybe needed is some indication that an error occurred
and the output may be incomplete if the inferior process exited with a
non-zero status. But not sure how we can do that while keeping the
output compatible with linux ldd.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero
2020-09-11 12:33 ` Jon Turney
@ 2020-09-11 14:08 ` Corinna Vinschen
0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2020-09-11 14:08 UTC (permalink / raw)
To: cygwin-patches
On Sep 11 13:33, Jon Turney wrote:
> On 10/09/2020 15:04, Corinna Vinschen wrote:
> > On Sep 10 13:27, Jon Turney wrote:
> > > If the process exited with e.g. STATUS_DLL_NOT_FOUND, also process the
> > > file to look for not found DLLs.
> > >
> > > (We currently only do this when a STATUS_DLL_NOT_FOUND exception occurs,
> > > which I haven't managed to observe)
> > >
> > > This still isn't 100% correct, as it only examines the specified file
> > > for missing DLLs, not recursively on the DLLs it depends upon.
> >
> > Better than nothing?
>
> Well, except when people are misled when investigating problems because they
> assume the output is accurate. (e.g. [1])
>
> [1] https://cygwin.com/pipermail/cygwin/2020-September/246164.html
>
> I guess what's maybe needed is some indication that an error occurred and
> the output may be incomplete if the inferior process exited with a non-zero
> status. But not sure how we can do that while keeping the output compatible
> with linux ldd.
I assume there *may* occur an error in ldd as well, so it might be
intersting to check the Linux ldd sources to see how it generates
error output.
Corinna
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-09-11 14:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 12:27 [PATCH] Cygwin: ldd: Also look for not found DLLs when exit status is non-zero Jon Turney
2020-09-10 14:04 ` Corinna Vinschen
2020-09-11 12:33 ` Jon Turney
2020-09-11 14:08 ` Corinna Vinschen
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).