Comments (5)
from my observation, the following case will also fail:
Does it mean I should not use coordinator in the source anywhere?
std::vector<int> data{1, 2, 3, 4, 5};
schedulers::run_loop rl;
identity_one_worker c(schedulers::make_run_loop(rl));
sources::iterate(data, c)
.tap([](auto _) {std::cout << "before delay\n";})
.delay(std::chrono::milliseconds(500))
.tap([](auto _) {std::cout << "after delay\n";})
.subscribe([](int v) {
std::cout << "Next " << v << "\n";
});
from rxcpp.
I started investigating this issue. I found that the crash was caused by the following line.
RxCpp/Rx/v2/src/rxcpp/rx-scheduler.hpp
Line 349 in 761b932
For some reason, the weak_ptr
returned NULL, presumably the underlying shared pointer has been released somehow.
from rxcpp.
One possibility is that the sources (like just
or iterate
) uses identity_immediate
coordinator by default:
RxCpp/Rx/v2/src/rxcpp/sources/rx-iterate.hpp
Line 277 in 761b932
This makes more sense to me as emitting values does not sounds like asynchronous operation (except
interval
). Passing the runloop coordinator seems not a good choice but why will it crash?from rxcpp.
Can you add the stack for the crash?
from rxcpp.
@kirkshoop Sorry for the late response. Here is the stack: (I am using master branch of rxcpp)
rxcpp::schedulers::worker::schedule_rebind<…>(const rxcpp::schedulers::schedulable &) const rx-scheduler.hpp:815
rxcpp::schedulers::worker::schedule rx-scheduler.hpp:260
rxcpp::schedulers::schedulable::schedule rx-scheduler.hpp:621
rxcpp::schedulers::detail::action_tailrecurser::operator() rx-scheduler.hpp:715
std::__invoke_impl<…> invoke.h:61
std::__invoke_r<…> invoke.h:111
std::_Function_handler::_M_invoke(const std::_Any_data &, const rxcpp::schedulers::schedulable &, const rxcpp::schedulers::recurse &) std_function.h:291
std::function::operator()(const rxcpp::schedulers::schedulable &, const rxcpp::schedulers::recurse &) const std_function.h:560
rxcpp::schedulers::detail::action_type::operator() rx-scheduler.hpp:679
rxcpp::schedulers::action::operator() rx-scheduler.hpp:727
rxcpp::schedulers::schedulable::operator() rx-scheduler.hpp:645
rxcpp::schedulers::run_loop::dispatch rx-runloop.hpp:192
main emitting_a_list_simultaneously_or_sequentially.cpp:37
__tmainCRTStartup 0x00007ff72cc9143f
mainCRTStartup 0x00007ff72cc91146
BaseThreadInitThunk 0x00007ff8045554e0
RtlUserThreadStart 0x00007ff8049a485b
<unknown> 0x0000000000000000
from rxcpp.
Related Issues (20)
- Flat map serializes output when using observable<>::create HOT 2
- Q: optional thread pool interface
- action_tailrecurser condition explanation
- Example test under Rx/v2/examples/tests fails
- `std::aligned_storage` is deprecated in C++23
- Docs for flat_map should reference concat_map but instead reference flat_map HOT 1
- Const overload of resource::get()
- Docs for rxcpp::sources::range are the same as those from rxcpp::observable<>::create
- identity_current_thread is bad "default" scheduler for operators
- error: unknown type name 'stdscr' auto timeout(AN&&... an) const
- Segmentation fault in case of using new_thread + current_thread
- combine_latest fails build with MSVC 19.34.31935.0 when C++ standard is set to 17 HOT 3
- Documentation request: provide examples for C++ that match examples from the "Intro to Rx" article HOT 2
- README doesn't explain how to run tests
- `find_package(rxcpp "4.1.1" CONFIG REQUIRED)` fails because CMake module version is not updated
- Create iterate error commit 562 "[Perfomance] Significantly reduce amount of copies/moves inside operators"
- run_loop dispatch optimization
- `is_hashable` is broken in C++20 (`std::hash<T>::result_type` and `::argument_type` were removed)
- Merge scheduler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxcpp.