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
b640bebd
Commit
b640bebd
authored
Jun 22, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possible use-after-free of logger
parent
2883a862
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+5
-3
No files found.
libcaf_core/src/local_actor.cpp
View file @
b640bebd
...
@@ -59,7 +59,6 @@ public:
...
@@ -59,7 +59,6 @@ public:
void
run
()
{
void
run
()
{
auto
job
=
const_cast
<
local_actor
*>
(
self_
);
auto
job
=
const_cast
<
local_actor
*>
(
self_
);
CAF_SET_LOGGER_SYS
(
&
job
->
system
());
CAF_PUSH_AID
(
job
->
id
());
CAF_PUSH_AID
(
job
->
id
());
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
scoped_execution_unit
ctx
{
&
job
->
system
()};
scoped_execution_unit
ctx
{
&
job
->
system
()};
...
@@ -209,7 +208,11 @@ local_actor::~local_actor() {
...
@@ -209,7 +208,11 @@ local_actor::~local_actor() {
}
}
void
local_actor
::
on_destroy
()
{
void
local_actor
::
on_destroy
()
{
CAF_LOG_TRACE
(
CAF_ARG
(
is_terminated
()));
// disable logging from this point on, because on_destroy can
// be called after the logger is already destroyed;
// alternatively, we would have to use a reference-counted,
// heap-allocated logger
CAF_SET_LOGGER_SYS
(
nullptr
);
if
(
!
is_cleaned_up
())
{
if
(
!
is_cleaned_up
())
{
on_exit
();
on_exit
();
cleanup
(
exit_reason
::
unreachable
,
nullptr
);
cleanup
(
exit_reason
::
unreachable
,
nullptr
);
...
@@ -680,7 +683,6 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
...
@@ -680,7 +683,6 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
auto
this_ptr
=
ptr
->
get
();
auto
this_ptr
=
ptr
->
get
();
CAF_ASSERT
(
dynamic_cast
<
blocking_actor
*>
(
this_ptr
)
!=
0
);
CAF_ASSERT
(
dynamic_cast
<
blocking_actor
*>
(
this_ptr
)
!=
0
);
auto
self
=
static_cast
<
blocking_actor
*>
(
this_ptr
);
auto
self
=
static_cast
<
blocking_actor
*>
(
this_ptr
);
CAF_SET_LOGGER_SYS
(
&
self
->
system
());
error
rsn
;
error
rsn
;
std
::
exception_ptr
eptr
=
nullptr
;
std
::
exception_ptr
eptr
=
nullptr
;
try
{
try
{
...
...
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