Closed BCourteaud76 closed 5 years ago
le probleme est la ligne : Aliste.c 16 p->val = node;
p= (ALIST) calloc(1, sizeof (ALIST)); cette ligne est accepté par le compilo, et ça me parrait louche, il ne faut pas une étoile en plus sur la (ALIST) par rapport au sizeof(ALIST) ???
ça expliquerait le probleme d'allocation juste après ? ...
voila voila :
taille de ALIST : 8 taille de NODE : 160
or NODE est dans ALIST, non ?
résolue de manière sale (très sale !!!)
AHA
==7365== Invalid write of size 8 ==7365== at 0x400F85: Aliste_ajout_tete (Alist.c:16) ==7365== by 0x400B76: Astar (Astar.c:47) ==7365== by 0x4016BD: main (main.c:18) ==7365== Address 0x55498e8 is 0 bytes after a block of size 8 alloc'd ==7365== at 0x4C2B9B5: calloc (vg_replace_malloc.c:711) ==7365== by 0x400F63: Aliste_ajout_tete (Alist.c:15) ==7365== by 0x400B76: Astar (Astar.c:47) ==7365== by 0x4016BD: main (main.c:18) ==7365==
valgrind: m_mallocfree.c:307 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed. valgrind: Heap block lo/hi size mismatch: lo = 80, hi = 0. 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: ==7365== at 0x5803FC3D: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x5803FD54: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x5803FEE1: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x5804D9F3: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x580390AB: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x58037923: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x5803BB1B: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x58036D3B: ??? (in /usr/lib64/valgrind/memcheck-amd64-linux) ==7365== by 0x1002C727FA: ??? ==7365== by 0x1002BA9F2F: ??? ==7365== by 0x10020082FF: ??? ==7365== by 0x400F63: Aliste_ajout_tete (Alist.c:15) ==7365== by 0x1C0F: ??? ==7365== by 0x10020082FF: ???
sched status: running_tid=1
Thread 1: status = VgTs_Runnable (lwpid 7365) ==7365== at 0x400F90: Aliste_ajout_tete (Alist.c:17) ==7365== by 0x400B76: Astar (Astar.c:47) ==7365== by 0x4016BD: main (main.c:18)