Pelles C forum

Pelles C => Bug reports => Topic started by: aj on June 02, 2009, 12:15:39 AM

Title: Writing zeros to source files
Post by: aj on June 02, 2009, 12:15:39 AM
I've encountered a problem now a couple of times - though I'm not exactly sure that it's directly related to Pelles C - it's annoying enough for me to post a bug report.


I'm wondering if Pelles C somehow overwrites source files with zeros before saving them.
Probably in Pelles C's handling of unsaved files when making an "unnatural" exit request, by creating the file and then SetFilePointer to the wanted size, and last write the actual data (which fails).

I've been developing a full screen application using FFmpeg, which crashed (due to a simple, stupid mistake involving two event-loops), causing the screen to get black and me to doing a hard reboot.
When I opened the project again the file I edited last was overwritten with zeroes. It's approximately (probably exactly) the same size as before - just that it's filled with zeros instead of the actual source. This gets kind of annoying when dealing with 10KiB source files...

The problem has also occured while developing a kernel module messing with the file system (also resulting in a hard reboot) - though then I blamed it all on the kernel module. This time I can't really blame that.

Hope you can help before the 6.00 version of this awsome IDE gets out of the gates!
Title: Re: Writing zeros to source files
Post by: TimoVJL on June 02, 2009, 07:01:44 AM
That problem is Windows OS MemoryMapped file handling in crash situation.
Title: Re: Writing zeros to source files
Post by: aj on June 02, 2009, 10:30:41 PM
Oh, I see!

Then it's not directly related to Pelles C, in a way..