Jump to content

  • Log In with Google      Sign In   
  • Create Account


Crash depending on file name


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 scottrick49   Members   -  Reputation: 366

Like
0Likes
Like

Posted 10 February 2013 - 09:11 PM

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

Sponsor:

#2 frob   Moderators   -  Reputation: 19056

Like
0Likes
Like

Posted 10 February 2013 - 10:02 PM

Open the file in a binary editor. There may be some unexpected nonprintable characters in the file.
Check out my personal indie blog at bryanwagstaff.com.

#3 scottrick49   Members   -  Reputation: 366

Like
0Likes
Like

Posted 10 February 2013 - 10:21 PM

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


scottrick49

#4 King Mir   Members   -  Reputation: 1916

Like
0Likes
Like

Posted 10 February 2013 - 11:42 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS