Skip to content

Instantly share code, notes, and snippets.

@steeve
Last active December 28, 2015 22:48
Show Gist options
  • Save steeve/7573878 to your computer and use it in GitHub Desktop.
Save steeve/7573878 to your computer and use it in GitHub Desktop.
fatal error: runtime: stack split during syscall
runtime stack:
runtime.throw(0x6a8934)
/usr/local/go/src/pkg/runtime/panic.c:464 +0x5c
runtime.newstack()
/usr/local/go/src/pkg/runtime/stack.c:261 +0x5bc
runtime.morestack()
/usr/local/go/src/pkg/runtime/asm_arm.s:212 +0x44
goroutine 1 [stack split]:
runtime: unexpected return pc for runtime.sigpanic called from 0x40219864
runtime.sigpanic()
/usr/local/go/src/pkg/runtime/os_linux.c:219 fp=0xbe97e784
goroutine 3 [syscall]:
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394
goroutine 4 [syscall]:
os/signal.loop()
/usr/local/go/src/pkg/os/signal/signal_unix.go:21 +0x24
created by os/signal.init·1
/usr/local/go/src/pkg/os/signal/signal_unix.go:27 +0x48
fatal error: runtime: stack split during syscall
runtime stack:
runtime.throw(0x6a8934)
/usr/local/go/src/pkg/runtime/panic.c:464 +0x5c
runtime.newstack()
/usr/local/go/src/pkg/runtime/stack.c:261 +0x5bc
runtime.morestack()
/usr/local/go/src/pkg/runtime/asm_arm.s:212 +0x44
goroutine 1 [stack split]:
runtime: unexpected return pc for runtime.sigpanic called from 0x401a7864
runtime.sigpanic()
/usr/local/go/src/pkg/runtime/os_linux.c:219 fp=0xbe8d9774
goroutine 2 [syscall]:
runtime.notetsleepg(0x40025f9c, 0xf8475800, 0xd)
/usr/local/go/src/pkg/runtime/lock_futex.c:189 +0x40
runtime.MHeap_Scavenger()
/usr/local/go/src/pkg/runtime/mheap.c:463 +0xe4
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394
created by runtime.main
/usr/local/go/src/pkg/runtime/proc.c:179
goroutine 3 [syscall]:
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394
goroutine 4 [syscall]:
runtime.notetsleepg(0x6ab870, 0xffffffff, 0xffffffff)
/usr/local/go/src/pkg/runtime/lock_futex.c:189 +0x40
runtime.signal_recv(0x0)
/usr/local/go/src/pkg/runtime/sigqueue.goc:110 +0x110
os/signal.loop()
/usr/local/go/src/pkg/os/signal/signal_unix.go:21 +0x24
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394
created by os/signal.init·1
/usr/local/go/src/pkg/os/signal/signal_unix.go:27 +0x48
void
_wrap_add_torrent_params_name_get(void *swig_v)
{
libtorrent::add_torrent_params *arg1 = (libtorrent::add_torrent_params *) 0 ;
std::string *result = 0 ;
struct swigargs {
libtorrent::add_torrent_params *arg1;
long : 0;
_gostring_ result;
} __attribute__((__packed__)) *swig_a = (struct swigargs *) swig_v;
arg1 = *(libtorrent::add_torrent_params **)&swig_a->arg1;
result = (std::string *) & ((arg1)->name);
swig_a->result = _swig_makegostring((*result).data(), (*result).length());
}
#ifdef __cplusplus
extern "C" {
#endif
void (*crosscall2)(void (*fn)(void *, int), void *, int) = NULL;
void (*_cgo_allocate)(void *, int) = NULL;
void (*_cgo_panic)(void *, int) = NULL;
#ifdef __cplusplus
}
#endif
#include <dlfcn.h>
void _ensure_cgo() {
if (crosscall2 == NULL) {
void *handle = dlopen(NULL, RTLD_LAZY);
printf("handle=0x%x\n", handle);
crosscall2 = (void (*)(void (*fn)(void *, int), void *, int))dlsym(handle, "crosscall2");
printf("crosscall2=0x%x\n", crosscall2);
_cgo_allocate = (void (*)(void *, int))dlsym(handle, "_cgo_allocate");
printf("_cgo_allocate=0x%x\n", _cgo_allocate);
_cgo_panic = (void (*)(void *, int))dlsym(handle, "_cgo_panic");
printf("_cgo_panic=0x%x\n", _cgo_panic);
}
}
static void *_swig_goallocate(size_t len) {
_ensure_cgo();
struct {
size_t len;
void *ret;
} __attribute__((__packed__)) a;
a.len = len;
crosscall2(_cgo_allocate, &a, (int) sizeof a);
return a.ret;
}
static void _swig_gopanic(const char *p) {
_ensure_cgo();
struct {
const char *p;
} __attribute__((__packed__)) a;
a.p = p;
crosscall2(_cgo_panic, &a, (int) sizeof a);
}
static _gostring_ _swig_makegostring(const char *p, size_t l) {
_gostring_ ret;
ret.p = (char*)_swig_goallocate(l + 1);
memcpy(ret.p, p, l);
ret.n = l;
return ret;
}
$ arm-linux-androideabi-readelf -Ws build/android_arm/torrent2http | grep -E 'crosscall2|_cgo_allocate|_cgo_panic'
1: 001d6d70 0 FUNC GLOBAL DEFAULT 11 crosscall2
2: 001d6ca0 0 FUNC GLOBAL DEFAULT 11 _cgo_allocate
3: 001d6d40 0 FUNC GLOBAL DEFAULT 11 _cgo_panic
28359: 001d6ca0 48 FUNC GLOBAL DEFAULT 1 _cgo_allocate
28360: 001d6d40 48 FUNC GLOBAL DEFAULT 1 _cgo_panic
28361: 001d6d70 20 FUNC GLOBAL DEFAULT 1 crosscall2
handle=0x400e6ac0
crosscall2=0x1e6d70
_cgo_allocate=0x1e6ca0
_cgo_panic=0x1e6d40
SIGSEGV: segmentation violation
PC=0x28
runtime.cgocall(0x40202034, 0x70a06df0)
/usr/local/go/src/pkg/runtime/cgocall.c:148 +0x108 fp=0x70a06de0
github.com/steeve/libtorrent-go._swig_wrap_add_torrent_params_name_get(0x2574a48, 0x2572f10, 0x1, 0x2ce5c)
/Users/steeve/projects/go/src/github.com/steeve/libtorrent-go/libtorrent_gc.c:6168 +0x38 fp=0x70a06dec
github.com/steeve/libtorrent-go.SwigcptrAdd_torrent_params.GetName(0x2574a48, 0x1, 0x1)
/Users/steeve/projects/go/src/github.com/steeve/libtorrent-go/libtorrent.go:3638 +0x2c fp=0x70a06dfc
main.main()
/Users/steeve/projects/go/src/github.com/steeve/torrent2http/torrent2http.go:290 +0x904 fp=0x70a06f8c
runtime.main()
/usr/local/go/src/pkg/runtime/proc.c:220 +0x100 fp=0x70a06fc0
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394 fp=0x70a06fc0
goroutine 3 [syscall]:
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394
goroutine 4 [syscall]:
os/signal.loop()
/usr/local/go/src/pkg/os/signal/signal_unix.go:21 +0x24
created by os/signal.init·1
/usr/local/go/src/pkg/os/signal/signal_unix.go:27 +0x48
trap 0xe
error 0x80000007
oldmask 0x0
r0 0x1e6ca0
r1 0xbe883780
r2 0x8
r3 0x1e6d70
r4 0x27
r5 0xbe8837a0
r6 0x405e7d10
r7 0x2574c04
r8 0x508f0824
r9 0x6ade60
r10 0x6abad0
fp 0x0
ip 0x4000
sp 0xbe8837ac
lr 0x401fa8ec
pc 0x28
cpsr 0x80000010
fault 0x28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment