| Summary: | Busy loop within C library when calling SDL_Init() | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Paul Cercueil <paul> |
| Component: | loadso | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | icculus |
| Version: | 2.0.10 | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Attachments: | Patch to fix bug 4891 | ||
|
Description
Paul Cercueil
2019-12-08 14:41:23 UTC
This function generally means the dynamic loader is resolving symbols. If you observed this under the debugger, can you run the “bt” command and paste the output here? It’s probably going to be somewhere under a dlopen() call. --ryan. Unfortunately it doesn't go very far: (gdb) bt #0 0x77e6ab88 in _dl_find_hash () from /lib/ld-uClibc.so.0 #1 0x77e6aba4 in _dl_find_hash () from /lib/ld-uClibc.so.0 Backtrace stopped: frame did not save the PC (and yes, I compiled SDL2 with -ggdb3 and GDB did load the symbols). I added debug to src/loadso/dlopen/SDL_sysloadso.c. From what I can see, it seems to hang within dlopen(), when libdrm.so.2 is opened for the *second* time. See below: gcw0:~ $ gdb ./testsdl2 [...] (gdb) r Starting program: /media/data/local/home/testsdl2 [New LWP 264] SDL dlopen(libdrm.so.2)... done SDL dlopen(libgbm.so.1)... done SDL dlsym(drmModeFreeResources)... done SDL dlsym(drmModeFreeFB)... done SDL dlsym(drmModeFreeCrtc)... done SDL dlsym(drmModeFreeConnector)... done SDL dlsym(drmModeFreeEncoder)... done SDL dlsym(drmModeGetResources)... done SDL dlsym(drmModeAddFB)... done SDL dlsym(drmModeRmFB)... done SDL dlsym(drmModeGetFB)... done SDL dlsym(drmModeGetCrtc)... done SDL dlsym(drmModeSetCrtc)... done SDL dlsym(drmModeSetCursor)... done SDL dlsym(drmModeSetCursor2)... done SDL dlsym(drmModeMoveCursor)... done SDL dlsym(drmModeGetEncoder)... done SDL dlsym(drmModeGetConnector)... done SDL dlsym(drmHandleEvent)... done SDL dlsym(drmModePageFlip)... done SDL dlsym(gbm_device_get_fd)... done SDL dlsym(gbm_device_is_format_supported)... done SDL dlsym(gbm_device_destroy)... done SDL dlsym(gbm_create_device)... done SDL dlsym(gbm_bo_get_width)... done SDL dlsym(gbm_bo_get_height)... done SDL dlsym(gbm_bo_get_stride)... done SDL dlsym(gbm_bo_get_handle)... done SDL dlsym(gbm_bo_write)... done SDL dlsym(gbm_bo_get_device)... done SDL dlsym(gbm_bo_set_user_data)... done SDL dlsym(gbm_bo_get_user_data)... done SDL dlsym(gbm_bo_destroy)... done SDL dlsym(gbm_bo_create)... done SDL dlsym(gbm_surface_create)... done SDL dlsym(gbm_surface_destroy)... done SDL dlsym(gbm_surface_lock_front_buffer)... done SDL dlsym(gbm_surface_release_buffer)... done SDL dlopen(libdrm.so.2)... Small update: this bug does not happen if libdrm is pre-loaded: SDL_PRELOAD=/usr/lib/libdrm.so.2 ./testsdl2 works fine. Created attachment 4113 [details] Patch to fix bug 4891 Patch added, thanks! https://hg.libsdl.org/SDL/rev/4f5bef55183c |