You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2020/05/05 09:43:46 UTC

[GitHub] [celix] Oipo opened a new issue #215: Signal-unsafe functions calls inside signal handler

Oipo opened a new issue #215:
URL: https://github.com/apache/celix/issues/215


   See [this link](https://owasp.org/www-community/vulnerabilities/Unsafe_function_call_from_a_signal_handler) for more info.
   
   Tsan output:
   
   ```
   ==================
   WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=52772)
       #0 calloc <null> (libtsan.so.0+0x2cdbd)
       #1 celix_private_dependencyManager_create /home/oipo-unencrypted/Programming/celix/libs/framework/src/dm_dependency_manager_impl.c:33 (libcelix_framework.so.2+0x485d2)
       #2 celix_bundleContext_getDependencyManager /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle_context.c:515 (libcelix_framework.so.2+0x20126)
       #3 fw_stopBundle /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1057 (libcelix_framework.so.2+0x28427)
       #4 framework_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:611 (libcelix_framework.so.2+0x26512)
       #5 bundle_stopWithOptions /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:307 (libcelix_framework.so.2+0x18608)
       #6 bundle_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:297 (libcelix_framework.so.2+0x18557)
       #7 celixLauncher_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:192 (libcelix_framework.so.2+0x47fbf)
       #8 shutdown_framework /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:132 (libcelix_framework.so.2+0x47d56)
       #9 shellSigHandler /home/oipo-unencrypted/Programming/celix/bundles/shell/shell_tui/private/src/shell_tui.c:159 (libshell_tui.so.1+0x3272)
       #10 <null> <null> (libtsan.so.0+0x2a226)
       #11 celixThreadCondition_wait /home/oipo-unencrypted/Programming/celix/libs/utils/src/celix_threads.c:156 (libcelix_utils.so.2+0x104b0)
       #12 framework_waitForStop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1771 (libcelix_framework.so.2+0x2ace8)
       #13 celixLauncher_waitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:178 (libcelix_framework.so.2+0x47f14)
       #14 celixLauncher_launchAndWaitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:116 (libcelix_framework.so.2+0x47c4d)
       #15 main /home/oipo-unencrypted/Programming/celix/build/celix/gen/containers/pubsub_zmq/main.c:16 (pubsub_zmq+0x1218)
   
   SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal (/lib/x86_64-linux-gnu/libtsan.so.0+0x2cdbd) in calloc
   ==================
   ```
   
   ```
   ==================
   WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=52772)
       #0 calloc <null> (libtsan.so.0+0x2cdbd)
       #1 celix_arrayList_createWithEquals /home/oipo-unencrypted/Programming/celix/libs/utils/src/array_list.c:365 (libcelix_utils.so.2+0xa0f6)
       #2 celix_arrayList_create /home/oipo-unencrypted/Programming/celix/libs/utils/src/array_list.c:361 (libcelix_utils.so.2+0xa0b8)
       #3 celix_private_dependencyManager_create /home/oipo-unencrypted/Programming/celix/libs/framework/src/dm_dependency_manager_impl.c:36 (libcelix_framework.so.2+0x485fe)
       #4 celix_bundleContext_getDependencyManager /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle_context.c:515 (libcelix_framework.so.2+0x20126)
       #5 fw_stopBundle /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1057 (libcelix_framework.so.2+0x28427)
       #6 framework_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:611 (libcelix_framework.so.2+0x26512)
       #7 bundle_stopWithOptions /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:307 (libcelix_framework.so.2+0x18608)
       #8 bundle_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:297 (libcelix_framework.so.2+0x18557)
       #9 celixLauncher_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:192 (libcelix_framework.so.2+0x47fbf)
       #10 shutdown_framework /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:132 (libcelix_framework.so.2+0x47d56)
       #11 shellSigHandler /home/oipo-unencrypted/Programming/celix/bundles/shell/shell_tui/private/src/shell_tui.c:159 (libshell_tui.so.1+0x3272)
       #12 <null> <null> (libtsan.so.0+0x2a226)
       #13 celixThreadCondition_wait /home/oipo-unencrypted/Programming/celix/libs/utils/src/celix_threads.c:156 (libcelix_utils.so.2+0x104b0)
       #14 framework_waitForStop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1771 (libcelix_framework.so.2+0x2ace8)
       #15 celixLauncher_waitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:178 (libcelix_framework.so.2+0x47f14)
       #16 celixLauncher_launchAndWaitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:116 (libcelix_framework.so.2+0x47c4d)
       #17 main /home/oipo-unencrypted/Programming/celix/build/celix/gen/containers/pubsub_zmq/main.c:16 (pubsub_zmq+0x1218)
   
   SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal (/lib/x86_64-linux-gnu/libtsan.so.0+0x2cdbd) in calloc
   ==================
   ```
   
   ```
   ==================
   WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=52772)
       #0 free <null> (libtsan.so.0+0x2cf6b)
       #1 fw_stopBundle /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1096 (libcelix_framework.so.2+0x2870c)
       #2 framework_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:611 (libcelix_framework.so.2+0x26512)
       #3 bundle_stopWithOptions /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:307 (libcelix_framework.so.2+0x18608)
       #4 bundle_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:297 (libcelix_framework.so.2+0x18557)
       #5 celixLauncher_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:192 (libcelix_framework.so.2+0x47fbf)
       #6 shutdown_framework /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:132 (libcelix_framework.so.2+0x47d56)
       #7 shellSigHandler /home/oipo-unencrypted/Programming/celix/bundles/shell/shell_tui/private/src/shell_tui.c:159 (libshell_tui.so.1+0x3272)
       #8 <null> <null> (libtsan.so.0+0x2a226)
       #9 celixThreadCondition_wait /home/oipo-unencrypted/Programming/celix/libs/utils/src/celix_threads.c:156 (libcelix_utils.so.2+0x104b0)
       #10 framework_waitForStop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1771 (libcelix_framework.so.2+0x2ace8)
       #11 celixLauncher_waitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:178 (libcelix_framework.so.2+0x47f14)
       #12 celixLauncher_launchAndWaitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:116 (libcelix_framework.so.2+0x47c4d)
       #13 main /home/oipo-unencrypted/Programming/celix/build/celix/gen/containers/pubsub_zmq/main.c:16 (pubsub_zmq+0x1218)
   
   SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal (/lib/x86_64-linux-gnu/libtsan.so.0+0x2cf6b) in free
   ==================
   ```
   
   ```
   ==================
   WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=52772)
       #0 calloc <null> (libtsan.so.0+0x2cdbd)
       #1 fw_fireBundleEvent /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1867 (libcelix_framework.so.2+0x2b253)
       #2 fw_stopBundle /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1113 (libcelix_framework.so.2+0x288e2)
       #3 framework_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:611 (libcelix_framework.so.2+0x26512)
       #4 bundle_stopWithOptions /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:307 (libcelix_framework.so.2+0x18608)
       #5 bundle_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/bundle.c:297 (libcelix_framework.so.2+0x18557)
       #6 celixLauncher_stop /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:192 (libcelix_framework.so.2+0x47fbf)
       #7 shutdown_framework /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:132 (libcelix_framework.so.2+0x47d56)
       #8 shellSigHandler /home/oipo-unencrypted/Programming/celix/bundles/shell/shell_tui/private/src/shell_tui.c:159 (libshell_tui.so.1+0x3272)
       #9 <null> <null> (libtsan.so.0+0x2a226)
       #10 celixThreadCondition_wait /home/oipo-unencrypted/Programming/celix/libs/utils/src/celix_threads.c:156 (libcelix_utils.so.2+0x104b0)
       #11 framework_waitForStop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1771 (libcelix_framework.so.2+0x2ace8)
       #12 celixLauncher_waitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:178 (libcelix_framework.so.2+0x47f14)
       #13 celixLauncher_launchAndWaitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:116 (libcelix_framework.so.2+0x47c4d)
       #14 main /home/oipo-unencrypted/Programming/celix/build/celix/gen/containers/pubsub_zmq/main.c:16 (pubsub_zmq+0x1218)
   
   SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal (/lib/x86_64-linux-gnu/libtsan.so.0+0x2cdbd) in calloc
   ==================
   ```
   
   ```
   ==================
   WARNING: ThreadSanitizer: signal handler spoils errno (pid=52772)
       #0 shellSigHandler /home/oipo-unencrypted/Programming/celix/bundles/shell/shell_tui/private/src/shell_tui.c:156 (libshell_tui.so.1+0x320e)
       #1 celixThreadCondition_wait /home/oipo-unencrypted/Programming/celix/libs/utils/src/celix_threads.c:156 (libcelix_utils.so.2+0x104b0)
       #2 framework_waitForStop /home/oipo-unencrypted/Programming/celix/libs/framework/src/framework.c:1771 (libcelix_framework.so.2+0x2ace8)
       #3 celixLauncher_waitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:178 (libcelix_framework.so.2+0x47f14)
       #4 celixLauncher_launchAndWaitForShutdown /home/oipo-unencrypted/Programming/celix/libs/framework/src/celix_launcher.c:116 (libcelix_framework.so.2+0x47c4d)
       #5 main /home/oipo-unencrypted/Programming/celix/build/celix/gen/containers/pubsub_zmq/main.c:16 (pubsub_zmq+0x1218)
   
   SUMMARY: ThreadSanitizer: signal handler spoils errno /home/oipo-unencrypted/Programming/celix/bundles/shell/shell_tui/private/src/shell_tui.c:156 in shellSigHandler
   ==================
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org