Calling unadvertised service causes segmentation fault
furushchev opened this issue · 5 comments
furushchev commented
Calling a service for wrong or unadvertised name causes segmentation fault rather than an error or nil.
1.irteusgl$ ros::roseus "AA"
t
2.irteusgl$ call-empty-service "dummy"
;; Segmentation Fault.
;; in (ros::service-call srvname (instance std_srvs::emptyrequest :init))
;; You are still in a signal handler.
;;Try reset or throw to upper level as soon as possible.
;; code=-470915024 x=e3ee6700 addr=7ffce3ee7160
Fatal:
ban-masa commented
Is this problem already fixed?
furushchev commented
Maybe no.
At this moment, we can avoid by checking the service is actually advertised.
(setq srv-name "service")
(setq req ...) ;; request
(setq res nil)
(if (ros::wait-for-service srv-name 1)
(setq res (ros::service-call srv-name req)
(ros::ros-error "~A not advertised" srv-name))
ban-masa commented
Thank you.
Temporarily, I deal with it by changing ROSEUS_SEVICE_CALL in roseus.cpp so that it checks existence of the service.
if (!service::exists(service, true)) {
ROS_ERROR("service %s doesn't exist ",
ros::names::resolve(service).c_str());
if (persist) {
// cleanup service_cache
service_cache.erase(service_cache.find(service));
}
return (response._message);
}
k-okada commented
please send pull request when you changed the code. or first create test
code and then send fixed code.
--
◉ Kei Okada
2018年12月6日(木) 15:55 Bando Masahiro <notifications@github.com>:
… Thank you.
Temporally, I deal with it by changing ROSEUS_SEVICE_CALL in roseus.cpp so
that it checks existence of the service.
if (!service::exists(service, true)) {
ROS_ERROR("service %s doesn't exist ",
ros::names::resolve(service).c_str());
if (persist) {
// cleanup service_cache
service_cache.erase(service_cache.find(service));
}
return (response._message);
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#575 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAeG3KS3Sf0IdY_JViydHNwgzHeh8Ubwks5u2L9KgaJpZM4WChHe>
.