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 2022/04/13 14:15:07 UTC

[GitHub] [celix] xuzhenbao opened a new issue, #415: Read manager->exportedServices during write

xuzhenbao opened a new issue, #415:
URL: https://github.com/apache/celix/issues/415

   https://github.com/apache/celix/blob/master/bundles/remote_services/topology_manager/src/topology_manager.c#L693-L724
   
   In the code aboveļ¼Œduring read manager->exportedServices, it does not lock  exportedServicesLock. It may cause some problem. The following stack information is  produced by GDB suspension specific breakpoints.
   
   ~~~"bash"
   ==87715==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x7ffff67013d5 bp 0x7fffe93b91c0 sp 0x7fffe93b91b0 T21)
   ==87715==The signal is caused by a READ memory access.
   ==87715==Hint: address points to the zero page.
       #0 0x7ffff67013d4 in hashMapIterator_init /home/xuzhenbao/code/celix/libs/utils/src/hash_map.c:371
       #1 0x7ffff6701199 in hashMapIterator_create /home/xuzhenbao/code/celix/libs/utils/src/hash_map.c:358
       #2 0x7fffe57962a2 in topologyManager_endpointListenerAdded /home/xuzhenbao/code/celix/bundles/remote_services/topology_manager/src/topology_manager.c:697
       #3 0x7ffff6bd45aa in serviceTracker_invokeAddService /home/xuzhenbao/code/celix/libs/framework/src/service_tracker.c:479
       #4 0x7ffff6bd3f64 in serviceTracker_track /home/xuzhenbao/code/celix/libs/framework/src/service_tracker.c:424
       #5 0x7ffff6bd36d3 in serviceTracker_serviceChanged /home/xuzhenbao/code/celix/libs/framework/src/service_tracker.c:348
       #6 0x7ffff6bd0f30 in celix_serviceRegistry_serviceChanged /home/xuzhenbao/code/celix/libs/framework/src/service_registry.c:1131
       #7 0x7ffff6bcabfc in serviceRegistry_registerServiceInternal /home/xuzhenbao/code/celix/libs/framework/src/service_registry.c:234
       #8 0x7ffff6bca545 in serviceRegistry_registerService /home/xuzhenbao/code/celix/libs/framework/src/service_registry.c:185
       #9 0x7ffff6bac830 in fw_registerService /home/xuzhenbao/code/celix/libs/framework/src/framework.c:934
       #10 0x7ffff6b97ede in bundleContext_registerService /home/xuzhenbao/code/celix/libs/framework/src/bundle_context.c:182
       #11 0x7fffebca7aac in bundleActivator_start /home/xuzhenbao/code/celix/bundles/remote_services/discovery_common/src/discovery_activator.c:136
       #12 0x7ffff6bb8772 in celix_framework_startBundleEntry /home/xuzhenbao/code/celix/libs/framework/src/framework.c:2571
       #13 0x7ffff6bec898 in celix_framework_stopStartBundleThread /home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:33
       #14 0x7ffff5a1c6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
       #15 0x7ffff574561e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x12161e)
   
   AddressSanitizer can not provide additional info.
   SUMMARY: AddressSanitizer: SEGV /home/xuzhenbao/code/celix/libs/utils/src/hash_map.c:371 in hashMapIterator_init
   Thread T21 created by T17 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 0x7ffff6bed162 in celix_framework_startBundleOnANonCelixEventThread /home/xuzhenbao/code/celix/libs/framework/src/framework_bundle_lifecycle_handler.c:105
       #4 0x7ffff6bb7a73 in celix_framework_startBundleInternal /home/xuzhenbao/code/celix/libs/framework/src/framework.c:2455
       #5 0x7ffff6bb7af7 in celix_framework_startBundleAsync /home/xuzhenbao/code/celix/libs/framework/src/framework.c:2469
       #6 0x7fffe1aff333 in startCommand_execute /home/xuzhenbao/code/celix/bundles/shell/shell/src/start_command.c:50
       #7 0x7fffe1afb9a8 in shell_executeCommand /home/xuzhenbao/code/celix/bundles/shell/shell/src/c_shell.c:276
       #8 0x7fffe18ecaea in shellTui_parseInputPlain /home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:283
       #9 0x7fffe18ec8b1 in shellTui_parseInput /home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:265
       #10 0x7fffe18ec562 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 T17 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 0x7fffe18eb920 in shellTui_start /home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/shell_tui.c:127
       #3 0x7fffe18eb131 in celix_shellTuiActivator_start /home/xuzhenbao/code/celix/bundles/shell/shell_tui/src/activator.c:83
       #4 0x7fffe18eb39a 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/main.c:19
       #17 0x7ffff5645c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
   
   ==87715==ABORTING
   ~~~


-- 
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-unsubscribe@celix.apache.org.apache.org

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


[GitHub] [celix] xuzhenbao commented on issue #415: Read manager->exportedServices during write

Posted by GitBox <gi...@apache.org>.
xuzhenbao commented on issue #415:
URL: https://github.com/apache/celix/issues/415#issuecomment-1098124949

   Here is the thread information for my local debugging.
   
   ~~~"bash"
   Thread #24 [serverd] 88371 [core: 0] (Suspended : Breakpoint)	
   	topologyManager_endpointListenerAdded() at topology_manager.c:695 0x7fffe5796279	
   	serviceTracker_invokeAddService() at service_tracker.c:479 0x7ffff6bd45ab	
   	serviceTracker_track() at service_tracker.c:424 0x7ffff6bd3f65	
   	serviceTracker_serviceChanged() at service_tracker.c:348 0x7ffff6bd36d4	
   	celix_serviceRegistry_serviceChanged() at service_registry.c:1,131 0x7ffff6bd0f31	
   	serviceRegistry_registerServiceInternal() at service_registry.c:234 0x7ffff6bcabfd	
   	serviceRegistry_registerService() at service_registry.c:185 0x7ffff6bca546	
   	fw_registerService() at framework.c:934 0x7ffff6bac831	
   	bundleContext_registerService() at bundle_context.c:182 0x7ffff6b97edf	
   	bundleActivator_start() at discovery_activator.c:136 0x7fffebca7aad	
   	<...more frames...>	
   
   Thread #35 [serverd] 88391 [core: 0] (Suspended : Breakpoint)	
   	topologyManager_rsaRemoved() at topology_manager.c:293 0x7fffe5793c86	
   	serviceTracker_invokeRemovingService() at service_tracker.c:589 0x7ffff6bd54e2	
   	serviceTracker_untrackTracked() at service_tracker.c:560 0x7ffff6bd51c2	
   	serviceTracker_close() at service_tracker.c:232 0x7ffff6bd29e1	
   	bundleActivator_stop() at activator.c:222 0x7fffe579a92f	
   	celix_framework_stopBundleEntry() at framework.c:2,382 0x7ffff6bb6ffb	
   	celix_framework_stopStartBundleThread() at framework_bundle_lifecycle_handler.c:36 0x7ffff6bec90f	
   	start_thread() at pthread_create.c:463 0x7ffff5a1c6db	
   	clone() at clone.S:95 0x7ffff574561f	
   ~~~


-- 
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-unsubscribe@celix.apache.org

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


[GitHub] [celix] PengZheng closed issue #415: Read manager->exportedServices during write

Posted by GitBox <gi...@apache.org>.
PengZheng closed issue #415: Read manager->exportedServices during write
URL: https://github.com/apache/celix/issues/415


-- 
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-unsubscribe@celix.apache.org

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