~oliverpool/log.pfad.fr

843ff0fa910f19b58e51a9b8f61eab100ceacb54 — oliverpool 11 days ago 8554e8b main
style: nicer pre
2 files changed, 8 insertions(+), 6 deletions(-)

M content/2023-03-09-debugging-sibgus.gmi
M static/html/style.css
M content/2023-03-09-debugging-sibgus.gmi => content/2023-03-09-debugging-sibgus.gmi +6 -6
@@ 61,7 61,7 @@ Looking up on the Internet, I saw no reported bug that looked like mine and deci
Adding a defer statement did not work, trying to print the value of the float64 also crashed before having the change to have the value printed.
I also printed the address of the float64: it worked, but I didn't see anything suspect (the address looked legit).

## core dump debugging
## core dump analysis

Since the bug appeared to be low-level, I thought of generating a core dump. It wasn't trivial, because by default, Gokrazy does not provide shell access out of the box. After installing breakglass and busybox, I was able to get a core dump, by running:



@@ 81,11 81,11 @@ Looking at the stack traces and register values, I wasn't able to find anything 

The next day, it occurred to me that the Linux kernel might have more information regarding the crash. I ran dmesg and got a message looking like this (reconstructed from various Internet reports):
```
[1141145.918454] Alignment trap: not handling instruction 6b2168 at [<b6fa4b40>]
[1141145.918455] 8<--- cut here ---
[1141145.918466] Unhandled fault: alignment exception (0x001) at 0x2eb4dbb
[1141145.918479] pgd = da1a2e09
[1141145.918486] [2eb4dbb] *pgd=46c78835, *pte=00000000, *ppte=00000000
[1145.918454] Alignment trap: not handling instruction 6b2168 at [<b6fa4b40>]
[1145.918455] 8<--- cut here ---
[1145.918466] Unhandled fault: alignment exception (0x001) at 0x2eb4dbb
[1145.918479] pgd = da1a2e09
[1145.918486] [2eb4dbb] *pgd=46c78835, *pte=00000000, *ppte=00000000
```

I then understood what was going on: the alignment exception was complaining about the address 0x2eb4dbb, which is 48975291 in decimal.

M static/html/style.css => static/html/style.css +2 -0
@@ 31,6 31,8 @@ pre {
  overflow-x: auto;
  background-color: #eee;
  padding: 0.5rem;
  margin: 0 -0.5rem;
  font-size: 75%;
}
a[href^="http://"]::before,
a[href^="https://"]::before,