OCL1.10.0 build warning + readline functionality

I work on Fedora 11 x86_64 and installed the OCL1.10.0 library with gcc 4.4.1 (Red Hat 4.4.1-2). Building results in the following repeating warning:

                 "In file included from /home/steven/Orocos/include/rtt/os/fosi.h:42,                                    
                 from /home/steven/Orocos/include/rtt/os/MutexLock.hpp:41,                             
                 from /home/steven/Orocos/include/rtt/DataObjectInterfaces.hpp:42,                     
                 from /home/steven/Orocos/include/rtt/AttributeRepository.hpp:46,                      
                 from /home/steven/Orocos/include/rtt/TaskContext.hpp:42,                              
                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ReportingComponent.hpp:38,       
                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.hpp:4,          
                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.cpp:2:          
                 /home/steven/Orocos/include/rtt/os/gnulinux/fosi.h:37:1: warning: "_XOPEN_SOURCE" redefined            
                 In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../include/c++/4.4.1/x86_64-redhat-linux/bits/os_defines.h:39,                                                                          
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../include/c++/4.4.1/x86_64-redhat-linux/bits/c++config.h:1687,                                                                         
                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.1/../../../../include/c++/4.4.1/utility:61, 
                 from /usr/include/boost/config/no_tr1/utility.hpp:21,                                 
                 from /usr/include/boost/config/select_stdlib_config.hpp:20,                           
                 from /usr/include/boost/config.hpp:40,                                                
                 from /usr/include/boost/tuple/tuple.hpp:23,                                           
                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ReportingComponent.hpp:32,       
                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.hpp:4,          
                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.cpp:2:          
                 /usr/include/features.h:160:1: warning: this is the location of the previous definit"
Also, without installing and building the readline library (completion doesn't work offcourse), but there is a loss of functionality in the deployer component. I can view peers and get there properties, but cannot switch to them with the cd command. Installing the readline library fixed this functionality issue.

Any ideas to solve these issues?

regards,

Steven Bellens

ThierryBultel's picture

TaskBrowser: getting rid of readline

Hi all,

There are at least two major issues when using the readline library.
The first obvious one is the GPL licensing, that can be an issue with commercial products.
The second one is the segmentation fault bug, already reported, that happens on xenomai,
due to an incompatibility around the SIGWINCH handler.

I have a fix for both issues. It basically consists in using the libedit instead of
the libreadline. The libedit is a non-GPL (BSD) fork of the libreadline, and is
pretty well compliant to the former (same API).
It also uses signals, but for the most common needs, I have not seen any reason
to use them. It is possible to disable the signals usage in the library by setting
the rl_catch_signals to 0, before calling readline.

The only remaining issue is that the persistent history cannot work at the moment.
Namely the libedit sets signals handler when invoking read_history :0(

Commenting out the read_history is enough, but there might be some hacking into
the libedit itself, to suppress that side-effect.

So what basically currently works is completion, and session history, not persistent to a file.

I am planning to post a candidate patch for OCL soon (still have some little cleanup to do)
If someone is already aware of such a patch, please tell me,
it will save me some time !

Else keep an eye on my posts, the patch should arrive soon.

Thierry

ThierryBultel's picture

TaskBrowser: getting rid of readline

Hi all,

There are at least two major issues when using the readline library. The first obvious one is the GPL licensing, that can be an issue with commercial products. The second one is the segmentation fault bug, already reported, that happens on xenomai, due to an incompatibility around the SIGWINCH handler.

I have a fix for both issues. It basically consists in using the libedit instead of the libreadline. The libedit is a non-GPL (BSD) fork of the libreadline, and is pretty well compliant to the former (same API). It also uses signals, but for the most common needs, I have not seen any reason to use them. It is possible to disable the signals usage in the library by setting the rl_catch_signals to 0, before calling readline.

The only remaining issue is that the persistent history cannot work at the moment. Namely the libedit sets signals handler when invoking read_history :0(

Commenting out the read_history is enough, but there might be some hacking into the libedit itself, to suppress that side-effect.

So what basically currently works is completion, and session history, not persistent to a file.

I am planning to post a candidate patch for OCL soon (still have some little cleanup to do) If someone is already aware of such a patch, please tell me, it will save me some time !

Else keep an eye on my posts, the patch should arrive soon.

Thierry

TaskBrowser: getting rid of readline

On Thursday 03 June 2010 11:24:19 thierry [dot] bultel [..] ... wrote:
> Hi all,
>
> There are at least two major issues when using the readline library.
> The first obvious one is the GPL licensing, that can be an issue with
> commercial products. The second one is the segmentation fault bug, already
> reported, that happens on xenomai, due to an incompatibility around the
> SIGWINCH handler.

The correct fix for this case is in attachment. Did you use that version ?

>
> I have a fix for both issues. It basically consists in using the libedit
> instead of the libreadline. The libedit is a non-GPL (BSD) fork of the
> libreadline, and is pretty well compliant to the former (same API).
> It also uses signals, but for the most common needs, I have not seen any
> reason to use them. It is possible to disable the signals usage in the
> library by setting the rl_catch_signals to 0, before calling readline.

We need signals to handle console resizing (for example in an xterm). It
should not be required to disable signals in the taskbrowser.

>
> The only remaining issue is that the persistent history cannot work at the
> moment. Namely the libedit sets signals handler when invoking read_history
> :0(
>
> Commenting out the read_history is enough, but there might be some hacking
> into the libedit itself, to suppress that side-effect.
>
> So what basically currently works is completion, and session history, not
> persistent to a file.
>
> I am planning to post a candidate patch for OCL soon (still have some
> little cleanup to do) If someone is already aware of such a patch, please
> tell me,
> it will save me some time !
>
> Else keep an eye on my posts, the patch should arrive soon.

I'm all eyes !

Peter

OCL1.10.0 build warning + readline functionality

On Fri, Oct 2, 2009 at 15:54, Steven Bellens
<steven [dot] bellens [..] ...> wrote:
> 2009/10/2 Peter Soetens <Peter [dot] Soetens [..] ...>
>>
>> On Tue, Sep 29, 2009 at 17:36,  <steven [dot] bellens [..] ...>
>> wrote:
>> > I work on Fedora 11 x86_64 and installed the OCL1.10.0 library with gcc
>> > 4.4.1 (Red Hat 4.4.1-2). Building results in the following repeating
>> > warning:
>> >
>> >                 "In file included from
>> > /home/steven/Orocos/include/rtt/os/fosi.h:42,
>> >                 from
>> > /home/steven/Orocos/include/rtt/os/MutexLock.hpp:41,
>> >                 from
>> > /home/steven/Orocos/include/rtt/DataObjectInterfaces.hpp:42,
>> >                 from
>> > /home/steven/Orocos/include/rtt/AttributeRepository.hpp:46,
>> >                 from /home/steven/Orocos/include/rtt/TaskContext.hpp:42,
>> >                 from
>> > /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ReportingComponent.hpp:38,
>> >                 from
>> > /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.hpp:4,
>> >                 from
>> > /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.cpp:2:
>> >                 /home/steven/Orocos/include/rtt/os/gnulinux/fosi.h:37:1:
>> > warning: "_XOPEN_SOURCE" redefined
>>
>> We'll need to guard that define.
>>
>> >
>> > Also, without installing and building the readline library (completion
>> > doesn't work offcourse), but there is a loss of functionality in the
>> > deployer component. I can view peers and get there properties, but cannot
>> > switch to them with the cd command. Installing the readline library fixed
>> > this functionality issue.
>>
>> What happens when you type cd ? Any error message/crash/ ?
>
> The deployer just tells me there is no such peer, no crash.

An obvious mistake in reading the line caused this:

diff --git a/taskbrowser/TaskBrowser.cpp b/taskbrowser/TaskBrowser.cpp
index d5a01f4..87c2743 100644
--- a/taskbrowser/TaskBrowser.cpp
+++ b/taskbrowser/TaskBrowser.cpp
@@ -652,7 +652,7 @@ namespace OCL
#else
std::string command;
cout << prompt;
- cin >> command;
+ getline(cin,command);
#endif
str_trim( command, ' ');
::signal( SIGINT, SIG_DFL ); // do not catch ctrl_c

Thanks for reporting..

Peter

OCL1.10.0 build warning + readline functionality

On Tue, Sep 29, 2009 at 17:36, <steven [dot] bellens [..] ...> wrote:
> I work on Fedora 11 x86_64 and installed the OCL1.10.0 library with gcc 4.4.1 (Red Hat 4.4.1-2). Building results in the following repeating warning:
>
>                 "In file included from /home/steven/Orocos/include/rtt/os/fosi.h:42,
>                 from /home/steven/Orocos/include/rtt/os/MutexLock.hpp:41,
>                 from /home/steven/Orocos/include/rtt/DataObjectInterfaces.hpp:42,
>                 from /home/steven/Orocos/include/rtt/AttributeRepository.hpp:46,
>                 from /home/steven/Orocos/include/rtt/TaskContext.hpp:42,
>                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ReportingComponent.hpp:38,
>                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.hpp:4,
>                 from /home/steven/Orocos/orocos-ocl-1.10.0/reporting/ConsoleReporting.cpp:2:
>                 /home/steven/Orocos/include/rtt/os/gnulinux/fosi.h:37:1: warning: "_XOPEN_SOURCE" redefined

We'll need to guard that define.

>
> Also, without installing and building the readline library (completion doesn't work offcourse), but there is a loss of functionality in the deployer component. I can view peers and get there properties, but cannot switch to them with the cd command. Installing the readline library fixed this functionality issue.

What happens when you type cd ? Any error message/crash/ ?

Peter