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

rosidl_adapter: Constant with trailing _ causes parser to infinite loop #693

Open
russkel opened this issue Jul 19, 2022 · 1 comment
Open
Assignees

Comments

@russkel
Copy link

russkel commented Jul 19, 2022

Bug report

Required Info:

  • Operating System:
    Ubuntu 22.04
  • Installation type:
    Ubuntu packages
  • Version or commit hash:
ros-humble-rosidl-adapter/jammy,now 3.1.3-2jammy.20220520.001831 amd64 [installed,automatic]

Steps to reproduce issue

When using a custom idl_adapter to generate IDL files I ran into this bug that causes the Constant parser to get into an infinite loop in the is_valid_constant_name def and never return. I ran my code using the debugger and then SIGINT'ed when it hit the infinite loop and this was the line of code it was stuck on:

> /opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/parser.py(150)is_valid_constant_name()
    149     try:
--> 150         m = VALID_CONSTANT_NAME_PATTERN.match(name)
    151     except TypeError:

ipdb> p name
'ALARM_ID_PILOT_POWERON_OR_SLEEPSWITCH_RESET_WHILE_ENGAGED_'
ipdb>      

After fixing up the trailing _ the issue was resolved, but the parser should probably not flake out like that.

Expected behavior

Exception about trailing _ not being permitted.

Actual behavior

Infinite loop.

@russkel
Copy link
Author

russkel commented Aug 18, 2022

Similarly these values are causing infinite loops:

'TIRE_PRESS_THRESHOLD_DETECTION_NOT AVAILABLE'
'FAILURE_MODE_IDENTIFIER1_BELOW_NORMAL_(MODERATELY_SEVERE)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants