View Issue Details

IDProjectCategoryView StatusLast Update
0000614filegeneralpublic2017-05-12 19:48
Reporterwasatchpaul 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSLinuxOS Version
Product Version5.20 
Target VersionFixed in Version 
Summary0000614: Valgrind use of uninitialized value error
DescriptionThe attached archive contains a cpp file that loads the files in the files subdirectory and calls magic_buffer on each. After the 68th file, valgrind (tested with v3.9.0 and v3.11.0) reports the following error:

(previous output omitted)
files/file68: text/plain
==31846== Conditional jump or move depends on uninitialised value(s)
==31846== at 0x4E3EC93: ??? (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E3FF22: ??? (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E3F9FC: file_softmagic (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E417E8: file_ascmagic_with_encoding (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E41B82: file_ascmagic (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E44AE1: file_buffer (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E3A14B: magic_buffer (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x400D60: main (in /home/paul/tmp/magic_buffer_error/magic_buffer_error)
==31846== Uninitialised value was created by a heap allocation
==31846== at 0x4C27BE3: malloc (vg_replace_malloc.c:299)
==31846== by 0x4E413B3: file_ascmagic_with_encoding (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E41B82: file_ascmagic (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E44AE1: file_buffer (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x4E3A14B: magic_buffer (in /usr/lib64/libmagic.so.1.0.0)
==31846== by 0x400D60: main (in /home/paul/tmp/magic_buffer_error/magic_buffer_error)
==31846==
files/file69: text/plain
==31846==
==31846== HEAP SUMMARY:
==31846== in use at exit: 0 bytes in 0 blocks
==31846== total heap usage: 204,695 allocs, 204,695 frees, 42,886,172 bytes allocated
==31846==
==31846== All heap blocks were freed -- no leaks are possible
==31846==
==31846== For counts of detected and suppressed errors, rerun with: -v
==31846== ERROR SUMMARY: 4 errors from 1 contexts (suppressed: 0 from 0)
Steps To Reproduce1) tar xzf magic_buffer_error.tar.gz
2) cd magic_buffer_error
3) make
4) valgrind --track-origins=yes ./magic_buffer_error
TagsNo tags attached.

Relationships

Activities

wasatchpaul

wasatchpaul

2017-05-12 19:48

reporter  

magic_buffer_error.tar.gz (109,523 bytes)

Issue History

Date Modified Username Field Change
2017-05-12 19:48 wasatchpaul New Issue
2017-05-12 19:48 wasatchpaul File Added: magic_buffer_error.tar.gz