Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1899b17f
Commit
1899b17f
authored
Oct 24, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement regression test for #1306
parent
9d5165d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
libcaf_core/test/response_promise.cpp
libcaf_core/test/response_promise.cpp
+23
-0
No files found.
libcaf_core/test/response_promise.cpp
View file @
1899b17f
...
...
@@ -9,6 +9,7 @@
#include "core-test.hpp"
using
namespace
caf
;
using
namespace
std
::
literals
;
namespace
{
...
...
@@ -170,3 +171,25 @@ SCENARIO("response promises allow delegation") {
}
END_FIXTURE_SCOPE
()
CAF_TEST
(
"GH-1306 regression"
)
{
actor_system_config
cfg
;
cfg
.
set
(
"caf.scheduler.max-threads"
,
1u
);
actor_system
sys
{
cfg
};
auto
aut
=
sys
.
spawn
([](
caf
::
event_based_actor
*
self
)
->
behavior
{
return
{
[
self
](
int32_t
x
)
{
auto
rp
=
self
->
make_response_promise
();
self
->
run_delayed
(
1h
,
[
rp
,
x
]()
mutable
{
rp
.
deliver
(
x
+
x
);
});
return
rp
;
},
};
});
scoped_actor
self
{
sys
};
self
->
send
(
aut
,
21
);
self
->
send_exit
(
aut
,
exit_reason
::
kill
);
aut
=
nullptr
;
// Destroying the now obsolete action now destroys the promise. If the promise
// access the self pointer this triggers a heap-use-after-free since the AUT
// has been destroyed at this point.
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment