Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: ldd silent about missing dll dependencies #21

Open
wants to merge 2 commits into
base: msys2-3_1_7-release
Choose a base branch
from

Conversation

jannick0
Copy link

As of now ldd is silent about missing dll dependencies - and it always returns with 0, regardless if all dll dependencies are found or not.

With the commits kept as minimal as possible, the PR fixes:

  • missing dll dependencies are now listed marked with not found (dll dependencies on a dll which is not found are still not listed, of course)
  • ldd returns with exit code 1 if not all dll dependencies are found.
  • memory leakage as an extra

This bug is a bit painful per se - and, in particular, for the CI function list_dll_deps in ci-library.sh of the MSYS and MINGW repos:

# from ci-library.sh
# List DDL dependencies
list_dll_deps(){
    local target="${1}"
    echo "$(tput setaf 2)MSYS2 DLL dependencies:$(tput sgr0)"
    find "$target" -regex ".*\.\(exe\|dll\)" -print0 | xargs -0 -r ldd | GREP_COLOR="1;35" grep --color=always "msys-.*\|" \
    || echo "        None"
}
  1. list_dll_deps could be amended, e.g.,
  • for coloring and
  • such that CI fails or sends out an email if a dll dependency cannot be resolved (e.g., due to a changed dll file name)
  1. The bug persists on Cygwin. In case one of you guys think this should be patched upstream, please go ahead. I am not really involved with the cygwin infrastructure I must admit. Thanks.

I hope this PR sits on the correct branch of the repo. This is my first PR here.

This commit should ensure that if a dll dependency is not found
- it is shown in the list marked with 'not found'
- LDD returns with exit code 1

* winsup/utils/ldd.cc:
  - enhance debug event EXIT_PROCESS_DEBUG_EVENT
* winsup/utils/ldd.cc: here.
@dscho
Copy link
Collaborator

dscho commented Dec 14, 2020

Is this maybe addressing bugs in Cygwin directly?

@jannick0
Copy link
Author

Yes - see 2.) above.

@dscho
Copy link
Collaborator

dscho commented Dec 14, 2020

In case one of you guys think this should be patched upstream, please go ahead.

I won't have the time (and even if I had the time, I don't like to be treated like a convenience, so I'll decline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants