[Nasm-bugs] [Bug 3392751] New: Read of Uninitialized Value on calcsize (asm/assemble.c)

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Sun May 2 23:43:35 PDT 2021


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

            Bug ID: 3392751
           Summary: Read of Uninitialized Value on calcsize
                    (asm/assemble.c)
           Product: NASM
           Version: 2.16 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: mvanotti at protonmail.com
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Built from git using configure

Reproducer program:

```
mov ax,xmm0[dword 0x1]
```

Valgrind output:

```
$ valgrind ./nasm -felf64 rr/repro.1 
==3137481== Memcheck, a memory error detector
==3137481== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3137481== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3137481== Command: ./nasm -felf64 rr/repro.1
==3137481== 
==3137481== Conditional jump or move depends on uninitialised value(s)
==3137481==    at 0x48E21C2: __vfprintf_internal (vfprintf-internal.c:1688)
==3137481==    by 0x48F7119: __vsnprintf_internal (vsnprintf.c:114)
==3137481==    by 0x166284: vsnprintf (stdio2.h:80)
==3137481==    by 0x166284: nasm_vaxprintf (asprintf.c:57)
==3137481==    by 0x165EEE: nasm_verror (nasm.c:2092)
==3137481==    by 0x1685A7: nasm_nonfatal (error.c:75)
==3137481==    by 0x16D205: calcsize.isra.0 (assemble.c:1619)
==3137481==    by 0x16ED29: insn_size (assemble.c:1178)
==3137481==    by 0x165936: process_insn (nasm.c:1598)
==3137481==    by 0x165936: assemble_file (nasm.c:1737)
==3137481==    by 0x162F38: main (nasm.c:717)
==3137481== 
==3137481== Conditional jump or move depends on uninitialised value(s)
==3137481==    at 0x48E21C2: __vfprintf_internal (vfprintf-internal.c:1688)
==3137481==    by 0x48F7119: __vsnprintf_internal (vsnprintf.c:114)
==3137481==    by 0x1662CA: vsnprintf (stdio2.h:80)
==3137481==    by 0x1662CA: nasm_vaxprintf (asprintf.c:63)
==3137481==    by 0x165EEE: nasm_verror (nasm.c:2092)
==3137481==    by 0x1685A7: nasm_nonfatal (error.c:75)
==3137481==    by 0x16D205: calcsize.isra.0 (assemble.c:1619)
==3137481==    by 0x16ED29: insn_size (assemble.c:1178)
==3137481==    by 0x165936: process_insn (nasm.c:1598)
==3137481==    by 0x165936: assemble_file (nasm.c:1737)
==3137481==    by 0x162F38: main (nasm.c:717)
==3137481== 
rr/repro.1:1: error: (null)
==3137481== 
==3137481== HEAP SUMMARY:
==3137481==     in use at exit: 164,452 bytes in 18 blocks
==3137481==   total heap usage: 977 allocs, 959 frees, 571,653 bytes allocated
==3137481== 
==3137481== LEAK SUMMARY:
==3137481==    definitely lost: 4,136 bytes in 2 blocks
==3137481==    indirectly lost: 0 bytes in 0 blocks
==3137481==      possibly lost: 0 bytes in 0 blocks
==3137481==    still reachable: 160,316 bytes in 16 blocks
==3137481==         suppressed: 0 bytes in 0 blocks
==3137481== Rerun with --leak-check=full to see details of leaked memory
==3137481== 
==3137481== Use --track-origins=yes to see where uninitialised values come from
==3137481== For lists of detected and suppressed errors, rerun with: -s
==3137481== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
```

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


More information about the Nasm-bugs mailing list