[ros-users] rosconsole segfault in xenomai-linked applicatio…

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ backtrace (application/octet-stream)
+ test.cpp (text/x-c++src)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: ros-users
Subject: [ros-users] rosconsole segfault in xenomai-linked application
Hello list,

I stumbled upon a nasty situation, and would like describe it here to see if
someone can shed some light on it.

We have a minimal test where we perform some rosconsole logs. One of these
comes from a xenomai-scheduled thread (but does not use the rt-scheduler, so
it's OK to make system calls). The thing is that rosconsole log messages in
this thread always causes a segfault. A gdb backtrace is attached to this
post (file 'backtrace'). The first thing I'd like to clear is: When calling
ros::console::print(FilterBase *, ...), is it OK if the FilterBase * pointer
is null? (maybe it means use no filter?). Otherwise has anyone stumbled upon
a similar situation?. In the meantime, we're trying to rule out
misconfigurations of the xenomai environment.

For those interested in inspecting the code of the minimal example, which
uses orocos-rtt as well, I've attached the file 'test.cpp'.

Setup details:
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
ros cturtle from ubuntu packages 1.2.1-36~lucid
orocos-rtt 1.8.5
xenomai 2.4.10 on a 2.6.34 kernel

TIA,

Adolfo

P.S. A similar post has also been submitted to the orocos-dev mailing list.


--
Adolfo Rodríguez Tsouroukdissian, Ph. D.

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
contener información privilegiada y/o confidencial que está dirigida
exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
destinatario indicado, o el empleado encargado de su entrega a dicha
persona, por favor, notifíquelo inmediatamente y remita el mensaje original
a la dirección de correo electrónico indicada. Cualquier copia, uso o
distribución no autorizados de esta comunicación queda estrictamente
prohibida.

CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
contain confidential information which is privileged and intended only for
the individual or entity to whom they are addressed. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution or use of this e-mail and/or accompanying document(s) is
strictly prohibited. If you have received this e-mail in error, please
immediately notify the sender at the above e-mail address.
#include <rtt/os/main.h>
#include <rtt/TaskContext.hpp>
#include <rtt/PeriodicActivity.hpp>
#include <ros/console.h>

class Dummy : public RTT::TaskContext
{
public:
Dummy(const std::string& name) : RTT::TaskContext(name) {}
virtual ~Dummy() {}

protected:
  virtual bool configureHook() {ROS_INFO("configureHook"); return true;} // Executed from main thread. No problem
  virtual bool startHook()     {ROS_WARN("startHook"); return true;}     // Executed from main thread. No problem
  virtual void stopHook()      {ROS_ERROR("stopHook");}                  // Executed from main thread. No problem
  virtual void updateHook()    {ROS_ERROR("updateHook");}                // Executed from xenomai-scheduled thread. Segfault!
};


int ORO_main( int argc, char** argv )
{
Dummy dummy("dummy");
dummy.setActivity( new RTT::PeriodicActivity( ORO_SCHED_OTHER, 10, 0.1));
dummy.configure();
dummy.start(); // updateHook() will be called upon completion of start(), and the segfault occurs
sleep(1);
dummy.stop();

return 0;
}