[Bug 753] New: Uncaught exception when EOF (Ctrl-D) entered

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=753

Summary: Uncaught exception when EOF (Ctrl-D) entered
Product: OCL
Version: 1.10.1
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: TaskBrowser
AssignedTo: orocos-dev [..] ...
ReportedBy: alexis [..] ...
CC: orocos-dev [..] ..., alexis [..] ...
Estimated Hours: 0.0

Entering EOF (Ctrl-D) causes the task browser to crash with:

Orocos has detected an uncaught C++ exception
in the ORO_main() function.
You might have called a function which throws
without a try {} catch {} block.

Please consider applying something equivalent to the following short patch
which converts EOF to "quit":

--- orocos-ocl-1.10.1/taskbrowser/TaskBrowser.orig.cpp
+++ orocos-ocl-1.10.1/taskbrowser/TaskBrowser.cpp
@@ -648,7 +648,9 @@
// Call readline wrapper :
::signal( SIGINT, ctrl_c_catcher ); // catch ctrl_c only when
editting a line.
#ifndef NO_GPL
- std::string command( rl_gets() ); // copy over to string
+ const char* const commandStr = rl_gets();
+ // quit on EOF (Ctrl-D)
+ std::string command( commandStr ? commandStr : "quit" ); //
copy over to string
#else
std::string command;
cout << prompt;

[Bug 753] Uncaught exception when EOF (Ctrl-D) entered

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=753

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC|alexis [..] ... |
Resolution| |FIXED
Status|NEW |RESOLVED

--- Comment #1 from Peter Soetens <peter [..] ...> 2010-02-22 11:59:44 ---
(In reply to comment #0)
> Entering EOF (Ctrl-D) causes the task browser to crash with:
>
> Orocos has detected an uncaught C++ exception
> in the ORO_main() function.
> You might have called a function which throws
> without a try {} catch {} block.
>
> Please consider applying something equivalent to the following short patch which
> converts EOF to "quit":
>
> --- orocos-ocl-1.10.1/taskbrowser/TaskBrowser.orig.cpp
> +++ orocos-ocl-1.10.1/taskbrowser/TaskBrowser.cpp
> @@ -648,7 +648,9 @@
> // Call readline wrapper :
> ::signal( SIGINT, ctrl_c_catcher ); // catch ctrl_c only when
> editting a line.
> #ifndef NO_GPL
> - std::string command( rl_gets() ); // copy over to string
> + const char* const commandStr = rl_gets();
> + // quit on EOF (Ctrl-D)
> + std::string command( commandStr ? commandStr : "quit" ); //
> copy over to string
> #else
> std::string command;
> cout << prompt;

Thanks for the patch. Applied on ocl trunk, ocl-1.10 and 2.0-mainline.

Peter