Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catkin_make barfs on non-ascii characters #476

Closed
jonbinney opened this issue Jul 16, 2013 · 15 comments
Closed

catkin_make barfs on non-ascii characters #476

jonbinney opened this issue Jul 16, 2013 · 15 comments
Assignees
Labels

Comments

@jonbinney
Copy link

When running cmake causes a non-ascii character to be output to stdout, catkin_make crashes.

This problem seems to have been reintroduced with this commit:
22ce2ba

On line 171: 22ce2ba#L1L171 the default unicode encoding seems to be 'ascii', which means it will barf if cmake outputs any non-ascii characters. The resulting exception isn't caught and crashes catkin_make with an exception:

'ascii' codec can't decode byte 0xe2 in position 33: ordinal not in range(128)

The fix would be to revert that line to:

proc.stdout.readline().decode('utf8', 'replace')

so that it can handle non-ascii characters.

@jonbinney
Copy link
Author

To reproduce, create a basic catkin package in a new workspace:

catkin_create_pkg foo --rosdistro hydro

add the following line to the cmakelists:

execute_process(COMMAND printf '\\xe2')

then run catkin_make

@jonbinney
Copy link
Author

Interestingly, it works fine if you use the --no-color option. Also works fine on groovy, which is confusing since it appears that the same version of catkin is released on both groovy and hydro.

@jonbinney jonbinney reopened this Jul 17, 2013
@jonbinney
Copy link
Author

To be clear, I'm only seeing this issue on hydro

@dirk-thomas
Copy link
Member

Which versions are you using on Groovy and Hydro?

@jonbinney
Copy link
Author

ii  python-catkin-pkg                           0.1.18-1                                            catkin package library
ii  ros-groovy-catkin                           0.5.70-0precise-20130714-0827-+0000                 Low-level build system macros and infrastructure for ROS.
ii  ros-hydro-catkin                            0.5.70-0precise-20130714-0827-+0000                 Low-level build system macros and infrastructure for ROS.

@dirk-thomas
Copy link
Member

Do you have a custom catkin version in one of your workspace (groovy or hydro)?

@jonbinney
Copy link
Author

Nope. I made an empty workspace (following the instructions i posted above) and saw the same error. The only non-debian package in my workspace was foo, the one i created. In that same workspace, i've double checked that it is using the right catkin python code:

In [1]: from catkin import builder

In [2]: builder.__file__
Out[2]: '/opt/ros/hydro/lib/python2.7/dist-packages/catkin/builder.pyc'

In [3]: !dpkg -S /opt/ros/hydro/lib/python2.7/dist-packages/catkin/builder.pyc
ros-hydro-catkin: /opt/ros/hydro/lib/python2.7/dist-packages/catkin/builder.pyc

@dirk-thomas
Copy link
Member

Well, but something must be different. Is the package which is triggering the exception in both workspace and also equal or is the Groovy and Hydro version of the package different?

@tfoote
Copy link
Member

tfoote commented Jul 17, 2013

@wjwwood

1 similar comment
@wjwwood
Copy link
Member

wjwwood commented Jul 17, 2013

@wjwwood

@jonbinney
Copy link
Author

Its the package which i describe above (in second comment on this issue). It's a completely new catkin package, which i've added exactly one line to the CMakeLists.txt

@dirk-thomas
Copy link
Member

I will commit a fix later - the bug in the code is obvious.

But I would still like to know who you get different behavior while running the same version. If you do a pure cmake invocation on both workspaces do you see the special character in both cases in the console output?

@jonbinney
Copy link
Author

OK, actually i realized that i do see the same issue on both groovy and hydro. The reason i didn't see it on groovy before is that i forgot to remove the build and devel directories, and so it wasn't actually re-running cmake; just make.

@dirk-thomas
Copy link
Member

Thanks for clarifying.

The fix is checked in but don't expect a release very soon since catkin has just been released and the effort of rebuilding stuff is pretty high. Until then you can just checkout catkin into your workspace which has the issue.

@jonbinney
Copy link
Author

Thanks!

cwecht pushed a commit to cwecht/catkin that referenced this issue Mar 20, 2018
Enables servicing callbacks during final optimization, thus
enabling visualization of its progress in RViz. Fixes ros#476.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants