util: include errno.h for EAGAIN [crashpad/crashpad : main]

3 views
Skip to first unread message

Takuto Ikuta (Gerrit)

unread,
Jul 24, 2025, 2:15:49 AMJul 24
to Takuto Ikuta, Mark Mentovai, crashp...@chromium.org
Attention needed from Mark Mentovai

Takuto Ikuta voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Mark Mentovai
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9be7a597fabbaa5952fb704beab5560b3c21cfcf
Gerrit-Change-Number: 6782658
Gerrit-PatchSet: 2
Gerrit-Owner: Takuto Ikuta <tik...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Reviewer: Takuto Ikuta <tik...@chromium.org>
Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
Gerrit-Comment-Date: Thu, 24 Jul 2025 06:15:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Mark Mentovai (Gerrit)

unread,
Jul 24, 2025, 9:26:00 AMJul 24
to Takuto Ikuta, Joshua Peraza, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Takuto Ikuta

Mark Mentovai voted and added 1 comment

Votes added by Mark Mentovai

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Mark Mentovai . unresolved

Takuto, LGTM.

---

Joshua, I’m not sure that this will ever actually see `-EAGAIN`. `-EPERM`, possibly.

Most likely, `crashpad::LogOutputStream::Delegate::Log` should be made to return a `bool` instead of an `int`. I don’t think that the only working implementation of that interface that we have, in handler/linux/crash_report_exception_handler.cc, actually behaves the way that the interface description in util/stream/log_output_stream.h says it should. In particular, `__android_log_buf_write`’s [documentation](https://developer.android.com/ndk/reference/group/logging#__android_log_buf_write) and [implementation](https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/logger_write.cpp;l=385,389,395;drc=90ddfb0bd41fbb41d045f04e02476ddce200d535).

I’m also not sure why `crashpad::LogOutputStream::WriteBuffer` code seems to think it can suffer a `WriteToLog` error and then be able to call `WriteToLog` again on its failure path.

This file is giving me a weird feeling. Can you take a look and adjust if appropriate?

Open in Gerrit

Related details

Attention is currently required from:
  • Takuto Ikuta
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9be7a597fabbaa5952fb704beab5560b3c21cfcf
Gerrit-Change-Number: 6782658
Gerrit-PatchSet: 2
Gerrit-Owner: Takuto Ikuta <tik...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Reviewer: Takuto Ikuta <tik...@chromium.org>
Gerrit-CC: Joshua Peraza <jpe...@chromium.org>
Gerrit-Attention: Takuto Ikuta <tik...@chromium.org>
Gerrit-Comment-Date: Thu, 24 Jul 2025 13:25:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Joshua Peraza (Gerrit)

unread,
Jul 24, 2025, 4:55:12 PMJul 24
to Takuto Ikuta, Mark Mentovai, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Takuto Ikuta

Joshua Peraza added 1 comment

Patchset-level comments
Mark Mentovai . unresolved

Takuto, LGTM.

---

Joshua, I’m not sure that this will ever actually see `-EAGAIN`. `-EPERM`, possibly.

Most likely, `crashpad::LogOutputStream::Delegate::Log` should be made to return a `bool` instead of an `int`. I don’t think that the only working implementation of that interface that we have, in handler/linux/crash_report_exception_handler.cc, actually behaves the way that the interface description in util/stream/log_output_stream.h says it should. In particular, `__android_log_buf_write`’s [documentation](https://developer.android.com/ndk/reference/group/logging#__android_log_buf_write) and [implementation](https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/logger_write.cpp;l=385,389,395;drc=90ddfb0bd41fbb41d045f04e02476ddce200d535).

I’m also not sure why `crashpad::LogOutputStream::WriteBuffer` code seems to think it can suffer a `WriteToLog` error and then be able to call `WriteToLog` again on its failure path.

This file is giving me a weird feeling. Can you take a look and adjust if appropriate?

Joshua Peraza

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

Open in Gerrit

Related details

Attention is currently required from:
  • Takuto Ikuta
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9be7a597fabbaa5952fb704beab5560b3c21cfcf
Gerrit-Change-Number: 6782658
Gerrit-PatchSet: 2
Gerrit-Owner: Takuto Ikuta <tik...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Reviewer: Takuto Ikuta <tik...@chromium.org>
Gerrit-CC: Joshua Peraza <jpe...@chromium.org>
Gerrit-Attention: Takuto Ikuta <tik...@chromium.org>
Gerrit-Comment-Date: Thu, 24 Jul 2025 20:55:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Mark Mentovai (Gerrit)

unread,
Jul 24, 2025, 7:14:43 PMJul 24
to Takuto Ikuta, Joshua Peraza, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Takuto Ikuta

Mark Mentovai added 1 comment

Patchset-level comments
Mark Mentovai . unresolved

Takuto, LGTM.

---

Joshua, I’m not sure that this will ever actually see `-EAGAIN`. `-EPERM`, possibly.

Most likely, `crashpad::LogOutputStream::Delegate::Log` should be made to return a `bool` instead of an `int`. I don’t think that the only working implementation of that interface that we have, in handler/linux/crash_report_exception_handler.cc, actually behaves the way that the interface description in util/stream/log_output_stream.h says it should. In particular, `__android_log_buf_write`’s [documentation](https://developer.android.com/ndk/reference/group/logging#__android_log_buf_write) and [implementation](https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/logger_write.cpp;l=385,389,395;drc=90ddfb0bd41fbb41d045f04e02476ddce200d535).

I’m also not sure why `crashpad::LogOutputStream::WriteBuffer` code seems to think it can suffer a `WriteToLog` error and then be able to call `WriteToLog` again on its failure path.

This file is giving me a weird feeling. Can you take a look and adjust if appropriate?

Joshua Peraza

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

Mark Mentovai

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

I don't not believe you.

But:

How does that work? We don't call anything on that page, we call a different function that's not documented to return `-EAGAIN`, and (if I found the right thing) whose implementation doesn't either.

Open in Gerrit

Related details

Attention is currently required from:
  • Takuto Ikuta
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9be7a597fabbaa5952fb704beab5560b3c21cfcf
Gerrit-Change-Number: 6782658
Gerrit-PatchSet: 2
Gerrit-Owner: Takuto Ikuta <tik...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Reviewer: Takuto Ikuta <tik...@chromium.org>
Gerrit-CC: Joshua Peraza <jpe...@chromium.org>
Gerrit-Attention: Takuto Ikuta <tik...@chromium.org>
Gerrit-Comment-Date: Thu, 24 Jul 2025 23:14:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joshua Peraza <jpe...@chromium.org>
Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Joshua Peraza (Gerrit)

unread,
Jul 24, 2025, 8:43:31 PMJul 24
to Takuto Ikuta, Mark Mentovai, Crashpad LUCI CQ, crashp...@chromium.org
Attention needed from Takuto Ikuta

Joshua Peraza added 1 comment

Patchset-level comments
Mark Mentovai . unresolved

Takuto, LGTM.

---

Joshua, I’m not sure that this will ever actually see `-EAGAIN`. `-EPERM`, possibly.

Most likely, `crashpad::LogOutputStream::Delegate::Log` should be made to return a `bool` instead of an `int`. I don’t think that the only working implementation of that interface that we have, in handler/linux/crash_report_exception_handler.cc, actually behaves the way that the interface description in util/stream/log_output_stream.h says it should. In particular, `__android_log_buf_write`’s [documentation](https://developer.android.com/ndk/reference/group/logging#__android_log_buf_write) and [implementation](https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/logger_write.cpp;l=385,389,395;drc=90ddfb0bd41fbb41d045f04e02476ddce200d535).

I’m also not sure why `crashpad::LogOutputStream::WriteBuffer` code seems to think it can suffer a `WriteToLog` error and then be able to call `WriteToLog` again on its failure path.

This file is giving me a weird feeling. Can you take a look and adjust if appropriate?

Joshua Peraza

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

Mark Mentovai

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

I don't not believe you.

But:

How does that work? We don't call anything on that page, we call a different function that's not documented to return `-EAGAIN`, and (if I found the right thing) whose implementation doesn't either.

Joshua Peraza
Open in Gerrit

Related details

Attention is currently required from:
  • Takuto Ikuta
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9be7a597fabbaa5952fb704beab5560b3c21cfcf
Gerrit-Change-Number: 6782658
Gerrit-PatchSet: 2
Gerrit-Owner: Takuto Ikuta <tik...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Reviewer: Takuto Ikuta <tik...@chromium.org>
Gerrit-CC: Joshua Peraza <jpe...@chromium.org>
Gerrit-Attention: Takuto Ikuta <tik...@chromium.org>
Gerrit-Comment-Date: Fri, 25 Jul 2025 00:43:28 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Takuto Ikuta (Gerrit)

unread,
Jul 24, 2025, 10:06:46 PMJul 24
to Takuto Ikuta, Mark Mentovai, Joshua Peraza, Crashpad LUCI CQ, crashp...@chromium.org

Takuto Ikuta added 1 comment

Patchset-level comments
Mark Mentovai . resolved

Takuto, LGTM.

---

Joshua, I’m not sure that this will ever actually see `-EAGAIN`. `-EPERM`, possibly.

Most likely, `crashpad::LogOutputStream::Delegate::Log` should be made to return a `bool` instead of an `int`. I don’t think that the only working implementation of that interface that we have, in handler/linux/crash_report_exception_handler.cc, actually behaves the way that the interface description in util/stream/log_output_stream.h says it should. In particular, `__android_log_buf_write`’s [documentation](https://developer.android.com/ndk/reference/group/logging#__android_log_buf_write) and [implementation](https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/logger_write.cpp;l=385,389,395;drc=90ddfb0bd41fbb41d045f04e02476ddce200d535).

I’m also not sure why `crashpad::LogOutputStream::WriteBuffer` code seems to think it can suffer a `WriteToLog` error and then be able to call `WriteToLog` again on its failure path.

This file is giving me a weird feeling. Can you take a look and adjust if appropriate?

Joshua Peraza

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

Mark Mentovai

The Errors section at the bottom of the README says EAGAIN means the logcat has been overloaded. https://cs.android.com/android/_/android/platform/system/logging/+/main:liblog/README.md

This has been reproducible in tests by logging lots of output: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2439641

I don't not believe you.

But:

How does that work? We don't call anything on that page, we call a different function that's not documented to return `-EAGAIN`, and (if I found the right thing) whose implementation doesn't either.

Joshua Peraza

It seems \_\_android_log_buf_write() was updated to longer return -EAGAIN by this CL: https://cs.android.com/android/_/android/platform/system/logging/+/c17613c4582d4f6eecb3965bb96584f25762b827

Changes as suggested: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/6786151

Takuto Ikuta

Thanks, I abandon this and wait for your CL then.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: crashpad/crashpad
Gerrit-Branch: main
Gerrit-Change-Id: I9be7a597fabbaa5952fb704beab5560b3c21cfcf
Gerrit-Change-Number: 6782658
Gerrit-PatchSet: 2
Gerrit-Owner: Takuto Ikuta <tik...@chromium.org>
Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
Gerrit-Reviewer: Takuto Ikuta <tik...@chromium.org>
Gerrit-CC: Joshua Peraza <jpe...@chromium.org>
Gerrit-Comment-Date: Fri, 25 Jul 2025 02:06:40 +0000
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages