Hey guys I have a function here that is performing dijkstra's algorithm on a 2d matrix that accounts for hardness. The only problem is when I am going through a heap and pull out a struct called distanceCell the x and y coordinates stored in that struct are very large random numbers and I only change these values once so I think I am overwriting memory somewhere in the code. Wonder if you guys would have good idea of why?
The Error occures at this line of code alt = (*m).hardness[tempy-1][tempx]; tempy and tempx are some huge numbers in the millions and it seems random what values occure.
static void analyzeDistancesPlus(void){
int xPre;
int yPre;
for(xPre=0;xPre<80;xPre++){
for(yPre=0;yPre<21;yPre++){
distanceCell pass;
pass.distance=1000;
pass.yloc=yPre;/* 1000 will represent infinity */
pass.xloc=xPre;
(*m).distanceGrid[yPre][xPre]=pass;
}
}
(*m).distanceGrid[(*m).pcY][(*m).pcX].distance=0;
binheap_t heap;
binheap_init(&heap,compare_cell,free);
int pcXl;
int pcYl;
pcXl=(*m).pcX;
pcYl=(*m).pcY;
distanceCell root = (*m).distanceGrid[pcYl][pcXl];
root.distance=0;
binheap_insert(&heap,&root);
int tempx;
int tempy;
while(!binheap_is_empty(&heap)){
distanceCell *temp;
temp =(distanceCell*) binheap_remove_min(&heap);
tempx = (*temp).xloc;
tempy = (*temp).yloc;
int alt;
if((*m).grid[(*temp).yloc-1][(*temp).xloc]!='-' || (*m).grid[(*temp).yloc-1][(*temp).xloc]!='|'){/* top */
alt = (*m).hardness[tempy-1][tempx];
alt = alt + (*m).distanceGrid[tempy][tempx].distance;
alt++;
if((*m).distanceGrid[tempy-1][tempx].distance>alt){
(*m).distanceGrid[tempy-1][tempx].distance=alt;
distanceCell *temp0;
temp0 = &(*m).distanceGrid[tempy-1][tempx];
binheap_insert(&heap, temp0);
}
}
if((*m).grid[(*temp).yloc+1][(*temp).xloc]!='-' || (*m).grid[(*temp).yloc+1][(*temp).xloc]!='|'){/* bottom */
alt = (*m).hardness[tempy+1][tempx]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy+1][tempx].distance>alt){
(*m).distanceGrid[tempy+1][tempx].distance=(*temp).distance+1;
distanceCell *temp1;
temp1 = &(*m).distanceGrid[tempy+1][tempx];
binheap_insert(&heap,temp1);
}
}
if((*m).grid[(*temp).yloc][(*temp).xloc+1]!='-' || (*m).grid[(*temp).yloc][(*temp).xloc+1]!='|'){/* right */
alt = (*m).hardness[tempy][tempx+1]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy][tempx+1].distance>alt){
(*m).distanceGrid[tempy][tempx+1].distance=(*temp).distance+1;
distanceCell *temp2;
temp2 = &(*m).distanceGrid[tempy][tempx+1];
binheap_insert(&heap,temp2);
}
}
if((*m).grid[(*temp).yloc][(*temp).xloc-1]!='-' || (*m).grid[(*temp).yloc][(*temp).xloc-1]!='|'){/* left */
alt = (*m).hardness[tempy][tempx]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy][tempx-1].distance>alt){
(*m).distanceGrid[tempy][tempx-1].distance=alt;
distanceCell *temp3;
temp3 = &(*m).distanceGrid[tempy][tempx-1];
binheap_insert(&heap,temp3);
}
}
if((*m).grid[(*temp).yloc-1][(*temp).xloc+1]!='-' || (*m).grid[(*temp).yloc-1][(*temp).xloc+1]!='|'){/* top right */
alt = (*m).hardness[tempy-1][tempx+1]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy-1][tempx+1].distance>alt){
(*m).distanceGrid[tempy-1][tempx+1].distance=alt;
distanceCell *temp4;
temp4 = &(*m).distanceGrid[tempy-1][tempx+1];
binheap_insert(&heap,temp4);
}
}
if((*m).grid[(*temp).yloc-1][(*temp).xloc-1]!='-' || (*m).grid[(*temp).yloc-1][(*temp).xloc-1]=='|'){/* top left */
alt = (*m).hardness[tempy-1][tempx-1]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy-1][tempx-1].distance>alt){
(*m).distanceGrid[tempy-1][tempx-1].distance=alt;
distanceCell *temp5;
temp5 = &(*m).distanceGrid[tempy-1][tempx-1];
binheap_insert(&heap,temp5);
}
}
if((*m).grid[(*temp).yloc+1][(*temp).xloc-1]!='-' || (*m).grid[(*temp).yloc+1][(*temp).xloc-1]!='|'){/* bottomLeft left */
alt = (*m).hardness[tempy+1][tempx-1]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy+1][tempx-1].distance>alt){
(*m).distanceGrid[tempy+1][tempx-1].distance=alt;
distanceCell *temp6;
temp6 = &(*m).distanceGrid[tempy+1][tempx-1];
binheap_insert(&heap,temp6);
}
}
if((*m).grid[(*temp).yloc+1][(*temp).xloc+1]!='-' || (*m).grid[(*temp).yloc+1][(*temp).xloc+1]!='|'){/* bottom right */
alt = (*m).hardness[tempy+1][tempx+1]+(*m).distanceGrid[tempy][tempx].distance+1;
if((*m).distanceGrid[tempy+1][tempx+1].distance>alt){
(*m).distanceGrid[tempy+1][tempx+1].distance=alt;
distanceCell *temp7;
temp7 = &(*m).distanceGrid[tempy+1][tempx+1];
binheap_insert(&heap,temp7);
}
}
}
}
#include "heap.h"
typedef struct {
int topLeft[2];
int topright[2];
int bottomLeft[2];
int bottomRight[2];
}Room;
typedef struct{
int distance;
int xloc;
int yloc;
}distanceCell;
typedef struct {
char grid[21][80];
distanceCell distanceGrid[21][80];
unsigned char hardness[21][80];
Room rooms[100];
int numOfRooms;
int pcX;
int pcY;
}Map;
typedef struct corridor_path corridor_path_t;
int initMap(void);
void printGrid(void);
int saveGame(void);
int loadGame(void);
void printDistanceGrid(void);
==8098== Memcheck, a memory error detector
==8098== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==8098== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==8098== Command: ./ShaneDrafahl
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x439E66: __linkin_atfork (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x418253: ptmalloc_init.part.7 (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x4185DD: malloc_hook_ini (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x46AEA2: _dl_get_origin (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x43A8CE: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x413C69: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x4649B0: fillin_rpath (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x46508E: _dl_init_paths (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x43ADAC: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x413CCF: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x4649B0: fillin_rpath (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x46508E: _dl_init_paths (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x43ADAC: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x4134D8: malloc_consolidate (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x415200: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x4014B8: initMap (mapInit.c:598)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x401382: initBorder (mapInit.c:46)
==8098== by 0x4014C4: initMap (mapInit.c:599)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x401386: initBorder (mapInit.c:46)
==8098== by 0x4014C4: initMap (mapInit.c:599)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x40168F: initRooms (mapInit.c:412)
==8098== by 0x40168F: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x4016FB: initRooms (mapInit.c:430)
==8098== by 0x4016FB: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x4017AC: initRooms (mapInit.c:430)
==8098== by 0x4017AC: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x401760: initRooms (mapInit.c:436)
==8098== by 0x401760: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x401766: initRooms (mapInit.c:441)
==8098== by 0x401766: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x401814: initRooms (mapInit.c:460)
==8098== by 0x401814: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x40181F: initRooms (mapInit.c:463)
==8098== by 0x40181F: initMap (mapInit.c:600)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x40189B: initMap (mapInit.c:605)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x4018C2: initMap (mapInit.c:616)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x4018C7: initMap (mapInit.c:616)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x413C69: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x4030D5: binheap_remove_min (heap.c:152)
==8098== by 0x4019F0: analyzeDistancesPlus (mapInit.c:116)
==8098== by 0x4019F0: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x413CCF: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x4030D5: binheap_remove_min (heap.c:152)
==8098== by 0x4019F0: analyzeDistancesPlus (mapInit.c:116)
==8098== by 0x4019F0: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401AA7: analyzeDistancesPlus (mapInit.c:128)
==8098== by 0x401AA7: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x401D72: analyzeDistancesPlus (mapInit.c:177)
==8098== by 0x401D72: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401B5D: analyzeDistancesPlus (mapInit.c:139)
==8098== by 0x401B5D: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401ECD: analyzeDistancesPlus (mapInit.c:198)
==8098== by 0x401ECD: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401C9C: analyzeDistancesPlus (mapInit.c:160)
==8098== by 0x401C9C: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401C01: analyzeDistancesPlus (mapInit.c:149)
==8098== by 0x401C01: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401E20: analyzeDistancesPlus (mapInit.c:185)
==8098== by 0x401E20: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401D45: analyzeDistancesPlus (mapInit.c:171)
==8098== by 0x401D45: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x40305D: binheap_insert (heap.c:128)
==8098== by 0x401F75: analyzeDistancesPlus (mapInit.c:212)
==8098== by 0x401F75: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Conditional jump or move depends on uninitialised value(s)
==8098== at 0x4134D8: malloc_consolidate (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x415200: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x416AE0: _int_realloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x417A23: realloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==8098== by 0x403041: binheap_insert (heap.c:120)
==8098== by 0x401ECD: analyzeDistancesPlus (mapInit.c:198)
==8098== by 0x401ECD: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098==
==8098== Invalid read of size 1
==8098== at 0x401A16: analyzeDistancesPlus (mapInit.c:121)
==8098== by 0x401A16: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098== Address 0xfffffff1068ae53d is not stack'd, malloc'd or (recently) free'd
==8098==
==8098==
==8098== Process terminating with default action of signal 11 (SIGSEGV)
==8098== Access not within mapped region at address 0xFFFFFFF1068AE53D
==8098== at 0x401A16: analyzeDistancesPlus (mapInit.c:121)
==8098== by 0x401A16: initMap (mapInit.c:623)
==8098== by 0x40111F: initGame (dungeonGame327.c:35)
==8098== by 0x4010F4: main (dungeonGame327.c:25)
==8098== If you believe this happened as a result of a stack
==8098== overflow in your program's main thread (unlikely but
==8098== possible), you can try to increase the size of the
==8098== main thread stack using the --main-stacksize= flag.
==8098== The main thread stack size used in this run was 8388608.
==8098==
==8098== HEAP SUMMARY:
==8098== in use at exit: 0 bytes in 0 blocks
==8098== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==8098==
==8098== All heap blocks were freed -- no leaks are possible
==8098==
==8098== For counts of detected and suppressed errors, rerun with: -v
==8098== Use --track-origins=yes to see where uninitialised values come from
==8098== ERROR SUMMARY: 9508 errors from 29 contexts (suppressed: 0 from 0)
Segmentation fault
I am not sure what would cause that to change the tempx and the tempy to random numbers that then are too big to read inside the matrix and causes the seg fault.
The first error in the valgrind output was with initMap() on line 598. So I would start a breakpoint there in gdb and then step through how the map is initializaed with uninitialsed values.
The problem has to be in this function alone I think because the second function I posted works correctly and I know that the rest of the program works correctly as well.
You do know that in the beginning you have junk in there right? Because in you're next for loops they are dependent on values being equal to 0 but you never initialized them above.
could you re-run valgrind with > valgrind --tool=memcheck --leak-check=yes --show-reachable=yes -v ./myfile.out
the -v for verbose will show suppressed errors. If you look at the memorey locations they are all fiarly consistant untill here Address 0xfffffff1068ae53d. thats a big jump from the rest of what you were allocating.
==10910== Memcheck, a memory error detector
==10910== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==10910== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==10910== Command: ./ShaneDrafahl
==10910==
--10910-- Valgrind options:
--10910-- --tool=memcheck
--10910-- --leak-check=yes
--10910-- --show-reachable=yes
--10910-- -v
--10910-- Contents of /proc/version:
--10910-- Linux version 4.4.0-24-generic (buildd@lcy01-03) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #43~14.04.1-Ubuntu SMP Thu Jun 9 09:46:12 UTC 2016
--10910-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--10910-- Page sizes: currently 4096, max supported 4096
--10910-- Valgrind library directory: /usr/lib/valgrind
--10910-- Reading syms from /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl
--10910-- object doesn't have a dynamic symbol table
--10910-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--10910-- Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--10910-- .. CRC mismatch (computed 4f1eed43 wanted a323a3ab)
--10910-- object doesn't have a symbol table
--10910-- object doesn't have a dynamic symbol table
--10910-- Scheduler: using generic scheduler lock implementation.
--10910-- Reading suppressions file: /usr/lib/valgrind/default.supp
==10910== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-10910-by-shanedrafahl-on-???
==10910== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-10910-by-shanedrafahl-on-???
==10910== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-10910-by-shanedrafahl-on-???
==10910==
==10910== TO CONTROL THIS PROCESS USING vgdb (which you probably
==10910== don't want to do, unless you know exactly what you're doing,
==10910== or are doing some strange experiment):
==10910== /usr/lib/valgrind/../../bin/vgdb --pid=10910 ...command...
==10910==
==10910== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==10910== /path/to/gdb ./ShaneDrafahl
==10910== and then give GDB the following command
==10910== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=10910
==10910== --pid is optional if only one valgrind process is running
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x439E66: __linkin_atfork (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x418253: ptmalloc_init.part.7 (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4185DD: malloc_hook_ini (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x46AEA2: _dl_get_origin (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43A8CE: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413C69: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4649B0: fillin_rpath (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x46508E: _dl_init_paths (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43ADAC: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413CCF: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4649B0: fillin_rpath (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x46508E: _dl_init_paths (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43ADAC: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4134D8: malloc_consolidate (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x415200: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4014B8: initMap (mapInit.c:604)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401382: initBorder (mapInit.c:47)
==10910== by 0x4014C4: initMap (mapInit.c:605)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401386: initBorder (mapInit.c:47)
==10910== by 0x4014C4: initMap (mapInit.c:605)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x40168F: initRooms (mapInit.c:418)
==10910== by 0x40168F: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4016FB: initRooms (mapInit.c:436)
==10910== by 0x4016FB: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4017AC: initRooms (mapInit.c:436)
==10910== by 0x4017AC: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401760: initRooms (mapInit.c:442)
==10910== by 0x401760: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401766: initRooms (mapInit.c:447)
==10910== by 0x401766: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401814: initRooms (mapInit.c:466)
==10910== by 0x401814: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x40181F: initRooms (mapInit.c:469)
==10910== by 0x40181F: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4018C2: initMap (mapInit.c:622)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4018C7: initMap (mapInit.c:622)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413C69: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4030D5: binheap_remove_min (heap.c:152)
==10910== by 0x4019F0: analyzeDistancesPlus (mapInit.c:118)
==10910== by 0x4019F0: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413CCF: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4030D5: binheap_remove_min (heap.c:152)
==10910== by 0x4019F0: analyzeDistancesPlus (mapInit.c:118)
==10910== by 0x4019F0: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401AA7: analyzeDistancesPlus (mapInit.c:133)
==10910== by 0x401AA7: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401B5D: analyzeDistancesPlus (mapInit.c:144)
==10910== by 0x401B5D: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401C9C: analyzeDistancesPlus (mapInit.c:165)
==10910== by 0x401C9C: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401C01: analyzeDistancesPlus (mapInit.c:154)
==10910== by 0x401C01: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401E20: analyzeDistancesPlus (mapInit.c:190)
==10910== by 0x401E20: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401ECD: analyzeDistancesPlus (mapInit.c:203)
==10910== by 0x401ECD: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401D45: analyzeDistancesPlus (mapInit.c:176)
==10910== by 0x401D45: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401D72: analyzeDistancesPlus (mapInit.c:182)
==10910== by 0x401D72: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401F75: analyzeDistancesPlus (mapInit.c:217)
==10910== by 0x401F75: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4134D8: malloc_consolidate (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x415200: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x416AE0: _int_realloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x417A23: realloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403041: binheap_insert (heap.c:120)
==10910== by 0x401F75: analyzeDistancesPlus (mapInit.c:217)
==10910== by 0x401F75: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== at 0x401A16: analyzeDistancesPlus (mapInit.c:126)
==10910== by 0x401A16: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910== If you believe this happened as a result of a stack
==10910== overflow in your program's main thread (unlikely but
==10910== possible), you can try to increase the size of the
==10910== main thread stack using the --main-stacksize= flag.
==10910== The main thread stack size used in this run was 16777216.
==10910==
==10910== HEAP SUMMARY:
==10910== in use at exit: 0 bytes in 0 blocks
==10910== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==10910==
==10910== All heap blocks were freed -- no leaks are possible
==10910==
==10910== Use --track-origins=yes to see where uninitialised values come from
==10910== ERROR SUMMARY: 9609 errors from 28 contexts (suppressed: 0 from 0)
==10910==
==10910== 1 errors in context 1 of 28:
==10910== Invalid read of size 1
==10910== at 0x401A16: analyzeDistancesPlus (mapInit.c:126)
==10910== by 0x401A16: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910== Address 0xffffffeddcd031fc is not stack'd, malloc'd or (recently) free'd
==10910==
==10910==
==10910== 1 errors in context 2 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4134D8: malloc_consolidate (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x415200: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x416AE0: _int_realloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x417A23: realloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403041: binheap_insert (heap.c:120)
==10910== by 0x401F75: analyzeDistancesPlus (mapInit.c:217)
==10910== by 0x401F75: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 1 errors in context 3 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4134D8: malloc_consolidate (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x415200: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4014B8: initMap (mapInit.c:604)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 1 errors in context 4 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413CCF: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4649B0: fillin_rpath (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x46508E: _dl_init_paths (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43ADAC: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910==
==10910==
==10910== 1 errors in context 5 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413C69: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4649B0: fillin_rpath (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x46508E: _dl_init_paths (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43ADAC: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910==
==10910==
==10910== 1 errors in context 6 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x439E66: __linkin_atfork (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x418253: ptmalloc_init.part.7 (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4185DD: malloc_hook_ini (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x46AEA2: _dl_get_origin (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43A8CE: _dl_non_dynamic_init (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x43B6C7: __libc_init_first (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x403271: (below main) (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910==
==10910==
==10910== 7 errors in context 7 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4016FB: initRooms (mapInit.c:436)
==10910== by 0x4016FB: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 14 errors in context 8 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401AA7: analyzeDistancesPlus (mapInit.c:133)
==10910== by 0x401AA7: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 17 errors in context 9 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401E20: analyzeDistancesPlus (mapInit.c:190)
==10910== by 0x401E20: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 18 errors in context 10 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401F75: analyzeDistancesPlus (mapInit.c:217)
==10910== by 0x401F75: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 19 errors in context 11 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401D45: analyzeDistancesPlus (mapInit.c:176)
==10910== by 0x401D45: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 33 errors in context 12 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401B5D: analyzeDistancesPlus (mapInit.c:144)
==10910== by 0x401B5D: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 35 errors in context 13 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401ECD: analyzeDistancesPlus (mapInit.c:203)
==10910== by 0x401ECD: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 38 errors in context 14 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401C01: analyzeDistancesPlus (mapInit.c:154)
==10910== by 0x401C01: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 38 errors in context 15 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x40168F: initRooms (mapInit.c:418)
==10910== by 0x40168F: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 49 errors in context 16 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x415107: _int_malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x41723C: malloc (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x40305D: binheap_insert (heap.c:128)
==10910== by 0x401C9C: analyzeDistancesPlus (mapInit.c:165)
==10910== by 0x401C9C: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 106 errors in context 17 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4017AC: initRooms (mapInit.c:436)
==10910== by 0x4017AC: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 109 errors in context 18 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401766: initRooms (mapInit.c:447)
==10910== by 0x401766: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 109 errors in context 19 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401760: initRooms (mapInit.c:442)
==10910== by 0x401760: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 115 errors in context 20 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401D72: analyzeDistancesPlus (mapInit.c:182)
==10910== by 0x401D72: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 224 errors in context 21 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413CCF: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4030D5: binheap_remove_min (heap.c:152)
==10910== by 0x4019F0: analyzeDistancesPlus (mapInit.c:118)
==10910== by 0x4019F0: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 224 errors in context 22 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x413C69: _int_free (in /home/shanedrafahl/CS327/DungeonGame/DungeonGame/ShaneDrafahl)
==10910== by 0x4030D5: binheap_remove_min (heap.c:152)
==10910== by 0x4019F0: analyzeDistancesPlus (mapInit.c:118)
==10910== by 0x4019F0: initMap (mapInit.c:629)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 964 errors in context 23 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4018C7: initMap (mapInit.c:622)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 964 errors in context 24 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x4018C2: initMap (mapInit.c:622)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 1580 errors in context 25 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401386: initBorder (mapInit.c:47)
==10910== by 0x4014C4: initMap (mapInit.c:605)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 1580 errors in context 26 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401382: initBorder (mapInit.c:47)
==10910== by 0x4014C4: initMap (mapInit.c:605)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 1680 errors in context 27 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x40181F: initRooms (mapInit.c:469)
==10910== by 0x40181F: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910==
==10910== 1680 errors in context 28 of 28:
==10910== Conditional jump or move depends on uninitialised value(s)
==10910== at 0x401814: initRooms (mapInit.c:466)
==10910== by 0x401814: initMap (mapInit.c:606)
==10910== by 0x40111F: initGame (dungeonGame327.c:35)
==10910== by 0x4010F4: main (dungeonGame327.c:25)
==10910==
==10910== ERROR SUMMARY: 9609 errors from 28 contexts (suppressed: 0 from 0)
Segmentation fault
shanedrafahl@shanedrafahl-ThinkPad-X1-Carbon-2nd ~/CS327/DungeonGame/DungeonGame $