Closed MilanKosticKIT closed 5 years ago
Wahrscheinlich ist nur das hier wichtig:
==16273== Address 0x60d88ef is 0 bytes after a block of size 8,191 alloc'd ==16273== at 0x4C298A0: operator new[](unsigned long) (vg_replace_malloc.c:389) ==16273== by 0x404479: DMap::DMap() (dmap.h:22) ==16273== by 0x401B75: MyFS::MyFS() (myfs.cpp:34) ==16273== by 0x401B03: MyFS::Instance() (myfs.cpp:29) ==16273== by 0x403EFB: wrap_init (wrap.cpp:89) ==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4043E5: main (mount.myfs.c:105)
wir mussten unsere arrays von stack zu heap transferieren, da wir segmentation errors wegen größe bekommen haben (stack zu klein). dann bekamen wir obige fehler. es lag schlussendlich daran, dass man an die read-methode in filesystemIO einen array übergeben muss, aber durch die verschiebung auf den heap wurde durch das new statement nur ein pointer auf den array übergeben. mit dem kam die methode nicht zurecht.
Work the valgrind log:
==16273== Memcheck, a memory error detector ==16273== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==16273== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==16273== Command: ./mount.myfs DATEISYSTEM logfile m -f -s ==16273== Containerfile= /vol/cifs/hsfs01/home/ilha1011/.nt/BSLab/BetriebssystemeUebung/DATEISYSTEM Logfile= /vol/cifs/hsfs01/home/ilha1011/.nt/BSLab/BetriebssystemeUebung/logfile Mountpoint= /vol/cifs/hsfs01/home/ilha1011/.nt/BSLab/BetriebssystemeUebung/m ==16273== Invalid write of size 1 ==16273== at 0x40449E: DMap::DMap() (dmap.cpp:14) ==16273== by 0x401B75: MyFS::MyFS() (myfs.cpp:34) ==16273== by 0x401B03: MyFS::Instance() (myfs.cpp:29) ==16273== by 0x403EFB: wrap_init (wrap.cpp:89) ==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4043E5: main (mount.myfs.c:105) ==16273== Address 0x60d88ef is 0 bytes after a block of size 8,191 alloc'd ==16273== at 0x4C298A0: operator new[](unsigned long) (vg_replace_malloc.c:389) ==16273== by 0x404479: DMap::DMap() (dmap.h:22) ==16273== by 0x401B75: MyFS::MyFS() (myfs.cpp:34) ==16273== by 0x401B03: MyFS::Instance() (myfs.cpp:29) ==16273== by 0x403EFB: wrap_init (wrap.cpp:89) ==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3) ==16273== by 0x4043E5: main (mount.myfs.c:105) ==16273== ==16273== Syscall param lseek(fd) contains uninitialised byte(s) ==16273== at 0x58A40B0: lseek_nocancel (syscall-template.S:81) ==16273== by 0x4018F0: BlockDevice::read(unsigned int, char) (blockdevice.cpp:91) ==16273== by 0x403768: void FilesystemIO::readDevice(unsigned long, SuperBlock&) (filesystemIO.h:67)
==16273== by 0x403320: MyFS::fuseInit(fuse_conn_info ) (myfs.cpp:396)
==16273== by 0x403F0D: wrap_init (wrap.cpp:89)
==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4043E5: main (mount.myfs.c:105)
==16273==
==16273== Syscall param lseek(fd) contains uninitialised byte(s)
==16273== at 0x58A40B0: __lseek_nocancel (syscall-template.S:81)
==16273== by 0x4018F0: BlockDevice::read(unsigned int, char) (blockdevice.cpp:91)
==16273== by 0x40381C: void FilesystemIO::readDevice<unsigned short>(unsigned long, unsigned short&) (filesystemIO.h:67)
==16273== by 0x40333C: MyFS::fuseInit(fuse_conn_info) (myfs.cpp:397)
==16273== by 0x403F0D: wrap_init (wrap.cpp:89)
==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4043E5: main (mount.myfs.c:105)
==16273==
==16273== Syscall param lseek(fd) contains uninitialised byte(s)
==16273== at 0x58A40B0: lseek_nocancel (syscall-template.S:81)
==16273== by 0x4018F0: BlockDevice::read(unsigned int, char) (blockdevice.cpp:91)
==16273== by 0x40381C: void FilesystemIO::readDevice<unsigned short>(unsigned long, unsigned short&) (filesystemIO.h:67)
==16273== by 0x403358: MyFS::fuseInit(fuse_conn_info) (myfs.cpp:398)
==16273== by 0x403F0D: wrap_init (wrap.cpp:89)
==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4043E5: main (mount.myfs.c:105)
==16273==
==16273== Syscall param lseek(fd) contains uninitialised byte(s)
==16273== at 0x58A40B0: __lseek_nocancel (syscall-template.S:81)
==16273== by 0x4018F0: BlockDevice::read(unsigned int, char) (blockdevice.cpp:91)
==16273== by 0x4038D0: void FilesystemIO::readDevice<fileStats>(unsigned long, fileStats&) (filesystemIO.h:67)
==16273== by 0x403374: MyFS::fuseInit(fuse_conn_info) (myfs.cpp:399)
==16273== by 0x403F0D: wrap_init (wrap.cpp:89)
==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4043E5: main (mount.myfs.c:105)
==16273==
==16273== Invalid read of size 2
==16273== at 0x404B04: FAT::setAll(char) (fat.cpp:74)
==16273== by 0x4033A9: MyFS::fuseInit(fuse_conn_info) (myfs.cpp:401)
==16273== by 0x403F0D: wrap_init (wrap.cpp:89)
==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4043E5: main (mount.myfs.c:105)
==16273== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==16273==
==16273==
==16273== Process terminating with default action of signal 11 (SIGSEGV)
==16273== Access not within mapped region at address 0x0
==16273== at 0x404B04: FAT::setAll(char) (fat.cpp:74)
==16273== by 0x4033A9: MyFS::fuseInit(fuse_conn_info) (myfs.cpp:401)
==16273== by 0x403F0D: wrap_init (wrap.cpp:89)
==16273== by 0x4E465DA: fuse_fs_init (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4A8DB: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E4B894: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E47F9B: fuse_session_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E404E7: fuse_loop (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4E508E6: ??? (in /lib/x86_64-linux-gnu/libfuse.so.2.9.3)
==16273== by 0x4043E5: main (mount.myfs.c:105)
==16273== If you believe this happened as a result of a stack
==16273== overflow in your program's main thread (unlikely but
==16273== possible), you can try to increase the size of the
==16273== main thread stack using the --main-stacksize= flag.
==16273== The main thread stack size used in this run was 8388608.
==16273==
==16273== HEAP SUMMARY:
==16273== in use at exit: 20,534,763 bytes in 24 blocks
==16273== total heap usage: 48 allocs, 24 frees, 20,568,715 bytes allocated
==16273==
==16273== LEAK SUMMARY:
==16273== definitely lost: 139,262 bytes in 2 blocks
==16273== indirectly lost: 0 bytes in 0 blocks
==16273== possibly lost: 19,922,640 bytes in 1 blocks
==16273== still reachable: 472,861 bytes in 21 blocks
==16273== suppressed: 0 bytes in 0 blocks
==16273== Rerun with --leak-check=full to see details of leaked memory
==16273==
==16273== For counts of detected and suppressed errors, rerun with: -v
==16273== Use --track-origins=yes to see where uninitialised values come from
==16273== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
Segmentation fault