[Nasm-bugs] [Bug 3392727] stack-use-after-scope on preproc.c:5225

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Mon Jan 4 11:52:15 PST 2021


https://bugzilla.nasm.us/show_bug.cgi?id=3392727

--- Comment #3 from Igor Munkin <imun at cpan.org> ---
> I use the NASM 2.15.05 from github

I tried 2.15.05 (214f2d4c) -- still no stack-use-after-scope:
$ git describe
nasm-2.15.05
$ ./autogen.sh && ./configure --enable-sanitizer --enable-gdb
--disable-optimization && make -j
<snipped>
$ ./nasm --version
NASM version 2.15.05 compiled on Jan  4 2021
$ md5sum POC
5953d2812c42cc9f5219ecfb87554e4c  POC
$ ./nasm -f bin POC -o tmp
./nasm -f bin POC -o tmp
POC:1: error: label or instruction expected at start of line
POC:3: warning: label alone on a line without a colon might be in error
[-w+label-orphan]
POC:4: error: label or instruction expected at start of line
POC:5: warning: label alone on a line without a colon might be in error
[-w+label-orphan]
POC:7: error: parser: instruction expected
POC:8: warning: unterminated string [-w+other]
POC:8: error: label or instruction expected at start of line
POC:9: error: label or instruction expected at start of line
POC:10: warning: label alone on a line without a colon might be in error
[-w+label-orphan]
POC:12: warning: label alone on a line without a colon might be in error
[-w+label-orphan]
POC:13: warning: unterminated string [-w+other]
POC:14: warning: unterminated string [-w+other]
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:14: error: label or instruction expected at start of line
POC:15: error: comma, colon, decorator or end of line expected after operand
POC:18: error: label or instruction expected at start of line
POC:19: error: invalid size type for `%local' missing directive
POC:20: error: label or instruction expected at start of line
POC:22: error: parser: instruction expected
POC:23: error: label or instruction expected at start of line
POC:24: warning: label alone on a line without a colon might be in error
[-w+label-orphan]
POC:25: error: parser: instruction expected
POC:26: warning: unterminated %[ construct [-w+other]
POC:26: error: parser: instruction expected
POC:28: error: parser: instruction expected
POC:29: error: label or instruction expected at start of line

=================================================================
==16927==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 176 byte(s) in 16 object(s) allocated from:
    #0 0x7f514fde5908 in __interceptor_malloc
/var/tmp/portage/sys-devel/gcc-9.3.0-r1/work/gcc-9.3.0/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x557a052efd53 in nasm_malloc nasmlib/alloc.c:55
    #2 0x557a052f01a0 in nasm_strcat nasmlib/alloc.c:139
    #3 0x557a053247ec in find_label asm/labels.c:235
    #4 0x557a05324df1 in lookup_label asm/labels.c:277
    #5 0x557a05376100 in expr6 asm/eval.c:971
    #6 0x557a0537537a in expr6 asm/eval.c:859
    #7 0x557a0537421e in expr5 asm/eval.c:627
    #8 0x557a05374156 in expr4 asm/eval.c:602
    #9 0x557a05373f09 in expr3 asm/eval.c:563
    #10 0x557a05373df5 in expr2 asm/eval.c:537
    #11 0x557a05373ce3 in expr1 asm/eval.c:511
    #12 0x557a05373bd1 in expr0 asm/eval.c:485
    #13 0x557a053738e1 in rexp3 asm/eval.c:422
    #14 0x557a053737c1 in rexp2 asm/eval.c:396
    #15 0x557a0537369e in rexp1 asm/eval.c:369
    #16 0x557a0537357d in rexp0 asm/eval.c:342
    #17 0x557a0537348b in cexpr asm/eval.c:305
    #18 0x557a0537347c in bexpr asm/eval.c:298
    #19 0x557a0537687f in evaluate asm/eval.c:1032
    #20 0x557a0533266d in parse_line asm/parser.c:994
    #21 0x557a052eb8af in assemble_file asm/nasm.c:1736
    #22 0x557a052e46d8 in main asm/nasm.c:714
    #23 0x7f514f1d9eda in __libc_start_main (/lib64/libc.so.6+0x23eda)

Direct leak of 176 byte(s) in 1 object(s) allocated from:
    #0 0x7f514fde5af8 in __interceptor_calloc
/var/tmp/portage/sys-devel/gcc-9.3.0-r1/work/gcc-9.3.0/libsanitizer/asan/asan_malloc_linux.cc:153
    #1 0x557a052efdcc in nasm_calloc nasmlib/alloc.c:72
    #2 0x557a052efe4e in nasm_zalloc nasmlib/alloc.c:87
    #3 0x557a05355d47 in do_directive asm/preproc.c:4335
    #4 0x557a0536a9de in pp_tokline asm/preproc.c:6860
    #5 0x557a0536b43d in pp_getline asm/preproc.c:6923
    #6 0x557a052eb95d in assemble_file asm/nasm.c:1723
    #7 0x557a052e46d8 in main asm/nasm.c:714
    #8 0x7f514f1d9eda in __libc_start_main (/lib64/libc.so.6+0x23eda)

Indirect leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f514fde5af8 in __interceptor_calloc
/var/tmp/portage/sys-devel/gcc-9.3.0-r1/work/gcc-9.3.0/libsanitizer/asan/asan_malloc_linux.cc:153
    #1 0x557a052efdcc in nasm_calloc nasmlib/alloc.c:72
    #2 0x557a052efe4e in nasm_zalloc nasmlib/alloc.c:87
    #3 0x557a0536aaad in pp_tokline asm/preproc.c:6872
    #4 0x557a0536b43d in pp_getline asm/preproc.c:6923
    #5 0x557a052eb95d in assemble_file asm/nasm.c:1723
    #6 0x557a052e46d8 in main asm/nasm.c:714
    #7 0x7f514f1d9eda in __libc_start_main (/lib64/libc.so.6+0x23eda)

SUMMARY: AddressSanitizer: 632 byte(s) leaked in 24 allocation(s).

Is there anything that I did wrong to reproduce the issue?

-- 
You are receiving this mail because:
You are watching all bug changes.
You are on the CC list for the bug.


More information about the Nasm-bugs mailing list