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

Fix ACE_Logging_Strategy::handle_timeout returning -1 without releasing ACE_Log_Msg lock #2259

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

likema
Copy link
Contributor

@likema likema commented Jul 18, 2024

Before changed, there were two snippets in ACE_Logging_Strategy::handle_timeout :

if (output_file == 0)
        return -1;

whiich would return without releasing ACE_Log_Msg lock

@likema likema changed the title Fix ACE_Logging_Strategy::handle_timeout returning -1 without releasing ACE_Log_Msg lock Fix ACE_Logging_Strategy::handle_timeout returning -1 without releasing ACE_Log_Msg lock Jul 18, 2024
@jwillemsen
Copy link
Member

Don’t force push, makes it harder to review, use nullptr instead of 0

@likema
Copy link
Contributor Author

likema commented Jul 19, 2024

Don’t force push, makes it harder to review, use nullptr instead of 0

OK. Shall I combine two commits into one after reviewed so that keep one issue per commit?

@jwillemsen
Copy link
Member

No need to squash, please add/extend a unit test as reproducer

@@ -442,7 +442,8 @@ ACE_Logging_Strategy::handle_timeout (const ACE_Time_Value &,
// Close the current ostream.
#if defined (ACE_LACKS_IOSTREAM_TOTALLY)
FILE *output_file = (FILE *) this->log_msg_->msg_ostream ();
ACE_OS::fclose (output_file);
if (output_file)
ACE_OS::fclose (output_file);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting to nullptr only when it is non null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this line, output_file is assigned before using.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the part this->log_msg_->msg_ostream (nullptr);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants