Bonjour,
Je doit rendre un projet en C dont le but est de manipuler des graphes.J'ai un problème de fuite de mémoire dans min programme et je cherche quelqu'un pour m'expliquer les erreurs dans mon code avec valgrind cordialement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ==6463== Memcheck, a memory error detector ==6463== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==6463== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==6463== Command: ./a.out ==6463== il y a 10 ars dans le fichier il y a 8 sommets dans le fichier sommet ds la fonction 8 2--1 1--5 5--2 3--5 7--7 8--1 3--1 2 1 5 3 7 8 3 ==6463== Invalid write of size 8 ==6463== at 0x4C2FD73: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6463== by 0x4EB0412: _IO_file_xsgetn (fileops.c:1387) ==6463== by 0x4EA593E: fread (iofread.c:42) ==6463== by 0x400C22: symetrisation (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x400F00: lirePfg (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x401120: main (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== Address 0x51fcd00 is 32 bytes inside a block of size 36 alloc'd ==6463== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6463== by 0x400C01: symetrisation (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x400F00: lirePfg (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x401120: main (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== ==6463== Invalid write of size 8 ==6463== at 0x4C2FD73: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6463== by 0x4EB0412: _IO_file_xsgetn (fileops.c:1387) ==6463== by 0x4EA593E: fread (iofread.c:42) ==6463== by 0x400C5F: symetrisation (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x400F00: lirePfg (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x401120: main (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== Address 0x51fcd20 is 16 bytes after a block of size 48 in arena "client" ==6463== valgrind: m_mallocfree.c:304 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed. valgrind: Heap block lo/hi size mismatch: lo = 112, hi = 12884901889. This is probably caused by your program erroneously writing past the end of a heap block and corrupting heap metadata. If you fix any invalid writes reported by Memcheck, this assertion failure will probably go away. Please try that before reporting this as a bug. host stacktrace: ==6463== at 0x3805DB16: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x3805DC24: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x3805DDA6: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x3806AB83: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x380571EB: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x38055CCB: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x38059B3B: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x380552C7: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x38000AD9: ??? (in /usr/lib/valgrind/memcheck-amd64-linux) ==6463== by 0x802C460D1: ??? ==6463== by 0x802B99EEF: ??? sched status: running_tid=1 Thread 1: status = VgTs_Runnable ==6463== at 0x400C7E: symetrisation (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x400F00: lirePfg (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) ==6463== by 0x401120: main (in /home/fabien/Bureau/projet_C_13mai/tpc-soutien2/pfg_vers_sommet/a.out) |
+0
-0