evverx / elfutils

https://sourceware.org/elfutils/ with CI
GNU General Public License v3.0
0 stars 0 forks source link

memory leaks in i386_gendis #20

Open evverx opened 2 years ago

evverx commented 2 years ago
2021-12-05T03:30:44.5889934Z clang -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes    -Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra     -fdollars-in-identifiers -D_FORTIFY_SOURCE=2 -g -O1 -fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize=pointer-overflow -fno-sanitize=vla-bound -fno-addrsig -Wno-error=xor-used-as-pow -Wno-error=gnu-variable-sized-type-not-at-end -Wno-error=unused-const-variable   -o i386_gendis i386_gendis.o i386_lex.o i386_parse.o ../lib/libeu.a -lm  
2021-12-05T03:30:44.7353183Z ./i386_gendis i386_defs > i386_dis.hT
2021-12-05T03:30:44.7354537Z ./i386_gendis x86_64_defs > x86_64_dis.hT
2021-12-05T03:30:44.9676347Z 
2021-12-05T03:30:44.9677486Z =================================================================
2021-12-05T03:30:44.9678713Z ==12127==ERROR: LeakSanitizer: detected memory leaks
2021-12-05T03:30:44.9679356Z 
2021-12-05T03:30:44.9679892Z Direct leak of 16996 byte(s) in 3718 object(s) allocated from:
2021-12-05T03:30:44.9681741Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9685797Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9689474Z     #2 0x4ded1b in xstrndup /home/runner/work/elfutils/elfutils/lib/xstrndup.c:44:30
2021-12-05T03:30:44.9692263Z     #3 0x4c68eb in i386_lex /home/runner/work/elfutils/elfutils/libcpu/i386_lex.l:75:19
2021-12-05T03:30:44.9695029Z     #4 0x4cd82b in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.c:1494:16
2021-12-05T03:30:44.9699854Z 
2021-12-05T03:30:44.9701121Z =================================================================
2021-12-05T03:30:44.9702112Z     #5 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9703631Z     #6 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9704135Z 
2021-12-05T03:30:44.9704590Z ==12126==ERROR: LeakSanitizer: detected memory leaks
2021-12-05T03:30:44.9705167Z Direct leak of 10544 byte(s) in 659 object(s) allocated from:
2021-12-05T03:30:44.9705509Z 
2021-12-05T03:30:44.9705935Z Direct leak of 17088 byte(s) in 3745 object(s) allocated from:
2021-12-05T03:30:44.9706928Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9707661Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9708963Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9710422Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9711326Z     #2 0x4ded1b in xstrndup /home/runner/work/elfutils/elfutils/lib/xstrndup.c:44:30
2021-12-05T03:30:44.9712730Z     #3 0x4c68eb in i386_lex /home/runner/work/elfutils/elfutils/libcpu/i386_lex.l:75:19
2021-12-05T03:30:44.9713747Z     #4 0x4cd82b in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.c:1494:16
2021-12-05T03:30:44.9715339Z     #5 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9716515Z     #6 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9717463Z 
2021-12-05T03:30:44.9718044Z Direct leak of 10608 byte(s) in 663 object(s) allocated from:
2021-12-05T03:30:44.9718817Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9719673Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9720846Z     #2 0x4cda66 in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:473:23
2021-12-05T03:30:44.9721648Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9722755Z     #4 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9723333Z 
2021-12-05T03:30:44.9723836Z Direct leak of 1248 byte(s) in 52 object(s) allocated from:
2021-12-05T03:30:44.9724580Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9725633Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9726477Z     #2 0x4cddf1 in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:533:24
2021-12-05T03:30:44.9727655Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9728797Z     #4 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9729417Z 
2021-12-05T03:30:44.9729981Z Indirect leak of 44064 byte(s) in 1836 object(s) allocated from:
2021-12-05T03:30:44.9731111Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9732195Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9733203Z     #2 0x4cdb57 in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:492:24
2021-12-05T03:30:44.9734322Z     #2 0x4cda66 in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:473:23
2021-12-05T03:30:44.9735431Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9736643Z     #4 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9738031Z 
2021-12-05T03:30:44.9740338Z Indirect leak of 9168 byte(s) in 573 object(s) allocated from:
2021-12-05T03:30:44.9741001Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9741879Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9742921Z     #2 0x4cf44b in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:466:22
2021-12-05T03:30:44.9743647Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9744679Z     #4 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9745138Z 
2021-12-05T03:30:44.9745915Z Indirect leak of 1344 byte(s) in 56 object(s) allocated from:
2021-12-05T03:30:44.9746919Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9747662Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9748370Z     #2 0x4ce20f in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:524:24
2021-12-05T03:30:44.9749098Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9750560Z     #4 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9751171Z 
2021-12-05T03:30:44.9751577Z Indirect leak of 167 byte(s) in 52 object(s) allocated from:
2021-12-05T03:30:44.9752254Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9753327Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9754398Z     #2 0x4ded1b in xstrndup /home/runner/work/elfutils/elfutils/lib/xstrndup.c:44:30
2021-12-05T03:30:44.9755163Z     #3 0x4c6d58 in i386_lex /home/runner/work/elfutils/elfutils/libcpu/i386_lex.l:82:19
2021-12-05T03:30:44.9755877Z     #4 0x4cd82b in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.c:1494:16
2021-12-05T03:30:44.9756916Z     #5 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9757970Z     #6 0x7f9c258920b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9758460Z 
2021-12-05T03:30:44.9758973Z SUMMARY: AddressSanitizer: 83687 byte(s) leaked in 6977 allocation(s).
2021-12-05T03:30:44.9759738Z make[2]: *** [Makefile:795: i386_dis.h] Error 1
2021-12-05T03:30:44.9760676Z make[2]: *** Waiting for unfinished jobs....
2021-12-05T03:30:44.9766135Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9772624Z     #4 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9773219Z 
2021-12-05T03:30:44.9773721Z Direct leak of 1248 byte(s) in 52 object(s) allocated from:
2021-12-05T03:30:44.9776457Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9779533Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9781978Z     #2 0x4cddf1 in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:533:24
2021-12-05T03:30:44.9784532Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9791573Z     #4 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9792054Z 
2021-12-05T03:30:44.9792463Z Indirect leak of 43800 byte(s) in 1825 object(s) allocated from:
2021-12-05T03:30:44.9794628Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9796694Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9798704Z     #2 0x4cdb57 in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:492:24
2021-12-05T03:30:44.9799770Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9801514Z     #4 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9802175Z 
2021-12-05T03:30:44.9802808Z Indirect leak of 9104 byte(s) in 569 object(s) allocated from:
2021-12-05T03:30:44.9803605Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9804616Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9805425Z     #2 0x4cf44b in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:466:22
2021-12-05T03:30:44.9806647Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9808058Z     #4 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9808750Z 
2021-12-05T03:30:44.9809334Z Indirect leak of 1344 byte(s) in 56 object(s) allocated from:
2021-12-05T03:30:44.9810492Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9811496Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9812504Z     #2 0x4ce20f in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.y:524:24
2021-12-05T03:30:44.9813353Z     #3 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9814497Z     #4 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9815249Z 
2021-12-05T03:30:44.9816171Z Indirect leak of 167 byte(s) in 52 object(s) allocated from:
2021-12-05T03:30:44.9817065Z     #0 0x494b1d in malloc (/home/runner/work/elfutils/elfutils/libcpu/i386_gendis+0x494b1d)
2021-12-05T03:30:44.9818529Z     #1 0x4dedda in xmalloc /home/runner/work/elfutils/elfutils/lib/xmalloc.c:46:7
2021-12-05T03:30:44.9820381Z     #2 0x4ded1b in xstrndup /home/runner/work/elfutils/elfutils/lib/xstrndup.c:44:30
2021-12-05T03:30:44.9821457Z     #3 0x4c6d58 in i386_lex /home/runner/work/elfutils/elfutils/libcpu/i386_lex.l:82:19
2021-12-05T03:30:44.9822820Z     #4 0x4cd82b in i386_parse /home/runner/work/elfutils/elfutils/libcpu/i386_parse.c:1494:16
2021-12-05T03:30:44.9823691Z     #5 0x4c43ec in main /home/runner/work/elfutils/elfutils/libcpu/i386_gendis.c:68:3
2021-12-05T03:30:44.9825169Z     #6 0x7ff165cbd0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
2021-12-05T03:30:44.9826366Z 
evverx commented 2 years ago

The gcc part should be addressed in https://sourceware.org/pipermail/elfutils-devel/2021q4/004429.html