I met a BAMR (Beyond All My Recognition) error, I have a small single-thread application, just create an openGL context and draw something for test purpose. It runs well both in Windows7 and Ubuntu64. These days I am porting it to Linux armv7 (arm-linux-gnuabihf), the host machine is ubuntu x64, gcc/g++ version is 4.6(arm-linux-gnuabihf), before this app I've been compiled several small apps and running well.
Every time I run this application will print below error:
/////////////////////
Step 1
Inconsistency detected by ld.so: dl-minimal.c: 136: realloc: Assertion `ptr == alloc_last_block' failed!
/////////////////////
Here is my code, it looks like each time the error happens before an if(..) clause? How strange it is! Anyone have any idea? Thanks a lot!
HRESULT TestWorkloadBase::CreateGLWindow()
{
printf("Step 1");
if (m_bPrompt) //m_bPrompt has been initialized
{
printf("Step 2");
int ProcessId = GetProcessID();
printf("Process Id is %d Starting... Please press a key to continue.\n", ProcessId);
printf("Step 3");
std::cin.ignore();
}
printf("Step 4");
#if !defined(_WIN32)
if (getenv("DISPLAY") == NULL)
{
setenv("DISPLAY", ":0.0", 0);
}
...
}
The "Step 1" will be printed each time.