[Fawkes Git] branch/timn/skiller-fixes: created (0.5.0-3085-g5af954f)

Tim Niemueller niemueller at kbsg.rwth-aachen.de
Tue May 31 23:47:25 CEST 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, timn/skiller-fixes has been created
        at  5af954f00da96369d08f7d5ae78222abba444518 (commit)

http://git.fawkesrobotics.org/fawkes.git/timn/skiller-fixes

- *Log* ---------------------------------------------------------------
commit f653c1b5cdcd4e3012829b7ff90c1e81f8572be3
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue May 31 23:03:59 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue May 31 23:03:59 2016 +0200

    skiller: fix spurious re-execution on releasing control
    
    When exclusive control was released, a previously executed skill could
    be executed again as one internal variable was not reset.

http://git.fawkesrobotics.org/fawkes.git/commit/f653c1b
http://trac.fawkesrobotics.org/changeset/f653c1b

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit f28132bc865310b78ce0ea20bc4dc69ce9c3a07d
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue May 31 23:04:54 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue May 31 23:04:54 2016 +0200

    ros-skiller: fix potential memory leak
    
    The stop message was always created, but only sent if a writer for the
    skiller interface existed. While this is most likely the case, it could
    still sometimes result in lost memory.

http://git.fawkesrobotics.org/fawkes.git/commit/f28132b
http://trac.fawkesrobotics.org/changeset/f28132b

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 434c889532a428d8b0a04c4a31fac19a229c8aea
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue May 31 23:05:43 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue May 31 23:05:43 2016 +0200

    ros-skiller: fix access after free on exec skill message
    
    The message was created, sent, and then accessed. Only that sending
    consumes the message and cannot be accessed afterwards. Add the
    appropriate referencing of the message.

http://git.fawkesrobotics.org/fawkes.git/commit/434c889
http://trac.fawkesrobotics.org/changeset/434c889

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 5af954f00da96369d08f7d5ae78222abba444518
Author:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
AuthorDate: Tue May 31 23:06:42 2016 +0200
Commit:     Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
CommitDate: Tue May 31 23:06:42 2016 +0200

    ros-skiller: fix spurious premature skill stops
    
    The message ID of the processed skill was not checked. While this most
    of the time does not pose a problem for ros-skiller as it is run
    in-loop, in rare circumstances or when porting this code this can lead
    to skills being stopped prematurely.

http://git.fawkesrobotics.org/fawkes.git/commit/5af954f
http://trac.fawkesrobotics.org/changeset/5af954f

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/plugins/ros/skiller_thread.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* f653c1b5cdcd4e3012829b7ff90c1e81f8572be3 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue May 31 23:03:59 2016 +0200
Subject: skiller: fix spurious re-execution on releasing control

 src/plugins/skiller/exec_thread.cpp |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/skiller/exec_thread.cpp b/src/plugins/skiller/exec_thread.cpp
index 93df070..dd49ef2 100644
--- a/src/plugins/skiller/exec_thread.cpp
+++ b/src/plugins/skiller/exec_thread.cpp
@@ -500,6 +500,7 @@ SkillerExecutionThread::loop()
 			  m->sender_thread_name());
 	
 	__continuous_reset = true;
+	curss = "";
 	__last_exclusive_controller = __skiller_if->exclusive_controller();
 	__skiller_if->set_exclusive_controller(0);
 	write_skiller_if = true;

- *commit* f28132bc865310b78ce0ea20bc4dc69ce9c3a07d - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue May 31 23:04:54 2016 +0200
Subject: ros-skiller: fix potential memory leak

 src/plugins/ros/skiller_thread.cpp |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/ros/skiller_thread.cpp b/src/plugins/ros/skiller_thread.cpp
index a9999cd..8d3a135 100644
--- a/src/plugins/ros/skiller_thread.cpp
+++ b/src/plugins/ros/skiller_thread.cpp
@@ -93,9 +93,8 @@ RosSkillerThread::stop()
         return;
       }
 
-  SkillerInterface::StopExecMessage *msg =
-    new SkillerInterface::StopExecMessage();
-  if (skiller_if_->has_writer()) skiller_if_->msgq_enqueue(msg);
+  if (skiller_if_->has_writer())
+	  skiller_if_->msgq_enqueue(new SkillerInterface::StopExecMessage());
   if (exec_as_) {
     std::string error_msg = "Abort on request";
     as_goal_.setAborted(create_result(error_msg), error_msg);

- *commit* 434c889532a428d8b0a04c4a31fac19a229c8aea - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue May 31 23:05:43 2016 +0200
Subject: ros-skiller: fix access after free on exec skill message

 src/plugins/ros/skiller_thread.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/ros/skiller_thread.cpp b/src/plugins/ros/skiller_thread.cpp
index 8d3a135..e97c2fb 100644
--- a/src/plugins/ros/skiller_thread.cpp
+++ b/src/plugins/ros/skiller_thread.cpp
@@ -183,6 +183,7 @@ RosSkillerThread::loop()
 
     SkillerInterface::ExecSkillMessage *msg =
       new SkillerInterface::ExecSkillMessage(goal_.c_str());
+    msg->ref();
 
     logger->log_debug(name(), "Creating goal '%s'", goal_.c_str());
 
@@ -196,6 +197,7 @@ RosSkillerThread::loop()
       logger->log_warn(name(), "Failed to execute skill, exception follows");
       logger->log_warn(name(), e);
     }
+    msg->unref();
 
   } else if (exec_running_) {
     if (exec_as_) as_goal_.publishFeedback(create_feedback());

- *commit* 5af954f00da96369d08f7d5ae78222abba444518 - - - - - - - - - -
Author:  Tim Niemueller <niemueller at kbsg.rwth-aachen.de>
Date:    Tue May 31 23:06:42 2016 +0200
Subject: ros-skiller: fix spurious premature skill stops

 src/plugins/ros/skiller_thread.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/ros/skiller_thread.cpp b/src/plugins/ros/skiller_thread.cpp
index e97c2fb..dc3ab94 100644
--- a/src/plugins/ros/skiller_thread.cpp
+++ b/src/plugins/ros/skiller_thread.cpp
@@ -202,7 +202,9 @@ RosSkillerThread::loop()
   } else if (exec_running_) {
     if (exec_as_) as_goal_.publishFeedback(create_feedback());
 
-    if (skiller_if_->status() == SkillerInterface::S_INACTIVE) {
+    if (skiller_if_->status() == SkillerInterface::S_INACTIVE ||
+        skiller_if_->msgid() != exec_msgid_)
+    {
       // wait three loops, maybe the skiller will start
       logger->log_debug(name(), "Should be executing skill, but skiller is inactive");
       ++loops_waited_;




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list