Skip to content

Commit 18fcc9e

Browse files
happyCoder92copybara-github
authored andcommitted
Avoid logspam on stack trace
PiperOrigin-RevId: 903763605 Change-Id: Ie5b0cf3a1d67456302186e197932d14deae40705
1 parent 0dd32cd commit 18fcc9e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sandboxed_api/sandbox2/stack_trace.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ absl::StatusOr<std::vector<std::string>> StackTracePeer::LaunchLibunwindSandbox(
194194
// When running sandboxes concurrently, we might get a problem with sending
195195
// the unotify file descriptor in the unwind sandbox, as we might exceed the
196196
// maximum number of file descriptors.
197-
executor->limits()->set_rlimit_nofile(RLIM64_INFINITY);
197+
rlimit64 rlim;
198+
if (getrlimit64(RLIMIT_NOFILE, &rlim) == -1) {
199+
PLOG(WARNING) << "getrlimit64 failed, using RLIM64_INFINITY";
200+
rlim.rlim_cur = rlim.rlim_max = RLIM64_INFINITY;
201+
}
202+
executor->limits()->set_rlimit_nofile(rlim);
198203

199204
// Get path to the binary.
200205
// app_path contains the path like it is also in /proc/pid/maps. It is

0 commit comments

Comments
 (0)