Repository navigation
Backlog
Description
A13 2201116PG
Crashed: Thread: SIGABRT 0x0000000000000000
#00 pc 0x91fd0 libc.so (BuildId: 8a2277585401a6103d671ea1f801ed52)
#01 pc 0x91fa8 libc.so (BuildId: 8a2277585401a6103d671ea1f801ed52)
#02 pc 0xed1d8 libc.so (BuildId: 8a2277585401a6103d671ea1f801ed52)
#03 pc 0xa93f4 libc.so (BuildId: 8a2277585401a6103d671ea1f801ed52)
#04 pc 0xa9100 libc.so (BuildId: 8a2277585401a6103d671ea1f801ed52)
#05 pc 0xa8a44 libc.so (BuildId: 8a2277585401a6103d671ea1f801ed52)
#06 pc 0x1076448 libgojni.so (_cgo_90c9abb7659c_C2func_getaddrinfo [cgo-gcc-prolog:60]) (BuildId: 11505b78c61af2acf4a75d6d6056acc236460522)Gemini 4:
The crash is represented by a SIGABRT signal occurring within libgojni.so during a call to getaddrinfo via CGO (_cgo_90c9abb7659c_C2func_getaddrinfo).
SIGABRT(Signal Abort): This signal is typically triggered by the operating system or the runtime library itself when a critical, unrecoverable error is detected (such as a heap corruption, double-free, or a failed assertion).getaddrinfo: This is a standard POSIX network function used to resolve domain names to IP addresses.- Go/CGO Context:
libgojni.soindicates a Go library compiled for Android using Go Mobile (reverse-binding/JNI). Go's runtime managed memory and threading model often clash with Android's native environment (libc/bionic) when crossing the language boundary via CGO.
Possible causes:
- Thread Stack Overflow: Android's native threads created by the JVM have limited stack sizes. When CGO calls blocking network resolution functions like getaddrinfo, it may exceed the allocated stack space of the calling JNI thread, causing a silent stack overflow that manifests as a SIGABRT.
- DNS Resolver Instability: On certain Android OS versions, concurrent calls to the native getaddrinfo from non-JVM-spawned threads (like Go runtime-managed threads) can lead to race conditions or memory corruption inside Android's Bionic libc resolver.
- Network State Changes: If a DNS resolution is in progress while the network interface changes state (e.g., switching from Wi-Fi to Mobile Data), the underlying file descriptors or sockets used by getaddrinfo might be forcefully closed, leading to unhandled native exceptions.
Possible solution:
Force Go to Use its Pure Go Resolver (Recommended)
By default on Android, Go attempts to use the native C-library resolver (cgo resolver) which calls getaddrinfo. You can force Go to use its built-in, pure Go DNS resolver, which avoids calling getaddrinfo altogether and runs entirely within Go's managed stack and memory space.
# bypass libc
export GODEBUG=netdns=go
# alternatively
go build -tags netgo ...
Metadata
Metadata
Assignees
Labels
No labels
Activity