Closed zhangbo8418 closed 2 years ago
用gdb导出backtrace看一下在哪个函数中产生了trap
用gdb导出backtrace看一下在哪个函数中产生了trap
路由器的系统没那玩意儿呢。。。
ulimit -c unlimited
sudo ./tmp/naive
scp core user@another-pc
gdb naive core
ulimit -c unlimited sudo ./tmp/naive scp core user@another-pc gdb naive core
路由器系统,没有gdb啊。。。这是个嵌入式系统。。。我怀疑是libc导致的,这玩意儿系统是glibc 2.2.4,就跟Debian9一样。。。
你也可以把core传到这里
你也可以把core传到这里
#0 0x55abbbcc in partition_alloc::DecommitSystemPages(unsigned int, unsigned int, partition_alloc::PageAccessibilityDisposition) ()
The error was from some syscalls. I need strace for this:
strace -f /tmp/naive
See what we get.
#0 0x55abbbcc in partition_alloc::DecommitSystemPages(unsigned int, unsigned int, partition_alloc::PageAccessibilityDisposition) ()
The error was from some syscalls. I need strace for this:
strace -f /tmp/naive
See what we get.
execve("/tmp/naive", ["/tmp/naive"], [/* 45 vars */]) = 0
brk(NULL) = 0x56407000
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77efe000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=18440, ...}) = 0
mmap2(NULL, 18440, PROT_READ, MAP_PRIVATE, 3, 0) = 0x77ef9000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/mipsel-linux-gnu/libatomic.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\300\24\0\0004\0\0\0"..., 512) = 512
prctl(PR_GET_FP_MODE) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=24820, ...}) = 0
mmap2(NULL, 90240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x77eba000
mprotect(0x77ebf000, 61440, PROT_NONE) = 0
mmap2(0x77ece000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x77ece000
mmap2(0x77ed0000, 128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x77ed0000
mprotect(0x7fa57000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = 0
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/mipsel-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0PO\0\0004\0\0\0"..., 512) = 512
prctl(PR_GET_FP_MODE) = 0
lseek(3, 488, SEEK_SET) = 488
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\211\"\236\tolo\320\277\256\255\206\17\250\30\370"..., 36) = 36
lseek(3, 836, SEEK_SET) = 836
read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0", 32) = 32
fstat64(3, {st_mode=S_IFREG|0755, st_size=145552, ...}) = 0
mmap2(NULL, 181216, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x77e8d000
mprotect(0x77ea7000, 61440, PROT_NONE) = 0
mmap2(0x77eb6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x77eb6000
mmap2(0x77eb8000, 5088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x77eb8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/mipsel-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\240=\0\0004\0\0\0"..., 512) = 512
prctl(PR_GET_FP_MODE) = 0
lseek(3, 716, SEEK_SET) = 716
read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0", 32) = 32
fstat64(3, {st_mode=S_IFREG|0644, st_size=546728, ...}) = 0
mmap2(NULL, 598880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x77dfa000
mprotect(0x77e7c000, 61440, PROT_NONE) = 0
mmap2(0x77e8b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x81000) = 0x77e8b000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/mipsel-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\340\311\0\0004\0\0\0"..., 512) = 512
prctl(PR_GET_FP_MODE) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=200060, ...}) = 0
mmap2(NULL, 222896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x77dc3000
mprotect(0x77dea000, 61440, PROT_NONE) = 0
mmap2(0x77df9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x77df9000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/mipsel-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0T\226\1\0004\0\0\0"..., 512) = 512
prctl(PR_GET_FP_MODE) = 0
lseek(3, 520, SEEK_SET) = 520
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\301y*Q,\371\334\217\236\251\360\207(@\16."..., 36) = 36
lseek(3, 828, SEEK_SET) = 828
read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\3\0\0\0\2\0\0\0\0\0\0\0", 32) = 32
fstat64(3, {st_mode=S_IFREG|0755, st_size=1611720, ...}) = 0
mmap2(NULL, 1589040, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x77c3f000
mprotect(0x77dab000, 65536, PROT_NONE) = 0
mmap2(0x77dbb000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16c000) = 0x77dbb000
mmap2(0x77dc1000, 7984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x77dc1000
close(3) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77ef7000
set_thread_area(0x77efea60) = 0
mprotect(0x77dbb000, 12288, PROT_READ) = 0
mprotect(0x77e8b000, 4096, PROT_READ) = 0
mprotect(0x77eb6000, 4096, PROT_READ) = 0
mprotect(0x77ece000, 4096, PROT_READ) = 0
mprotect(0x55c62000, 53248, PROT_READ) = 0
mprotect(0x77f03000, 4096, PROT_READ) = 0
munmap(0x77ef9000, 18440) = 0
set_tid_address(0x77ef7638) = 2911
set_robust_list(0x77ef7640, 12) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x77e91898, sa_mask=[], sa_flags=SA_SIGINFO}, NULL, 16) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x77e919bc, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 16) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 16) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=2147483647}) = 0
gettid() = 2911
gettid() = 2911
gettid() = 2911
gettid() = 2911
gettid() = 2911
getrandom("\317E\"\325j\256\245\346", 8, 0) = 8
getrandom("\0zY\325\353\213\7`", 8, 0) = 8
mmap2(0x33c00000, 2097152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x33c00000
mprotect(0x33c01000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c04000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c08000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c0c000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c10000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c14000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c18000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c1c000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c20000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c24000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c28000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c2c000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c30000, 16384, PROT_READ|PROT_WRITE) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=82607, tv_nsec=554225360}) = 0
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
epoll_create(32000) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
mprotect(0x33c34000, 16384, PROT_READ|PROT_WRITE) = 0
socketpair(AF_UNIX, SOCK_STREAM, 0, [4, 5]) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl64(5, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK) = 0
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
pipe2([6, 7], O_NONBLOCK|O_CLOEXEC) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=6, u64=18446744069414584326}}) = 0
gettid() = 2911
mprotect(0x33c38000, 16384, PROT_READ|PROT_WRITE) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=82607, tv_nsec=568145684}) = 0
mprotect(0x33c3c000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c40000, 16384, PROT_READ|PROT_WRITE) = 0
gettid() = 2911
gettid() = 2911
gettid() = 2911
gettid() = 2911
getpid() = 2911
gettid() = 2911
gettid() = 2911
gettid() = 2911
gettid() = 2911
mprotect(0x33c44000, 16384, PROT_READ|PROT_WRITE) = 0
mprotect(0x33c48000, 16384, PROT_READ|PROT_WRITE) = 0
gettid() = 2911
gettid() = 2911
gettid() = 2911
open("/sys/devices/system/cpu", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 8
fstat64(8, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
mprotect(0x33c4c000, 40960, PROT_READ|PROT_WRITE) = 0
getdents64(8, /* 14 entries */, 32768) = 400
getdents64(8, /* 0 entries */, 32768) = 0
madvise(0x33c08000, 16384, MADV_DONTNEED) = -1 ENOSYS (Function not implemented)
--- SIGTRAP {si_signo=SIGTRAP, si_code=TRAP_BRKPT} ---
+++ killed by SIGTRAP (core dumped) +++
Trace/breakpoint trap (core dumped)
#0 0x55abbbcc in partition_alloc::DecommitSystemPages(unsigned int, unsigned int, partition_alloc::PageAccessibilityDisposition) ()
The error was from some syscalls. I need strace for this:
strace -f /tmp/naive
See what we get.
大佬,我这玩意儿还有救不?
madvise(0x33c08000, 16384, MADV_DONTNEED) = -1 ENOSYS (Function not implemented)
不支持madvise
如果能刷openwrt会简单一点,如果不能刷openwrt,
madvise(0x33c08000, 16384, MADV_DONTNEED) = -1 ENOSYS (Function not implemented)
不支持madvise如果能刷openwrt会简单一点,如果不能刷openwrt,
哎。。。本来想简单点,结果这样就又复杂了。。。
madvise(0x33c08000, 16384, MADV_DONTNEED) = -1 ENOSYS (Function not implemented)
不支持madvise如果能刷openwrt会简单一点,如果不能刷openwrt,
xray太大,路由器都放不下。。。没意思。。。
感谢,好像能跑起来,只是我的VPS被封了,没法连接测试不过./naive -h没有报错。。。过两天再搞个VPS试试。。。
他给我提示 Trace/breakpoint trap (core dumped) 。。。 我的路由器是EdgeRouter-X是EdgeOS基于mipsel的Debian9
就像这样