0x7CFE / llst

LLVM powered Little Smalltalk.
Other
93 stars 10 forks source link

Valgrind complains about accessing static heap #3

Closed kpp closed 11 years ago

kpp commented 11 years ago
$ valgrind ./llst
==24035== Memcheck, a memory error detector
==24035== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==24035== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==24035== Command: ./llst
==24035== 
Image read complete. Loaded 5638 objects
==24035== Invalid write of size 4
==24035==    at 0x8105AB9: main (main.cpp:110)
==24035==  Address 0x451d99c is 0 bytes after a block of size 305,516 alloc'd
==24035==    at 0x402C418: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==24035==    by 0x812CC03: BakerMemoryManager::initializeStaticHeap(unsigned int) (BakerMemoryManager.cpp:61)
==24035==    by 0x81136D1: Image::loadImage(char const*) (Image.cpp:225)
==24035==    by 0x810565C: main (main.cpp:51)
==24035== 
==24035== Invalid read of size 4
==24035==    at 0x8119CE6: SmalltalkVM::execute(TProcess*, unsigned int) (vm.cpp:217)
==24035==  Address 0x451d99c is 0 bytes after a block of size 305,516 alloc'd
==24035==    at 0x402C418: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==24035==    by 0x812CC03: BakerMemoryManager::initializeStaticHeap(unsigned int) (BakerMemoryManager.cpp:61)
==24035==    by 0x81136D1: Image::loadImage(char const*) (Image.cpp:225)
==24035==    by 0x810565C: main (main.cpp:51)
==24035== 
==24035== Invalid read of size 4
==24035==    at 0x8119D83: SmalltalkVM::execute(TProcess*, unsigned int) (memory.h:126)
==24035==  Address 0x451d99c is 0 bytes after a block of size 305,516 alloc'd
==24035==    at 0x402C418: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==24035==    by 0x812CC03: BakerMemoryManager::initializeStaticHeap(unsigned int) (BakerMemoryManager.cpp:61)
==24035==    by 0x81136D1: Image::loadImage(char const*) (Image.cpp:225)
==24035==    by 0x810565C: main (main.cpp:51)
==24035== 
kpp commented 11 years ago

Task #1 closes this bug.

0x7CFE commented 11 years ago

Does the actual mechanism of eliminating the bug is clear? Could you please provide a scenario in which #1 fixes the invalid memory access?

kpp commented 10 years ago

It's not clear to me why #1 closes the bug, but it does.