Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7188

Reading from location 0000000000000000 in C program

$
0
0

I have a 10k lines of code C program that sometimes crashes.I cannot replicate that crash. All I can do is to wait for it to happen and then try to debug it.

This is what I get from drmingw

EXCEPTION PID=18632 TID=10612 ExceptionCode=0xc0000005 dwFirstChance=0

mypgr.exe caused an Access Violation at location 0000000000402CB2 inmodule mypgr.exe Reading from location 0000000000000000.

AddrPC Params0000000000402CB2 0000000000A862D0 0000000000000003 00000000035BE380 mypgr.exe!manage_ids [C:/Users/mn/Documents/code blocks/zbr/common.c @ 440]

if(unique_id[i]->idd[32] != 0)     log_errors_to_file("xd2");dbg_str_len = 0;for(int xd = 0;xd < 32;xd++) { //  ERROR IN THIS LOOP    if(ant_tb[j][k]->idd[xd] == 0)         break;    dbg_str_len++;};if(dbg_str_len != 32)     log_errors_to_file("xd3");if(ant_tb[j][k]->idd[32] != 0)     log_errors_to_file("xd4");

I know this code does not make any sense but I tried many strange things to replicate the crash.Anyway my debugger shows that below line is causing the problem

for(int xd = 0;xd < 32;xd++){if(ant_tb[j][k]->idd[xd] == 0) break;dbg_str_len++;};

But why? Is it possible to crash the app by just reading?


Viewing all articles
Browse latest Browse all 7188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>