Author Topic: sudden amnesia of linker?  (Read 16229 times)

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
sudden amnesia of linker?
« on: September 10, 2013, 09:12:37 pm »
Hi everybody,

I am using c::b svn 9298 self compiled on a SuSE 12.3 AMD cuad core machine.

Since this version I observe a strange effect resembling an amnesia of c::b regarding the linker and/or compiler (?).

I cannot reproduce it in any way i would know, it happens seemingly random.

After a short flash on the screen, just a blink, this is occurring: trying to compile an otherwise fine project, c::b complains about symbols not found and shows a long list of mangled symbols mostly having to do with wxWidgets but also with my own source files.

Closing down c::b and restarting it reverts to the normal behavior and compiling works fine again...

Happens like twice a day.

Regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: sudden amnesia of linker?
« Reply #1 on: September 10, 2013, 11:27:42 pm »
Hm, never seen this.
What was the previous version of C::B that worked correctly?
Do you have the full build log of a failing build? Anything strange in it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: sudden amnesia of linker?
« Reply #2 on: September 11, 2013, 12:03:30 am »
Does C::B still do the command stuff only once in a while `command stuff`?

If yes, I am guessing C::B is losing the info.

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: sudden amnesia of linker?
« Reply #3 on: September 11, 2013, 01:27:30 am »
Does C::B still do the command stuff only once in a while `command stuff`?
What does this mean?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: sudden amnesia of linker?
« Reply #4 on: September 11, 2013, 07:13:59 am »
Example from CodeBlocks_wx29-unix.cbp

Code
<Add option="`$(WX_CONFIG) --cflags`" />

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 frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #5 on: September 11, 2013, 10:34:40 am »
@Obfuscated

the behavoir shows with the current svn 9298 and with the one just before, i don't remember the number.

Next time it happens, I’ll copy the build log and attach it here... but as it is completely random, it could take some time...

Thank you all for the interest

regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #6 on: September 18, 2013, 06:04:36 pm »
hi everybody,

the problem occurred again, this time with svn 9343. I attach two files with the build logs.

This time I had some more concentration on observing the circumstances: it happened after adding a new class to the project using the new class wizard.

After doing some editing on the new class and trying to build, c::b rendered the output shown in build_1 attached file. Trying to rebuild the whole project rendered the output of build_2 attached file.

After closing down c::b and restarting it, the build process worked fine as usual.

I am not totally sure, but I think the last time the problem occurred after adding a new class too.

Regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: sudden amnesia of linker?
« Reply #7 on: September 18, 2013, 06:35:33 pm »
It looks like copies of the "Build messages" tab and not of the "Build log" tab, so all compiler commands are missing and the logs are more or less useless.
Nevertheless, I try to reproduce it.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #8 on: September 18, 2013, 06:44:36 pm »
you are right of curse, it were the contents of build messages...

it happened again right now, so I attach the build log this time... again after creating a new class via the new-button on the toolbar.

sorry for the wrong output and please don't get too bitter with us noobs ;)

regards

frithjofh
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: sudden amnesia of linker?
« Reply #9 on: September 18, 2013, 08:10:00 pm »
Can you attach a snippet of the build logs, where it works ?

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #10 on: September 18, 2013, 08:33:29 pm »
sure
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: sudden amnesia of linker?
« Reply #11 on: September 18, 2013, 08:42:00 pm »

Closing down c::b and restarting it reverts to the normal behavior and compiling works fine again...

frithjofh

I suggest trying a project full re-build and see if the error goes away.
If it does NOT, please post the full re-build that fails.

And, after re-starting CB, post a full re-build that works.

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 frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #12 on: September 18, 2013, 09:01:59 pm »
OK, doing full rebuilds now...

build_5.txt is the log of the failed build. build_6.txt is the log of the consecutive good build.

this time I tried only to close and reopen the project, not closing down and restarting c::b.

in a next test I tried just reparsing the project after adding a new class, but that rendered the same described behavior. i still had to close and reopen the project to make it work.

regards

frithjofh
« Last Edit: September 18, 2013, 09:04:05 pm by frithjofh »
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: sudden amnesia of linker?
« Reply #13 on: September 18, 2013, 09:34:58 pm »
I am guessing that it might be a dependency issue, you might try deleting the cbproject.depend  file and see if that fixes the issue.
Note: I am not sure if this is safe to do with the project open.

Edit: I do see a compile issue "-Iinclude -I -c" That -I is NOT in the good re-build log; but, is in the bad re-build log.

Tim S.
« Last Edit: September 18, 2013, 09:36:45 pm by stahta01 »
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 frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #14 on: September 18, 2013, 10:09:36 pm »
mmmm, just my 4 cents...

as I really did nothing else but what I described earlier, I would say, that when adding a new file the cbproject.depend file is not correctly updated. Or there is some error being introduced in the process of updating.
Isn't c::b responsible for creating that file? I don't see how the user is in any way involved here...? At least I didn't change any compile options or edit the depend file manually after adding the new class to the project...

So, when is cbproject.depend generated anyway? On loading a project? Does it get changed by the wizard adding a new class, or the according new files, and is there some error in what the wizard writes to the file?

regards and thanks for the interest

frithjofh

PS: I would rather not like deleting cbproject.depend with my project open... maybe I'll set up a test project...
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: sudden amnesia of linker?
« Reply #15 on: September 18, 2013, 10:21:18 pm »
PS: I would rather not like deleting cbproject.depend with my project open... maybe I'll set up a test project...
Why? Aren't you storing your project in a VCS (subversion,git,etc)?

The best thing to do is to try reproduce the problem with a simple console project. Then post the exact steps needed to reproduce it on another computer.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #16 on: September 19, 2013, 09:35:33 pm »
hi, and thanks for the interest...

actually I am using git as version control system...

but back to my observed c::b problem: did anyone else reproduce it on his/her machine?

regards

frithjof
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: sudden amnesia of linker?
« Reply #17 on: September 20, 2013, 12:49:59 am »
but back to my observed c::b problem: did anyone else reproduce it on his/her machine?

No.

Which settings do you use in the new class dialog ?
Which pch-settings do you have for your project ?

As written by oBFusCATed: a minimal test-project and exact steps (all settings in new class dialog) would be good.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #18 on: September 20, 2013, 11:33:17 am »
Hi everybody,

I attached a zip with a minimal console test project. PCH settin is the default: PCH generatedalongside original header.

I have added two classes via the new class dialog. Settings of the dialog for both classes like in the attached jpg file screen shot.

After adding the first class, the compilation/linking failed. I closed the project and reopened it and it compiled/linked fine.

After adding the second class, compilation/linking failed. I attach the build log as fail_2.txt.

regards

frithjofh

[attachment deleted by admin]
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: sudden amnesia of linker?
« Reply #19 on: September 20, 2013, 02:03:01 pm »
i think i know what is going on...
this should fix the error...

greetings

[edit] a better patch would be, in the compiler plugin, witch prevents to add a empty patch to the command line.... at the moment i have no time, but later i could try to fix it...
« Last Edit: September 20, 2013, 02:11:04 pm by BlueHazzard »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: sudden amnesia of linker?
« Reply #20 on: September 20, 2013, 04:07:53 pm »
I would prefer this patch...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: sudden amnesia of linker?
« Reply #21 on: September 20, 2013, 04:50:54 pm »
BlueHazzard:
Are you able to reproduce the problem?
If so can you enlighten us about the steps needed to reproduce it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: sudden amnesia of linker?
« Reply #22 on: September 20, 2013, 05:06:08 pm »
To reproduce the bug, you have only to create a project and add a class with the class wizzard.
The options "Add path to Project", "Use relative Path", and "Header and implementation file shall be in the same folder"
and the folder should point to the main project directory.
The problem is, that the relative path to the project directory is nothing (or a empty string). And if we add a empty Include path, c::b produce the output with the empty -I flag.
My patch checks if the path to add to the include directories is empty, if so, reject it... (or should we add a "."?)

greetings

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: sudden amnesia of linker?
« Reply #23 on: September 20, 2013, 09:17:24 pm »
I would prefer the "-I .", because it does what the wizard is told to do (add the reletive path).
@oBFusCATed: I can reproduce it now also, you have to uncheck "Explicitely add currently compiling file's directory to compilers search dir" in compiler options.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: sudden amnesia of linker?
« Reply #24 on: September 20, 2013, 10:36:57 pm »
Great now you'll choose a way to fix it :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: sudden amnesia of linker?
« Reply #25 on: September 21, 2013, 02:05:17 pm »
thanks for the efforts and the fix. maybe I should mention, that this worked fine all the time in the past. the bug was introduced only some months ago...

thanks again
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: sudden amnesia of linker?
« Reply #26 on: September 21, 2013, 06:21:13 pm »
@frithjofh: you can remove the tick at "Add path to Project" and it should work, for the moment, until a fix is committed...

i think this patch should work...


greetings