Skip to content

fix: avoid SIGSEGV in read_proc_io during static initialization#3184

Merged
chenBright merged 1 commit into
apache:masterfrom
jesson1:fix/bvar-init-crash
Dec 29, 2025
Merged

fix: avoid SIGSEGV in read_proc_io during static initialization#3184
chenBright merged 1 commit into
apache:masterfrom
jesson1:fix/bvar-init-crash

Conversation

@jesson1

@jesson1 jesson1 commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: resolve #3183

Problem Summary:
When /proc/self/io is inaccessible, read_proc_io calls PLOG during global static construction. If glog is not yet initialized, it triggers a SIGSEGV.

What is changed and the side effects?

Changed:
Replace PLOG_ONCE with a guarded fprintf(stderr, ...) to ensure safety during early startup. A static flag is used to maintain the "print once" behavior.

Side effects:

  • Performance effects: none

  • Breaking backward compatibility: none


Check List:

Signed-off-by: jiasheng.yu <jiashengyu@deepglint.com>
@wwbmmm

wwbmmm commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

LGTM

@chenBright chenBright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@chenBright chenBright merged commit 9f4947c into apache:master Dec 29, 2025
17 checks passed
zchuango pushed a commit to zchuango/brpc that referenced this pull request May 9, 2026
…he#3184)

Signed-off-by: jiasheng.yu <jiashengyu@deepglint.com>
Co-authored-by: jiasheng.yu <jiashengyu@deepglint.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix SIGSEGV during static initialization when /proc/self/io is missing (glog uninitialized)

3 participants