[Bug 895] New: boost::split might not work as expected

http://bugs.orocos.org/show_bug.cgi?id=895

Summary: boost::split might not work as expected
Product: OCL
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P3
Component: TaskBrowser
AssignedTo: orocos-dev [..] ...
ReportedBy: meyer [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Created attachment 729
--> http://bugs.orocos.org/attachment.cgi?id=729
check if result is empty after boost::split

There seems to be a bug or "undocumented feature" in Boost 1.44 that lets
boost::split return an empty vector if the input string is empty:
https://svn.boost.org/trac/boost/ticket/4751

This could lead to problems in the TaskBrowser and other OCL components, that
use boost::split to parse commands or names of task objects and do not check
for emptiness. At least in the TaskBrowser the stringToService method gets
called with an empty argument when an empty command is entered. I don't know
exactly if this is related, but some time ago I chased some segfaults where the
backtraces showed that they had something to do with boost::split.

I attached a patch that adds an check after each occurrence of boost::split in
OCL.

[Bug 895] boost::split might not work as expected

http://bugs.orocos.org/show_bug.cgi?id=895

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

What |Removed |Added
----------------------------------------------------------------------------
Component|TaskBrowser |OCL
Version|unspecified |2.5.0
Product|OCL |Toolchain
Target Milestone|--- |next-bugfix

[Bug 895] boost::split might not work as expected

http://bugs.orocos.org/show_bug.cgi?id=895

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

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

--- Comment #1 from Peter Soetens <peter [..] ...> 2011-10-21 16:03:25 CEST ---
(In reply to comment #0)
> Created attachment 729 [details]
> check if result is empty after boost::split
>
> There seems to be a bug or "undocumented feature" in Boost 1.44 that lets
> boost::split return an empty vector if the input string is empty:
> https://svn.boost.org/trac/boost/ticket/4751
>
> This could lead to problems in the TaskBrowser and other OCL components, that
> use boost::split to parse commands or names of task objects and do not check
> for emptiness. At least in the TaskBrowser the stringToService method gets
> called with an empty argument when an empty command is entered. I don't know
> exactly if this is related, but some time ago I chased some segfaults where the
> backtraces showed that they had something to do with boost::split.
>
> I attached a patch that adds an check after each occurrence of boost::split in
> OCL.

Thanks for taking care of this ! Applied on toolchain-2.5.

Peter