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

Declare "sha1_init" statically to avoid naming conflicts #3

Closed
wants to merge 1 commit into from

Conversation

fancycode
Copy link
Contributor

Such conflicts can happen if linked statically with another library providing a method with the same name.

…atically with other libraries providing a method with the same name (e.g. OpenSSL).
@dumganhar
Copy link

Why wasn't this Pull Request merged?

@warmcat
Copy link
Collaborator

warmcat commented Oct 12, 2015

Sorry this was fixed by d8b8542 at almost the same time.

@warmcat warmcat closed this Oct 12, 2015
@fog1111 fog1111 mentioned this pull request Nov 24, 2017
@yj1851 yj1851 mentioned this pull request Jul 12, 2022
Merkyrio pushed a commit to liveryvideo/libwebsockets that referenced this pull request May 2, 2024
There is potential deadlock between lws_create_context and lws_service.
This TSAN message would give more details (proprietary code backtrace was stripped):

==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=516380)
  Cycle in lock order graph: M0 (0x7bb4000016b8) => M1 (0x7bb400000360) => M0

  Mutex M1 acquired here while holding mutex M0 in thread T2:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 lws_wsi_inject_to_loop libwebsockets/lib/core-net/wsi.c:354:2 (libwebsockets.so.19+0xbf8d7)
    warmcat#3 __lws_create_event_pipes libwebsockets/lib/core-net/vhost.c:1172:8 (libwebsockets.so.19+0xb490f)
    warmcat#4 lws_create_context libwebsockets/lib/core/context.c:1302:6 (libwebsockets.so.19+0x3e592)

  Mutex M0 previously acquired by the same thread here:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 lws_create_context libwebsockets/lib/core/context.c:1301:2 (libwebsockets.so.19+0x3e580)

  Mutex M0 acquired here while holding mutex M1 in thread T8:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 lws_sul_plat_unix libwebsockets/lib/plat/unix/unix-init.c:64:2 (libwebsockets.so.19+0x1e4a1)
    warmcat#3 __lws_sul_service_ripe libwebsockets/lib/core-net/sorted-usec-list.c:161:3 (libwebsockets.so.19+0xbd871)
    warmcat#4 _lws_plat_service_tsi libwebsockets/lib/plat/unix/unix-service.c:125:7 (libwebsockets.so.19+0x1fc07)
    warmcat#5 lws_plat_service libwebsockets/lib/plat/unix/unix-service.c:235:9 (libwebsockets.so.19+0x20237)
    warmcat#6 lws_service libwebsockets/lib/core-net/service.c:838:6 (libwebsockets.so.19+0xbd0c2)

  Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 _lws_plat_service_tsi libwebsockets/lib/plat/unix/unix-service.c:121:2 (libwebsockets.so.19+0x1fbee)
    warmcat#3 lws_plat_service libwebsockets/lib/plat/unix/unix-service.c:235:9 (libwebsockets.so.19+0x20237)
    warmcat#4 lws_service libwebsockets/lib/core-net/service.c:838:6 (libwebsockets.so.19+0xbd0c2)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock
==================
Merkyrio pushed a commit to liveryvideo/libwebsockets that referenced this pull request May 2, 2024
There is potential deadlock between lws_create_context and lws_service.
This TSAN message would give more details (proprietary code backtrace was stripped):

==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=516380)
  Cycle in lock order graph: M0 (0x7bb4000016b8) => M1 (0x7bb400000360) => M0

  Mutex M1 acquired here while holding mutex M0 in thread T2:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 lws_wsi_inject_to_loop libwebsockets/lib/core-net/wsi.c:354:2 (libwebsockets.so.19+0xbf8d7)
    warmcat#3 __lws_create_event_pipes libwebsockets/lib/core-net/vhost.c:1172:8 (libwebsockets.so.19+0xb490f)
    warmcat#4 lws_create_context libwebsockets/lib/core/context.c:1302:6 (libwebsockets.so.19+0x3e592)

  Mutex M0 previously acquired by the same thread here:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 lws_create_context libwebsockets/lib/core/context.c:1301:2 (libwebsockets.so.19+0x3e580)

  Mutex M0 acquired here while holding mutex M1 in thread T8:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 lws_sul_plat_unix libwebsockets/lib/plat/unix/unix-init.c:64:2 (libwebsockets.so.19+0x1e4a1)
    warmcat#3 __lws_sul_service_ripe libwebsockets/lib/core-net/sorted-usec-list.c:161:3 (libwebsockets.so.19+0xbd871)
    warmcat#4 _lws_plat_service_tsi libwebsockets/lib/plat/unix/unix-service.c:125:7 (libwebsockets.so.19+0x1fc07)
    warmcat#5 lws_plat_service libwebsockets/lib/plat/unix/unix-service.c:235:9 (libwebsockets.so.19+0x20237)
    warmcat#6 lws_service libwebsockets/lib/core-net/service.c:838:6 (libwebsockets.so.19+0xbd0c2)

  Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock
    warmcat#1 lws_mutex_refcount_lock libwebsockets/lib/core/libwebsockets.c:1471:2 (libwebsockets.so.19+0x48ff2)
    warmcat#2 _lws_plat_service_tsi libwebsockets/lib/plat/unix/unix-service.c:121:2 (libwebsockets.so.19+0x1fbee)
    warmcat#3 lws_plat_service libwebsockets/lib/plat/unix/unix-service.c:235:9 (libwebsockets.so.19+0x20237)
    warmcat#4 lws_service libwebsockets/lib/core-net/service.c:838:6 (libwebsockets.so.19+0xbd0c2)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock
==================
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.

3 participants