linuxep / lepd

server daemon of LEP
45 stars 40 forks source link

segment fault happens in rmlink when call cgtop #26

Open chensong2000 opened 6 years ago

chensong2000 commented 6 years ago

i stepped in with gdb, found something wrong in strjoin:

Program terminated with signal SIGABRT, Aborted.

0 0x00007ffff7323428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54

54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt

0 0x00007ffff7323428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54

1 0x00007ffff732502a in __GI_abort () at abort.c:89

2 0x00007ffff736b2e8 in __malloc_assert (assertion=assertion@entry=0x7ffff747f398 "(unsigned long) (size) >= (unsigned long) (nb)", file=file@entry=0x7ffff747bb85 "malloc.c",

line=line@entry=3722, function=function@entry=0x7ffff747f9a8 <__func__.11733> "_int_malloc") at malloc.c:301

3 0x00007ffff73709b3 in _int_malloc (av=av@entry=0x7ffff76b2b20 , bytes=bytes@entry=13) at malloc.c:3722

4 0x00007ffff7372184 in __GI___libc_malloc (bytes=13) at malloc.c:2913

5 0x0000000000408dfe in strjoin (x=0x43f330 "/") at src/cgtop.c:63

6 0x0000000000409fc4 in cg_read_subgroup (controller=0x43f384 "cpuacct", path=0x43f330 "/", iteration=0, depth=0, d=0x92ea20) at src/cgtop.c:474

7 0x0000000000409ed5 in refresh_one (controller=0x43f384 "cpuacct", path=0x43f330 "/", iteration=0, depth=0) at src/cgtop.c:446

8 0x000000000040a083 in refresh (iteration=0) at src/cgtop.c:498

9 0x000000000040a5e7 in cgtop_main (argc=1, argv=0x7fffffffe240) at src/cgtop.c:616

10 0x00000000004081de in run_builtin_cmd (ctx=0x7fffffffe3a0, params=0x0, id=0x0) at /root/lepd/src/server.c:206

11 0x000000000040465a in invoke_procedure (server=0x673940 , conn=0x69d3d0, name=0x69d550 "GetCmdCgtop", params=0x0, id=0x0) at /root/lepd/src/jsonrpc-c.c:87

12 0x000000000040482f in eval_request (server=0x673940 , conn=0x69d3d0, root=0x69d4c0) at /root/lepd/src/jsonrpc-c.c:122

13 0x0000000000404af3 in connection_cb (loop=0x7ffff7dd68e0, w=0x69d3d0, revents=1) at /root/lepd/src/jsonrpc-c.c:180

14 0x00007ffff7bccd73 in ev_invoke_pending () from /usr/lib/x86_64-linux-gnu/libev.so.4

15 0x00007ffff7bd03de in ev_run () from /usr/lib/x86_64-linux-gnu/libe