当我试图调试在 Linux 机器上编写的 C 程序时(现在,我正在使用 Visual C++ Express),我首先遇到了一个堆栈溢出错误。所以当我点击继续时,我收到了另一条错误消息,
Access violation reading location 0x00030000
所以我决定一步步调试。所以当我尝试它时,它向我显示了错误
There is no source code available for the current location.
这个错误的原因是什么?
代码
#if 1
while(1)
#endif
{
fillList();
#if 1
{
op_ds_bulk(ops, &total, 1);
temp = res("Bulk Write:", total, fp);
index = 0;
}
#endif
void op_ds_bulk(u_int ops, u_int * totalp, int update)
{
char encode_db[] = "encode";
if(update)
{
database_insert_bluk(list, ops);
database_sync();
*totalp = ops;
}
else
{
CHUNK prefetch[4096];
int random = rand() % (h-ops+1);
__os_clock(NULL, &start_time.secs, &start_time.usecs);
database_select_end(65546, random, prefetch, ops);
__os_clock(NULL, &end_time.secs, &end_time.usecs);
*totalp = ops;
}
}
}
最佳答案
无效访问可能发生在标准库代码的某处。 Express 版本中不提供该源代码。
您可以检查调用堆栈的代码中调用库函数的部分,然后从那里开始处理。
关于c++ - 错误 - 当前位置没有可用的源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5177366/