qa/1079 segfault in pcp-atop replay

"Mark Goodwin" <[email protected]>
Newsgroups gmane.comp.sysutils.pcp
Message-ID <[email protected]>
Anyone else seeing this? Or is just me??
1079.segfault.txt (text/plain, 7.8 KB)
# /usr/libexec/pcp/bin/pcp-atop -w tmp.atop 1 5

# gdb /usr/libexec/pcp/bin/pcp-atop
...

(gdb) run -r tmp.atop 1
...
Program received signal SIGSEGV, Segmentation fault.
__pmLogResetInterp (ctxp=ctxp@entry=0x55555579f060) at interp.c:1768
    for (icp = pcp->first; icp != NULL; icp = icp->next) {
Missing separate debuginfos, use: dnf debuginfo-install dbus-libs-1.11.8-1.fc24.x86_64 libselinux-2.5-12.fc24.x86_64 lz4-1.7.3-1.fc24.x86_64 ncurses-libs-6.0-6.20160709.fc24.x86_64 nspr-4.13.1-1.fc24.x86_64 nss-3.27.0-1.2.fc24.x86_64 nss-softokn-freebl-3.27.0-1.0.fc24.x86_64 nss-util-3.27.0-1.0.fc24.x86_64 pcre-8.39-6.fc24.x86_64 systemd-libs-229-16.fc24.x86_64  0%

(gdb) where
#0  __pmLogResetInterp (ctxp=ctxp@entry=0x55555579f060) at interp.c:1768
#1  0x00007ffff79618c2 in pmSetMode (mode=16908289, when=0x555555796b70 <curtime>, delta=1000) at fetch.c:265
#2  0x000055555557dc03 in fetch_metrics (purpose=purpose@entry=0x55555558188d "system", 
    nmetrics=nmetrics@entry=242, pmids=pmids@entry=0x555555794ba0 <pmids>, result=result@entry=0x7fffffffcb00)
    at various.c:893
#3  0x0000555555569f8e in photosyst (si=0x5555557add80) at photosyst.c:241
#4  0x000055555555f6b8 in engine () at atop.c:572
#5  0x000055555555ed8e in main (argc=4, argv=<optimized out>) at atop.c:461

(gdb) l
1763	    t_req = __pmTimevalSub(&ctxp->c_origin, __pmLogStartTime(ctxp->c_archctl));
1764	
1765	    for (k = 0; k < hcp->hsize; k++) {
1766		for (hp = hcp->hash[k]; hp != NULL; hp = hp->next) {
1767		    pcp = (pmidcntl_t *)hp->data;
1768		    for (icp = pcp->first; icp != NULL; icp = icp->next) {
1769			if (icp->t_prior > t_req || icp->t_next < t_req) {
1770			    icp->t_prior = icp->t_next = -1;
1771			    SET_UNDEFINED(icp->s_prior);
1772			    SET_UNDEFINED(icp->s_next);
(gdb) p icp
$1 = <optimized out>
(gdb) p pcp
$2 = (pmidcntl_t *) 0x0
(gdb) p *hp
$3 = {next = 0x0, key = 0, data = 0x0}
(gdb) p k
$4 = 54
(gdb) up
#1  0x00007ffff79618c2 in pmSetMode (mode=16908289, when=0x555555796b70 <curtime>, delta=1000) at fetch.c:265
265			__pmLogResetInterp(ctxp);
(gdb) p ctxp
$1 = (__pmContext *) 0x55555579f060
(gdb) p *ctxp
$2 = {c_lock = {__data = {__lock = 1, __count = 1, __owner = 32618, __nusers = 1, __kind = 1, __spins = 0, __elision = 0, 
      __list = {__prev = 0x0, __next = 0x0}}, 
    __size = "\001\000\000\000\001\000\000\000j\177\000\000\001\000\000\000\001", '\000' <repeats 22 times>, 
    __align = 4294967297}, c_type = 2, c_mode = 16908289, c_pmcd = 0x0, c_archctl = 0x55555579f110, c_origin = {
    tv_sec = 1481855510, tv_usec = 154992}, c_delta = 1000, c_sent = 0, c_instprof = 0x5555557b5070, c_dm = 0x5555557abba0, 
  c_flags = 0, c_attrs = {nodes = 0, hsize = 0, hash = 0x0, next = 0x0, index = 0}}
(gdb) up
#2  0x000055555557dc03 in fetch_metrics (purpose=purpose@entry=0x55555558188d "system", nmetrics=nmetrics@entry=242, 
    pmids=pmids@entry=0x555555794ba0 <pmids>, result=result@entry=0x7fffffffcb00) at various.c:893
893		pmSetMode(fetchmode, &curtime, fetchstep);
(gdb) up
#3  0x0000555555569f8e in photosyst (si=0x5555557add80) at photosyst.c:241
241		fetch_metrics("system", SYST_NMETRICS, pmids, &result);


# valgrind /usr/libexec/pcp/bin/pcp-atop -r tmp.atop 1
==32701== Memcheck, a memory error detector
==32701== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==32701== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==32701== Command: /usr/libexec/pcp/bin/pcp-atop -r tmp.atop 1
==32701== 
==32701== Invalid read of size 1
==32701==    at 0x4C2FC43: strcmp (vg_replace_strmem.c:842)
==32701==    by 0x11BB02: deviatsyst (deviate.c:992)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701==  Address 0x9a00ea8 is 0 bytes after a block of size 200 alloc'd
==32701==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
==32701==    by 0x11DD20: sstat_alloc (photosyst.c:57)
==32701==    by 0x113521: engine (atop.c:511)
==32701==    by 0x112D8D: main (atop.c:461)
==32701== 
==32701== Conditional jump or move depends on uninitialised value(s)
==32701==    at 0x4C2FC4C: strcmp (vg_replace_strmem.c:842)
==32701==    by 0x11BB02: deviatsyst (deviate.c:992)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701== 
==32701== Invalid write of size 1
==32701==    at 0x4C32CD5: __strcpy_chk (vg_replace_strmem.c:1429)
==32701==    by 0x11B8C5: UnknownInlinedFun (string3.h:110)
==32701==    by 0x11B8C5: deviatsyst (deviate.c:1011)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701==  Address 0x9a02468 is 0 bytes after a block of size 200 alloc'd
==32701==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
==32701==    by 0x11DD20: sstat_alloc (photosyst.c:57)
==32701==    by 0x11354F: engine (atop.c:513)
==32701==    by 0x112D8D: main (atop.c:461)
==32701== 
==32701== Conditional jump or move depends on uninitialised value(s)
==32701==    at 0x4C32CD9: __strcpy_chk (vg_replace_strmem.c:1429)
==32701==    by 0x11B8C5: UnknownInlinedFun (string3.h:110)
==32701==    by 0x11B8C5: deviatsyst (deviate.c:1011)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701== 
==32701== Invalid write of size 8
==32701==    at 0x11BBD2: UnknownInlinedFun (string3.h:90)
==32701==    by 0x11BBD2: deviatsyst (deviate.c:1017)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701==  Address 0x9a00ea8 is 0 bytes after a block of size 200 alloc'd
==32701==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
==32701==    by 0x11DD20: sstat_alloc (photosyst.c:57)
==32701==    by 0x113521: engine (atop.c:511)
==32701==    by 0x112D8D: main (atop.c:461)
==32701== 
==32701== Invalid write of size 8
==32701==    at 0x11BBF6: UnknownInlinedFun (string3.h:90)
==32701==    by 0x11BBF6: deviatsyst (deviate.c:1017)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701==  Address 0x9a00eb0 is 8 bytes after a block of size 200 alloc'd
==32701==    at 0x4C2DA60: calloc (vg_replace_malloc.c:711)
==32701==    by 0x11DD20: sstat_alloc (photosyst.c:57)
==32701==    by 0x113521: engine (atop.c:511)
==32701==    by 0x112D8D: main (atop.c:461)
==32701== 
==32701== Invalid read of size 8
==32701==    at 0x11B91F: deviatsyst (deviate.c:1021)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701==  Address 0x6c8 is not stack'd, malloc'd or (recently) free'd
==32701== 
==32701== 
==32701== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==32701==  Access not within mapped region at address 0x6C8
==32701==    at 0x11B91F: deviatsyst (deviate.c:1021)
==32701==    by 0x1137EF: engine (atop.c:651)
==32701==    by 0x112D8D: main (atop.c:461)
==32701==  If you believe this happened as a result of a stack
==32701==  overflow in your program's main thread (unlikely but
==32701==  possible), you can try to increase the size of the
==32701==  main thread stack using the --main-stacksize= flag.
==32701==  The main thread stack size used in this run was 8388608.
==32701== 
==32701== HEAP SUMMARY:
==32701==     in use at exit: 2,993,216 bytes in 16,059 blocks
==32701==   total heap usage: 46,549 allocs, 30,490 frees, 37,022,489 bytes allocated
==32701== 
==32701== LEAK SUMMARY:
==32701==    definitely lost: 4,437 bytes in 57 blocks
==32701==    indirectly lost: 0 bytes in 0 blocks
==32701==      possibly lost: 2,200 bytes in 1 blocks
==32701==    still reachable: 2,986,579 bytes in 16,001 blocks
==32701==         suppressed: 0 bytes in 0 blocks
==32701== Rerun with --leak-check=full to see details of leaked memory
==32701== 
==32701== For counts of detected and suppressed errors, rerun with: -v
==32701== Use --track-origins=yes to see where uninitialised values come from
==32701== ERROR SUMMARY: 28 errors from 7 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.