Skip to content

Commit 3e1213a

Browse files
committed
buildlet: enable core dump creation on container VMs
Container-optimized OS sets kernel.core_pattern = "|/bin/false", effectively disabling core dump creation regardless of RLIMIT_CORE. We have tests that want to analyze core dumps, so reset core_pattern back to the default value on boot. For golang/go#25218. Change-Id: I7e3cc7496a5428326855cc687b87cb4da76fdd66 Reviewed-on: https://go-review.googlesource.com/c/build/+/479557 Run-TryBot: Michael Pratt <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 02174b4 commit 3e1213a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

buildlet/gce.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,12 @@ func StartNewVM(creds *google.Credentials, buildEnv *buildenv.Environment, instN
214214
emptyDir:
215215
medium: Memory
216216
`, opts.ProjectID, hconf.ContainerImage))
217-
} else if hconf.IsContainer() && hconf.CosArchitecture() == dashboard.CosArchARM64 {
217+
addMeta("user-data", `#cloud-config
218218
219+
runcmd:
220+
- sysctl -w kernel.core_pattern=core
221+
`)
222+
} else if hconf.IsContainer() && hconf.CosArchitecture() == dashboard.CosArchARM64 {
219223
addMeta("user-data", fmt.Sprintf(`#cloud-config
220224
221225
write_files:
@@ -239,6 +243,7 @@ write_files:
239243
runcmd:
240244
- systemctl daemon-reload
241245
- systemctl start buildlet.service
246+
- sysctl -w kernel.core_pattern=core
242247
`, opts.ProjectID, hconf.ContainerImage))
243248
}
244249

0 commit comments

Comments
 (0)