Author Topic: cannot launch C::B  (Read 4002 times)

Offline pcoquill

  • Single posting newcomer
  • *
  • Posts: 4
cannot launch C::B
« on: February 20, 2013, 11:36:53 am »
Hi,

I have, for a long time, installed C::B, and I updated it yesterday using the last NB (23 november). Everything was ok (launching, opening project, compilation and execution...)...until this morning, I got this message error at launching CB:

.

Between yestday evening and this morning, nothing had change on my computer, except that windows made some update...

I use windows XP runing within the Virtual Box Ose (ubuntu).

Any Idea ?

Thank you.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7594
    • My Best Post
Re: cannot launch C::B
« Reply #1 on: February 20, 2013, 12:18:03 pm »
I got this type of message once over a year ago.

Something had resulted in my default.conf being damaged in my case it was an empty file.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline pcoquill

  • Single posting newcomer
  • *
  • Posts: 4
Re: cannot launch C::B
« Reply #2 on: February 20, 2013, 12:28:30 pm »
Hi Stahta,

Same thing in my case, the default.conf is empty. Dont know why. Besides, I make a new install from a new download (codeblocks-12.11-RC1-mingw-setup.exe), but nothing changed ! after the intallation stopped (and it said that everything was OK), the launching gave me the same error message. Strange ! What can I do (find an other install on one other computer and copy the default.conf ? but where is it in the hierachy of Windows 8 ? can't find it)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cannot launch C::B
« Reply #3 on: February 20, 2013, 12:45:35 pm »
Just delete it, as the settings are lost anyway.
It's in %APPDATA%\CodeBlocks on windows.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cannot launch C::B
« Reply #4 on: February 20, 2013, 12:50:00 pm »
Unless you truncated the file by hand, which is unlikely (you would know if you did), this can actually only happen if Code::Blocks crashes at shutdown, when the config file is overwritten. That's a scary thought, as that's not something that could conceivably happen (not in a way that could corrupt something, anyway). Unless it's some thread from some plugin (code completion parser?) that's crashing the app...

The save path under Windows 8 should be very similar to the one in Windows 7, give or take a "/Roaming/" (assuming you don't use that cloud store stuff).

If you don't find another config that you can copy, you should just delete that file, it will restore default settings, which is admittedly annoying but at least Code::Blocks will work again.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline pcoquill

  • Single posting newcomer
  • *
  • Posts: 4
Re: cannot launch C::B
« Reply #5 on: February 20, 2013, 12:55:30 pm »
Hi Jens and Thomas, thanks a lot. I removed the  >:( default.conf, and CB started, as usually. But I've lost a lot of things...(included recent projects..). I'll launch a new install.

Thanks a lot. This was very helpfull.

PS : I notice that there is something interesting about default.conf in the FAQs

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cannot launch C::B
« Reply #6 on: February 20, 2013, 01:02:02 pm »
Quote
not something that could conceivably happen
That said, I just looked at FileManager::Save, which is the function overwriting that file (or every other file that is being saved in Code::Blocks).

That function was initially implemented as writing to a temporary file and then swapping the two and doing a delayed delete of the former original.

What I see now is... something different? If I read the current code correctly, a temp file is created, then the original is overwritten, and the temp file is deleted. Not sure what the rationale was behind that change, does anyone remember?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: cannot launch C::B
« Reply #7 on: March 30, 2013, 04:33:37 pm »
The cause of your problem should be fixed with the next nightly build.

Instead of making a copy and overwriting the original (...?!) when saving, data is now being written to a temporary file, which is atomically moved over the original afterwards. This should prevent any such thing as "empty file" from happening.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."