xuzhenbao opened a new pull request, #414:
URL: https://github.com/apache/celix/pull/414

   If during topologyManager_addImportedService or 
topologyManager_addExportedService, topologyManager_rsaRemoved happened. It may 
cause an invalid RSA to be added to hashmap of imoorts or exports.
   If  during topologyManager_addImportedService or 
topologyManager_addExportedService, topologyManager_rsaAdded happened.The same 
service may be imported or exported twice.
   
   The following is the stack information when the problem occurs.
   ~~~"bash"
   ==18087==ERROR: AddressSanitizer: heap-use-after-free on address 
0x60e0000262a0 at pc 0x7fffebcf2333 bp 0x7fffe3edfb30 sp 0x7fffe3edfb20
   READ of size 8 at 0x60e0000262a0 thread T12
       #0 0x7fffebcf2332 in topologyManager_removeImportedService 
/home/xuzhenbao/code/celix/bundles/remote_services/topology_manager/src/topology_manager.c:532
       #1 0x7fffe71dff40 in discovery_informEndpointListeners 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/discovery.c:177
       #2 0x7fffe71e025f in discovery_removeDiscoveredEndpoint 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/discovery.c:228
       #3 0x7fffe71e4266 in endpointDiscoveryPoller_poll 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c:265
       #4 0x7fffe71e45b3 in endpointDiscoveryPoller_performPeriodicPoll 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c:312
       #5 0x7ffff5a1c6da in start_thread 
(/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
       #6 0x7ffff574561e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x12161e)
   
   0x60e0000262a0 is located 128 bytes inside of 160-byte region 
[0x60e000026220,0x60e0000262c0)
   freed by thread T11 here:
       #0 0x7ffff6ef67a8 in __interceptor_free 
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0xde7a8)
       #1 0x7fffeba95257 in celix_bundleActivator_destroy 
/home/xuzhenbao/code/celix/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_activator.c:72
       #2 0x7ffff6bb7119 in celix_framework_stopBundleEntry 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2391
       #3 0x7ffff6bec90e in celix_framework_stopStartBundleThread 
/home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:36
       #4 0x7ffff5a1c6da in start_thread 
(/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
   
   previously allocated by thread T0 here:
       #0 0x7ffff6ef6d28 in __interceptor_calloc 
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
       #1 0x7fffeba951ac in celix_bundleActivator_create 
/home/xuzhenbao/code/celix/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_activator.c:72
       #2 0x7ffff6bb867d in celix_framework_startBundleEntry 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2563
       #3 0x7ffff6bed20d in celix_framework_startBundleOnANonCelixEventThread 
/home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:113
       #4 0x7ffff6bb7a73 in celix_framework_startBundleInternal 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2455
       #5 0x7ffff6bb7acd in celix_framework_startBundle 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2465
       #6 0x7ffff6ba9f83 in framework_autoStartConfiguredBundlesForList 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:588
       #7 0x7ffff6ba99b5 in framework_autoStartConfiguredBundles 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:543
       #8 0x7ffff6ba9389 in framework_start 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:517
       #9 0x7ffff6be379f in celix_frameworkFactory_createFramework 
/home/xuzhenbao/code/celix/libs/framework/src/celix_framework_factory.c:34
       #10 0x7ffff6be2ca5 in celixLauncher_launchWithProperties 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:158
       #11 0x7ffff6be2c7d in celixLauncher_launchWithConfigAndProps 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:149
       #12 0x7ffff6be2a13 in celixLauncher_launchAndWaitForShutdown 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:105
       #13 0x555555554ad8 in main 
/home/xuzhenbao/code/celix/build/celix/gen/containers/remote-services-dfi-client/main.c:19
       #14 0x7ffff5645c86 in __libc_start_main 
(/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
   
   Thread T12 created by T0 here:
       #0 0x7ffff6e4fd2f in __interceptor_pthread_create 
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0x37d2f)
       #1 0x7ffff670548e in celixThread_create 
/home/xuzhenbao/code/celix/libs/utils/src/celix_threads.c:38
       #2 0x7fffe71e3736 in endpointDiscoveryPoller_create 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c:115
       #3 0x7fffe71dedef in discovery_start 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_configured/src/discovery_impl.c:68
       #4 0x7fffe71e096e in bundleActivator_start 
/home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/discovery_activator.c:125
       #5 0x7ffff6bb8772 in celix_framework_startBundleEntry 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2571
       #6 0x7ffff6bed20d in celix_framework_startBundleOnANonCelixEventThread 
/home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:113
       #7 0x7ffff6bb7a73 in celix_framework_startBundleInternal 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2455
       #8 0x7ffff6bb7acd in celix_framework_startBundle 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2465
       #9 0x7ffff6ba9f83 in framework_autoStartConfiguredBundlesForList 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:588
       #10 0x7ffff6ba99b5 in framework_autoStartConfiguredBundles 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:543
       #11 0x7ffff6ba9389 in framework_start 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:517
       #12 0x7ffff6be379f in celix_frameworkFactory_createFramework 
/home/xuzhenbao/code/celix/libs/framework/src/celix_framework_factory.c:34
       #13 0x7ffff6be2ca5 in celixLauncher_launchWithProperties 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:158
       #14 0x7ffff6be2c7d in celixLauncher_launchWithConfigAndProps 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:149
       #15 0x7ffff6be2a13 in celixLauncher_launchAndWaitForShutdown 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:105
       #16 0x555555554ad8 in main 
/home/xuzhenbao/code/celix/build/celix/gen/containers/remote-services-dfi-client/main.c:19
       #17 0x7ffff5645c86 in __libc_start_main 
(/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
   
   Thread T11 created by T9 here:
       #0 0x7ffff6e4fd2f in __interceptor_pthread_create 
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0x37d2f)
       #1 0x7ffff670548e in celixThread_create 
/home/xuzhenbao/code/celix/libs/utils/src/celix_threads.c:38
       #2 0x7ffff6bed0b3 in 
celix_framework_createAndStartBundleLifecycleHandler 
/home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:98
       #3 0x7ffff6bed2a5 in celix_framework_stopBundleOnANonCelixEventThread 
/home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:120
       #4 0x7ffff6bb6a83 in celix_framework_stopBundleInternal 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2317
       #5 0x7ffff6bb6b84 in celix_framework_stopBundleAsync 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2335
       #6 0x7fffe805c721 in stopCommand_execute 
/home/xuzhenbao/code/celix/bundles/shell/shell/src/stop_command.c:50
       #7 0x7fffe80589a8 in shell_executeCommand 
/home/xuzhenbao/code/celix/bundles/shell/shell/src/c_shell.c:276
       #8 0x7fffe7e49aea in shellTui_parseInputPlain 
/home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:283
       #9 0x7fffe7e498b1 in shellTui_parseInput 
/home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:265
       #10 0x7fffe7e49562 in shellTui_runnable 
/home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:233
       #11 0x7ffff5a1c6da in start_thread 
(/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
   
   Thread T9 created by T0 here:
       #0 0x7ffff6e4fd2f in __interceptor_pthread_create 
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0x37d2f)
       #1 0x7ffff670548e in celixThread_create 
/home/xuzhenbao/code/celix/libs/utils/src/celix_threads.c:38
       #2 0x7fffe7e48920 in shellTui_start 
/home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:127
       #3 0x7fffe7e48131 in celix_shellTuiActivator_start 
/home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/activator.c:83
       #4 0x7fffe7e4839a in celix_bundleActivator_start 
/home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/activator.c:101
       #5 0x7ffff6bb8772 in celix_framework_startBundleEntry 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2571
       #6 0x7ffff6bed20d in celix_framework_startBundleOnANonCelixEventThread 
/home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:113
       #7 0x7ffff6bb7a73 in celix_framework_startBundleInternal 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2455
       #8 0x7ffff6bb7acd in celix_framework_startBundle 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:2465
       #9 0x7ffff6ba9f83 in framework_autoStartConfiguredBundlesForList 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:588
       #10 0x7ffff6ba99b5 in framework_autoStartConfiguredBundles 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:543
       #11 0x7ffff6ba9389 in framework_start 
/home/xuzhenbao/code/celix/libs/framework/src/framework.c:517
       #12 0x7ffff6be379f in celix_frameworkFactory_createFramework 
/home/xuzhenbao/code/celix/libs/framework/src/celix_framework_factory.c:34
       #13 0x7ffff6be2ca5 in celixLauncher_launchWithProperties 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:158
       #14 0x7ffff6be2c7d in celixLauncher_launchWithConfigAndProps 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:149
       #15 0x7ffff6be2a13 in celixLauncher_launchAndWaitForShutdown 
/home/xuzhenbao/code/celix/libs/framework/src/celix_launcher.c:105
       #16 0x555555554ad8 in main 
/home/xuzhenbao/code/celix/build/celix/gen/containers/remote-services-dfi-client/main.c:19
       #17 0x7ffff5645c86 in __libc_start_main 
(/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
   
   SUMMARY: AddressSanitizer: heap-use-after-free 
celix/bundles/remote_services/topology_manager/src/topology_manager.c:532 in 
topologyManager_removeImportedService
   ~~~


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

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

Reply via email to