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

[Bug] fix log buffer inital issue #453

Merged

Conversation

ocean-dot-li
Copy link

In exec_execute_message(), we should initalize the log buffer at outermost layer. If not, crash may happen when trying to pfree its data member.

This patch fixes the issue.

@polardb-bot
Copy link

polardb-bot bot commented Nov 16, 2023

Hi @ocean-dot-li ~ Thanks for your contribution in this PR. ❤️

Please make sure that your PR conforms the standard, and has passed all the checks.

We will review your PR as soon as possible.

@polardb-bot
Copy link

polardb-bot bot commented Nov 16, 2023

Hey @ocean-dot-li :

Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review.

@polardb-bot polardb-bot bot added the ci/success CI status is success label Nov 16, 2023
@@ -2354,13 +2354,15 @@ exec_execute_message(const char *portal_name, long max_rows)
pq_putemptymessage('s');
}

/* POLAR: inital buf used by logging info. */
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to initialize the buf.data here, and keep the initStringInfo at where it originally be? Because not all path needs to use buf.data, allocate memory here for all path seems wasteful.

buf.data = NULL;

In exec_execute_message(), we should initalize the log buffer at
outermost layer. If not, crash may happen when trying to accessing
its data member.

This patch fixes the issue.
@polardb-bot
Copy link

polardb-bot bot commented Nov 16, 2023

Hey @ocean-dot-li :

Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review.

@polardb-bot polardb-bot bot added ci/success CI status is success and removed ci/success CI status is success labels Nov 16, 2023
@mrdrivingduck
Copy link
Member

/rebase-and-merge

@polardb-bot polardb-bot bot merged commit ef4db25 into ApsaraDB:POLARDB_11_DEV Nov 16, 2023
6 checks passed
@polardb-bot
Copy link

polardb-bot bot commented Nov 16, 2023

@mrdrivingduck PR has been merged. 🍗

Thanks again for the contributors involved in this thread: ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/success CI status is success
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants