You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by "PengZheng (via GitHub)" <gi...@apache.org> on 2023/09/24 03:23:59 UTC
[I] test_cxx_remote_services_integration crash (celix)
PengZheng opened a new issue, #653:
URL: https://github.com/apache/celix/issues/653
```
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTING=ON ..
make -j8
ctest
The following tests FAILED:
49 - test_cxx_remote_services_integration (SEGFAULT)
```
```
std::default_delete::operator() unique_ptr.h:79
std::_Sp_counted_deleter::_M_dispose shared_ptr_base.h:442
std::_Sp_counted_base::_M_release shared_ptr_base.h:168
std::__shared_count::~__shared_count shared_ptr_base.h:705
std::__shared_ptr::~__shared_ptr shared_ptr_base.h:1154
std::shared_ptr::~shared_ptr shared_ptr.h:122
celix::rsa::RemoteServiceAdmin::removeEndpoint RemoteServiceAdmin.cc:81
std::function::operator()(const std::shared_ptr<…> &, const std::shared_ptr<…> &) const std_function.h:590
<lambda#3>::operator()(void *, void *, const hashMap *) const ServiceDependency_Impl.h:581
<lambda#3>::_FUN(void *, void *, const hashMap *) ServiceDependency_Impl.h:569
celix_dmServiceDependency_invokeRemove dm_service_dependency.c:321
celix_dmComponent_handleRemove dm_component_impl.c:669
celix_private_dmComponent_handleEvent dm_component_impl.c:538
serviceDependency_removeServiceTrackerCallback dm_service_dependency.c:313
serviceTracker_invokeRemovingService service_tracker.c:597
serviceTracker_untrackTracked service_tracker.c:560
serviceTracker_close service_tracker.c:231
celix_serviceTracker_destroy service_tracker.c:712
celix_bundleContext_removeServiceTracker bundle_context.c:789
fw_handleEventRequest framework.c:1297
fw_handleEvents framework.c:1342
fw_eventDispatcher framework.c:1509
start_thread 0x00007ffff7494b43
clone3 0x00007ffff7526a00
```
--
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
Re: [I] test_cxx_remote_services_integration crash (celix)
Posted by "PengZheng (via GitHub)" <gi...@apache.org>.
PengZheng commented on issue #653:
URL: https://github.com/apache/celix/issues/653#issuecomment-1732531619
It has been bisected to be introduced by 6bb8de50.
But as the commit log said, `celix_framework_stopBundleEntry` is unnecessary, since `celix_framework_uninstallBundleEntry` will stop the bundle first. It seems more like a testing issue. @pnoltes
--
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
Re: [I] test_cxx_remote_services_integration crash (celix)
Posted by "PengZheng (via GitHub)" <gi...@apache.org>.
PengZheng commented on issue #653:
URL: https://github.com/apache/celix/issues/653#issuecomment-1732533364
I've verified that adding `celix_framework_stopBundleEntry` back will "fix" the problem.
```C
size = celix_arrayList_size(stopEntries);
for (int i = size-1; i >= 0; --i) { //note loop in reverse order -> stop later installed bundle first
celix_framework_bundle_entry_t *entry = celix_arrayList_get(stopEntries, i);
//NOTE possible starvation.
// fw_bundleEntry_waitTillUseCountIs(entry, 1); //note this function has 1 use count.
//note race between condition (use count == 1) and bundle stop, meaning use count can be > 1 when
//celix_framework_stopBundleEntry is called.
bundle_state_e state = celix_bundle_getState(entry->bnd);
if (state == CELIX_BUNDLE_STATE_ACTIVE || state == CELIX_BUNDLE_STATE_STARTING) {
celix_framework_stopBundleEntry(fw, entry);
}
}
for (int i = size-1; i >= 0; --i) { //note loop in reverse order -> uninstall later installed bundle first
celix_framework_bundle_entry_t *entry = celix_arrayList_get(stopEntries, i);
celix_framework_uninstallBundleEntry(fw, entry, false);
}
celix_arrayList_destroy(stopEntries);
```
--
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
Re: [I] test_cxx_remote_services_integration crash (celix)
Posted by "PengZheng (via GitHub)" <gi...@apache.org>.
PengZheng commented on issue #653:
URL: https://github.com/apache/celix/issues/653#issuecomment-1732798823
Currently, `IImportRegistration` can not tell which `IImportServiceFactory` it comes from.
Otherwise, we can remove it from `RemoteServiceAdmin` when the factory is stopped.
--
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
Re: [I] test_cxx_remote_services_integration crash (celix)
Posted by "PengZheng (via GitHub)" <gi...@apache.org>.
PengZheng commented on issue #653:
URL: https://github.com/apache/celix/issues/653#issuecomment-1732557407
I suspect this is a lifecycle management bug of `TestExportImportRemoteServiceFactory`.
Note that `ComponentImportRegistration` produced by `CalculatorImportServiceFactory::importService` is NOT managed by `CalculatorImportServiceFactory`. That means if `TestExportImportRemoteServiceFactory` bundle is uninstalled, `RemoteServiceAdmin` will keep references of `ComponentImportRegistration`, whose destructor is not in address space anymore.
This shows that any object passing through Celix service should be managed by the object owner bundle some way.
WDYT? @pnoltes @rlenferink
--
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