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

Is the ctrl-c shutdown handler needed? #200

Open
AntoniosBarotsis opened this issue May 30, 2023 · 2 comments
Open

Is the ctrl-c shutdown handler needed? #200

AntoniosBarotsis opened this issue May 30, 2023 · 2 comments

Comments

@AntoniosBarotsis
Copy link

I am having an issue with the shutdown handler registered here.

thread '<unnamed>' panicked at 'ROS init failed!: Error(SigintOverride(MultipleHandlers), 
State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', 
/home/anton/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rosrust-0.9.11/src/singleton.rs:24:20

This is probably because I am creating Python bindings with PyO3 and Python defines its own ctrl-c handler. This only seems to affect the Python bindings since if I run the exact same code in Rust alone, it works fine.

I'm not quite sure what the handler that is defined in this project does but it seems like it just drops the logger when a SIGINT is received.

Would it be possible to have a temporary workaround? Only thing I can think of is putting the logger behind a feature so the handler is not needed in the first place.

@AntoniosBarotsis
Copy link
Author

AntoniosBarotsis commented May 30, 2023

I'm not quite sure if that handler is needed to begin with because I feel like the logger deallocates itself but then again you probably know better :)

For my personal use case, I've circumvented the issue by just removing the logger all together in a fork.

@AntoniosBarotsis
Copy link
Author

I see @ssemenova likely also faced a similar issue since she forked it and made the same change I did.

I wouldn't mind helping implement some workaround in the original library if you think it would make sense @adnanademovic :)

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

1 participant