Crash depending on file name

Started by
2 comments, last by King Mir 11 years, 2 months ago

So this has had me stumped for several hours today, and I finally was able to track down what was causing my crash, but I'm not sure why. A little background:

My project is using GLFW to handle creating the OpenGL context. Everything was working fine until I tried to add some files from an open source project to do some file parsing. The library contained some *.cc files. After adding these files, my program would always crash when trying to create the window, down in dbgheap.c (_CrtIsValidHeapPointer).

The first weird thing I noticed was that this crash would happen even if I wasn't calling into any of the new library. So I started removing more and more of the library until I was left with a single *empty* .cc file. Removing the *.cc file fixed the problem. If I re-added the .cc file, the crash would immediately start happening again.

So I started experimenting some more. Renaming the file to a .h file *inside VS* wouldn't fix the crash, but if I removed the file from VS, renamed it from the file explorer, and then re-added it as a .h, it wouldn't crash. Oddly, once I had added it as a .h, I could rename it back to .cc inside VS and it would be fine.

Also, I noticed that the crash only happens during a Debug build. Release is fine.

So, I'm not entirely sure what's going on here, but it might have something to do with the .cc file causing VS to use some different versions of the standard libraries, which are somehow causing a crash? I thought .cc was just another extension for C++ files. Can somebody explain what exactly is going on here?

scottrick49
Advertisement
Open the file in a binary editor. There may be some unexpected nonprintable characters in the file.

The files are literally empty. I also tried it by creating entirely new files and changing their extensions. Same thing happens.

scottrick49

Maybe it's got to do with the fact that cpp files are required to end with a newline. Seems kinda strange though, especially on a modern compiler.

This topic is closed to new replies.

Advertisement