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
d90a8554
Commit
d90a8554
authored
May 24, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possible heap-use-after-free w/ trace logging
parent
2a3d7126
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+12
-8
No files found.
libcaf_core/src/local_actor.cpp
View file @
d90a8554
...
@@ -485,15 +485,19 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
...
@@ -485,15 +485,19 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
}
}
//intrusive_ptr<local_actor> mself{this};
//intrusive_ptr<local_actor> mself{this};
std
::
thread
([
hide
](
intrusive_ptr
<
local_actor
>
mself
)
{
std
::
thread
([
hide
](
intrusive_ptr
<
local_actor
>
mself
)
{
CAF_PUSH_AID
(
mself
->
id
());
// this extra scope makes sure that the trace logger is
CAF_LOGF_TRACE
(
""
);
// destructed before dec_detached_threads() is called
auto
max_throughput
=
std
::
numeric_limits
<
size_t
>::
max
();
{
while
(
mself
->
resume
(
nullptr
,
max_throughput
)
!=
resumable
::
done
)
{
CAF_PUSH_AID
(
mself
->
id
());
// await new data before resuming actor
CAF_LOGF_TRACE
(
""
);
mself
->
await_data
();
auto
max_throughput
=
std
::
numeric_limits
<
size_t
>::
max
();
CAF_ASSERT
(
mself
->
mailbox
().
blocked
()
==
false
);
while
(
mself
->
resume
(
nullptr
,
max_throughput
)
!=
resumable
::
done
)
{
// await new data before resuming actor
mself
->
await_data
();
CAF_ASSERT
(
mself
->
mailbox
().
blocked
()
==
false
);
}
mself
.
reset
();
}
}
mself
.
reset
();
if
(
!
hide
)
{
if
(
!
hide
)
{
scheduler
::
dec_detached_threads
();
scheduler
::
dec_detached_threads
();
}
}
...
...
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