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

lws_create_context: failed to load evlib_glib #3274

Open
acrilique opened this issue Nov 13, 2024 · 5 comments
Open

lws_create_context: failed to load evlib_glib #3274

acrilique opened this issue Nov 13, 2024 · 5 comments

Comments

@acrilique
Copy link

This issue arose when I tried to compile a project that I wrote that uses libwebsockets using a machine running Fedora 41. The project was developed using Ubuntu 24.04 LTS and I never had a problem running it there.
That's why I thought it had to be a problem with the Fedora package, so I opened an issue on their bugzilla:

Description Lluc 2024-11-10 22:33:11 UTC

Description of problem:
Libwebsockets is not working if glib event loop option is specified.

Version-Release number of selected component (if applicable):
4.3.2-8

How reproducible:
Always

Steps to Reproduce:

  1. Install libwebsockets and libwebsockets-devel using dnf
  2. Write a program that initializes libwebsockets requiring the use of glib's event loop:
    struct lws_context_creation_info info;
    memset(&info, 0, sizeof info);
    info.options = LWS_SERVER_OPTION_GLIB;
    ws_data.context = lws_create_context(&info);
  1. Compile and run the program

Actual results:
I see this program output:

[2024/11/10 21:35:02:1240] E: lws_create_context: failed to load evlib_glib

And then websocket context initialization fails.

Expected results:
Websocket context initialization should work.

Additional info:
I have checked that all libwebsockets libs are in the correct folder, including libwebsockets-evlib_glib.so:

$ ls /usr/local/lib | grep libwebsockets
libwebsockets.a
libwebsockets-evlib_event.so
libwebsockets-evlib_ev.so
libwebsockets-evlib_glib.so
libwebsockets-evlib_uv.so
libwebsockets.so
libwebsockets.so.19

Comment 1 Fabian Affolter 2024-11-13 08:29:33 UTC

At first glances this looks like an upstream issue and not a packaging bug.

Please check https://libwebsockets.org/mailman/listinfo/libwebsockets (sorry, I can't find libwebsockets's issue tracker)

I hope that you'll be able to spot where the issue is and present a fix. If you think it's a packaging bug, I'll insist on that in the bugzilla. Thanks for your time.

@lws-team
Copy link
Member

You can run it under strace and see what it's trying to do before it fails to load the dynlib.

I think if the dynlib needs a library that's not installed, it can also cause this kind of thing. But it should show up on strace output if so.

@acrilique
Copy link
Author

I ran strace and couldn't see anything that seemed obvious to me. Here's a snippet of strace that I copied. Before that, there's a newfstatat(AT_FDCWD, "/usr/lib64/gstreamer-1.0/gst... line that is clearly not related to libwebsockets, so I assume that if the problem can be spotted on strace, it's in the snippet.

@lws-team
Copy link
Member

I can't see why from the log either, is strace -f producing anything more interesting?

@acrilique
Copy link
Author

Well, it seems to be loading font-related stuff and libasahi... then fails to load evlib_glib
Log
Still nothing I think

@lws-team
Copy link
Member

It should be trying to load evlib_glib*.so at the start. Is it possible to make glib itself do verbose logging while it tries to start, eg, by env var or so on.

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

No branches or pull requests

2 participants