Author Topic: Project File Corruption (reproducable)  (Read 8117 times)

gmb300

  • Guest
Project File Corruption (reproducable)
« on: September 06, 2007, 09:34:29 am »
Version: SVN 4420 (September 1, 2007)
OS: Linux

I am reporting 3 bugs in CodeBlocks, all are reproducable.

BUG #1
 * When saving a workspace, the '.workspace' extension must be explicitly added.
BUG #2
 * CodeBlocks only recognizes a workspace if it has the extension '.workspace'.
BUG #3 [SERIOUS]
 * CodeBlocks erases project files without warning!

Steps to reproduce:

Deleted... See my next few posts.
« Last Edit: September 07, 2007, 07:20:32 am by gmb300 »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Project File Corruption (reproducable)
« Reply #1 on: September 06, 2007, 10:16:33 am »
1) fixed in rev 4428
2) not a bug
3) still looking
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Project File Corruption (reproducable)
« Reply #2 on: September 06, 2007, 02:33:24 pm »
What about this thread? Will the extension be changed or does revision 4428 mean that it will remain ".workspace"?
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Project File Corruption (reproducable)
« Reply #3 on: September 06, 2007, 03:36:35 pm »
I haven't changed anything to the extension as such (and won't for now).

Though I'm 100% for the change to .cbw, I don't want to tamper with extensions for now, as long as extension handling is  OBUH (one big ugly hack). Actually I wouldn't have done revision 4428 either, since it adds another piece of hardcode... but it's such an obvious dumb mistake which will annoy users every time they encounter it, so it should be "fixed" nevertheless.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

gmb300

  • Guest
Re: Project File Corruption (reproducable)
« Reply #4 on: September 06, 2007, 09:05:02 pm »
I've narrowed the steps down.

Deleted... See my next post.
« Last Edit: September 07, 2007, 07:19:25 am by gmb300 »

Offline troels

  • Multiple posting newcomer
  • *
  • Posts: 71
Re: Project File Corruption (reproducable)
« Reply #5 on: September 06, 2007, 10:26:41 pm »
I've narrowed the steps down.
This happens on Windows too (following the steps -> empty project)
/Troels

gmb300

  • Guest
Re: Project File Corruption (reproducable)
« Reply #6 on: September 07, 2007, 03:24:34 am »
New Set of Steps to Reproduce

1). Open fresh codeblocks
2). File -> New -> Project
3). Create console application
4). Reasonable defaults are okay
5). Project -> Properties
6). Click Build Targets Tab
7). Set Type to 'Dynamic library'
8). Uncheck the box Auto-generate filename extension
9). Set Output Filename to 'bin/Debug/testcb.dll'
10). Click OK
11). File -> Save Project
12). Click 'Rebuild' on the toolbar
13). File -> Close Project
14). File -> Open ... The project file does not exist!

gmb300

  • Guest
Re: Project File Corruption (reproducable)
« Reply #7 on: September 07, 2007, 07:13:03 am »
The problem is with Clean() ing, CodeBlocks thinks the project file is a static library. So C::B adds the project file to the list of files to be deleted.

Pseudo-Code:

if (project_target_type == ttDynamicLib &&
    m_PrefixGenerationPolicy == tgfpPlatformDefault &&
    m_ExtensionGenerationPolicy == tgfpNone)
  then
    call DirectCommands::GetTargetCleanCommands()
      return List_of_Files_To_Be_Deleted(Object Files, Project File)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Project File Corruption (reproducable)
« Reply #8 on: September 07, 2007, 08:01:27 am »
Bug confirmed. Thanks for the report. Hopefully we'll be able to fix this soon. :)
Be a part of the solution, not a part of the problem.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Project File Corruption (reproducable)
« Reply #9 on: September 07, 2007, 11:31:57 am »
Fix committed in revision 4435. Thanks for pointing this nasty bug. :)
Be a part of the solution, not a part of the problem.