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

JackWeakAPI: tryload_libjack sends "Failed to load libjack DLL: -1644446336libjack not found, so do not try to load jack_client_open ffs !" to stderr unconditionally #998

Open
JoergAtGithub opened this issue Jan 5, 2025 · 0 comments
Labels

Comments

@JoergAtGithub
Copy link

Describe the bug

The https://github.com/jackaudio/jack2/blob/master/common/JackWeakAPI.c does not behave weak. The
tryload_libjack sends "Failed to load libjack DLL: -1644446336libjack not found, so do not try to load jack_client_open ffs !" to stderr if libjack is ot installed on the system.
JACK is an optional feature in our application and we use the JackWeakAPI to probe if the user has JACK installed. We get many bug reports because of this error message in on the console.

Environment

  • JACK Version: Which version of jack2 are you using?
    1.9.22

  • Operating System: What operating system or distribution in which version are you using? (e.g. Linux, macOS, Windows)
    We use the VCPKG port on Windows

Steps To Reproduce

Execute tryload_libjack() in a minimal program, on a Windows system without libjack.dll/libjack64.dll installed.

Expected vs. actual behavior

1.)

FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPTSTR) &lpMsgBuf,0,NULL );
is not working as intended. It should gather the detailed error text from Windows, but it prints a random number like -1644446336.
2.) The weak API should probe for the libjack installation silent. Either make the printout to stderr optional by a flag, or store the message in a string, which the application code can evaluate or not.

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

No branches or pull requests

1 participant