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

Issue with Boost.Asio scheduler and RxCpp #525

Open
david-hoze opened this issue Jan 23, 2020 · 3 comments
Open

Issue with Boost.Asio scheduler and RxCpp #525

david-hoze opened this issue Jan 23, 2020 · 3 comments

Comments

@david-hoze
Copy link

Hi, I'm using a scheduler taken from Boost.ASIO scheduler for RxCPP (referenced in #183).

I'm experiencing an issue with RxCpp, full reproduction in https://github.com/david-hoze/RxCppAsioReproduction.

When running the example, I often (not always) get

pure virtual method called
terminate called without an active exception

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

very often when running.

When debugging the stacktrace shows it gets the SIGABRT in

return inner->create_worker(cs);

and on my code in:
https://github.com/david-hoze/RxCppAsioReproduction/blob/master/rx-asio.h#L53
and higher in the stack trace:
https://github.com/david-hoze/RxCppAsioReproduction/blob/master/main_rxcpp_asio_reproduction.cpp#L29

You can debug and see yourself..
Am I using RxCpp wrongly? is it a problem with the rx-asio scheduler I downloaded? Do you know of a more robust and tested version of a Boost.Asio RxCpp scheduler?

@kirkshoop
Copy link
Member

Thanks for the repo with a repro.. this was much easier to look into!

I put my changes in a PR here david-hoze/RxCppAsioReproduction#1

in short -

  • avoid subjects
  • prefer operators
  • rxcpp defaults to single-thread safety ( following the pay-only-for-what-you-use principal)

@david-hoze
Copy link
Author

david-hoze commented Jan 26, 2020

Hi, no problem, my pleasure 😃, thanks for the quick reply!
The second version (less subjects, more operators) indeed fixes the issue, and does not throw a SIGABRT, and it's also very good for learning how it should be done with operators. FYI, the first version still throws (at least on my machine).

Thanks,
David

@windoze
Copy link

windoze commented Jan 27, 2020

@david-hoze Sorry for the late response, I just got the chance to check my email during the Chinese New Year holiday.
This snippet was written 5 years ago and I really cannot recall all the details, only thing I can remember is that I was working on a project using both RxCpp and Boost hence the idea, I'm pretty sure it used to be working but of course everything could have been changed since then.
I'll try to find some time to look into the code and make it working again, but right now I cannot promise anything.
Thank you for being interested by my code and sorry again.

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

3 participants