Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: MortenMacFly on May 23, 2006, 04:12:01 pm

Title: Crash when trying to build a project quickly after opening
Post by: MortenMacFly on May 23, 2006, 04:12:01 pm
Dear all,
unfortunaterly I've got a crash that did not happen the first time to me. But this time I've saved the rpt file and attached it to this post. It seems the crash occurs when cbProject::SaveAllFiles() is called before the build process starts. What I did was opening a small project project using the menu and then immediately (~1sec after) tried to build the project. Please notice that this is a really small project so it shouldn't take too long to load.
Anyway, the line where the crash occurs seems to be:
Code
  ProjectFile* f = node->GetData();
...where I cannot see an issue since node is "verified" using while(node) before. I hope this post will help in anyway - as I said before this crash happend to me several times before but I don't see a way to reproduce this.
With regards, Morten.
Ps.: Version 1.0 revision 2487 ()   gcc 3.4.5 Windows/unicode, wx2.6.2.

[attachment deleted by admin]
Title: Re: Crash when trying to build a project quickly after opening
Post by: thomas on May 23, 2006, 04:41:55 pm
Yiannis: at the risk of being a poophead again, are you really, really sure this wxExecute is harmless?

I see wxToolBarBase11OnLeftClick in the call stack followed by 2 dozen ProcessEvent calls and finally a crash in a strange location that seems to make no sense.

This looks strangely familiar...
Title: Re: Crash when trying to build a project quickly after opening
Post by: thomas on May 23, 2006, 05:49:44 pm
Martin: please try whether you can reproduce the problem after applying this patch.

(it implements a synchronous wrapper around asynchronous wxExecute calls that does the same thing as the original synchronous wxWidgets code, except for using safe wxYields)

[attachment deleted by admin]
Title: Re: Crash when trying to build a project quickly after opening
Post by: mandrav on May 23, 2006, 05:53:55 pm
Yiannis: at the risk of being a poophead again, are you really, really sure this wxExecute is harmless?

It was harmless for the other issue. For this, I don't know. Actually I don't quite remember if this is called on plugin initialization only or on project-load...
Title: Re: Crash when trying to build a project quickly after opening
Post by: thomas on May 23, 2006, 05:59:09 pm
Actually I don't quite remember if this is called on plugin initialization only or on project-load...
Project load. You can easily verify by applying my patch and commenting out the Yield: the application will start fine but will hang if you load a project. :)
Title: Re: Crash when trying to build a project quickly after opening
Post by: MortenMacFly on May 23, 2006, 06:04:09 pm
Martin: please try whether you can reproduce the problem after applying this patch.
Well, that's the problem: I can't even reproduce without the patch. I tried opening the project several times (over-and-over again) and hit "compile" quickly. Just the same as when the crash happened. But guess what: For now it simply works. :roll:
I really would be glad if someone could find a step-by-step guide to definetely issue this crash...
With regards, Morten.
Title: Re: Crash when trying to build a project quickly after opening
Post by: tiger683 on May 23, 2006, 08:40:36 pm
I really would be glad if someone could find a step-by-step guide to definetely issue this crash...
With regards, Morten.

Ok, let's try this: (i get a crash every time, and it sound similar to your description):

1) Open C::B :P

2) Click on a small project to get opened

3) while the little wristwatch is still visible (on load) hit F9
(Compile and run)

3) Close the console_runner window(debug target) by normally closing the window (ie. by not hitting ENTER)

4) If you were fast enough then the Controls for compile,run etc. should still be greyed

5) close the project and quickly click it again to open

6) If this still doesn't crash put step 3) here and continue.

It takes me at most three times to reproduce. (everytime)

I hope it helps, will now try the patch ;)

Thanks,

T
Title: Re: Crash when trying to build a project quickly after opening
Post by: MortenMacFly on May 23, 2006, 09:16:45 pm
Ok, let's try this: (i get a crash every time, and it sound similar to your description):
It would really help if you post the full crash report. Anyway, I'll try to reproduce. BTW: Are you removing the object files between the builds? Becasue if I don't, there is no compilation...?!
With regards, Morten.

Edit... and not to forget: What's a wristwatch? :?:
Title: Re: Crash when trying to build a project quickly after opening
Post by: thomas on May 23, 2006, 09:21:32 pm
Tried that about 30 times... nothing.

How can the same program code behave so differently on different PCs...  :roll:
Title: Re: Crash when trying to build a project quickly after opening
Post by: killerbot on May 23, 2006, 09:24:45 pm
I just had a similar problem, I was building CB (running rev 2489) to get to rev 2490, surfing in the meantime when I noticed CB was gone ... the rpt was .... empty (but did exist)
Title: Re: Crash when trying to build a project quickly after opening
Post by: MortenMacFly on May 23, 2006, 09:32:38 pm
Tried that about 30 times... nothing.
...nothing for me, too. It's the same with my version, the nightly from yesterday and my version with the patch from Thomas. Anyway: My version caused the crash today already... This really is annoying.
But Iv'e got another remark: Sometimes when I close C::B I get a crash that is caused by the wxToolbar[somewhat], too. This often happens after I re-compiled Code::Blocks (and have a huge amount of HDD access). If I analyse the crash report it points to several source files but at line 0 (?) so this is not of help that's why I did not post this 'til now. But all this seems to be related to the toolbar somehow... maybe...?!
With regards, Morten.
Title: Re: Crash when trying to build a project quickly after opening
Post by: takeshimiya on May 23, 2006, 10:00:20 pm
Not sure if it's helpful, but I also experience the "Crash when trying to build a project quickly after opening" from long ago.

I also see some wxToolbar[somewhat] on the my RPT (not sure if it's the same bug).
Title: Re: Crash when trying to build a project quickly after opening
Post by: MortenMacFly on May 23, 2006, 10:33:41 pm
...I wonder if this is related to this: http://forums.codeblocks.org/index.php?topic=2582.0 (http://forums.codeblocks.org/index.php?topic=2582.0). I compiled C::B from scratch using wxWidgets 2.6.3 instead of 2.6.2 to see if this changes something. Now try the following: Undock all of the toolbars and place them somewhere. Don't open any project and just close C::B. Crash Boom Bang! The reason? wxToolBar again (see the rpt file attached). BTW: This also happens with the nightlies on my machine...
With regards, Morten... :?
Ps.: Version 1.0 revision 2490 ()   gcc 3.4.5 Windows/unicode + "Thomas patch" this time.

[attachment deleted by admin]
Title: Re: Crash when trying to build a project quickly after opening
Post by: ProutDeMammouth on May 23, 2006, 10:57:44 pm
3) Close the console_runner window(debug target) by normally closing the window (ie. by not hitting ENTER)

4) If you were fast enough then the Controls for compile,run etc. should still be greyed

If the "compile" control is greyed at this point, isn't it a bug?
Title: Re: Crash when trying to build a project quickly after opening
Post by: ProutDeMammouth on May 24, 2006, 07:27:13 am
I mean, this is a bug, no matter if CB will crash afterwards or not.
Title: Re: Crash when trying to build a project quickly after opening
Post by: tiger683 on May 24, 2006, 12:47:45 pm
Tried that about 30 times... nothing.

How can the same program code behave so differently on different PCs...  :roll:

Do you use wxWidgets 2.6.3?

i built my version (rev 2489) from scratch under linux against wxGTK-2.6.3_p2 using gcc-4.1.0 and glibc-2.4,

btw, how can i generate an RPT file? (i guess it might only be possible if i use C::B to build C::B? I and other gentoo'ers use autotools)

I mean, this is a bug, no matter if CB will crash afterwards or not.

Hmm, the "controls still greyed out" problem might be something with pipedprocess, maybe an event is not being generated?

Oh, and a wristwatch is a watch you carry on your wrist :P Though, I'm not a native english speaker....

Thanks,

T
Title: Re: Crash when trying to build a project quickly after opening
Post by: thomas on May 24, 2006, 01:09:57 pm
Do you use wxWidgets 2.6.3?
2.6.2 under Windows XP and Ubuntu 5.10, using gcc 3.4.5 under Windows and... uh... actually don't know what Ubuntu comes with, 4.1 I believe.

Quote
btw, how can i generate an RPT file?
There's nothing you have to do, it should just be there after a crash. I can't tell where it is under Linux (never seen a crash under Linux), but on the rare crashes that I see under Windows, it puts them into the executable folder (for Linux, my guess would be your home directory).

Quote
and not to forget: What's a wristwatch?
Quote
Oh, and a wristwatch is a watch you carry on your wrist :P
The bizzee curser :)
Title: Re: Crash when trying to build a project quickly after opening
Post by: tiger683 on May 24, 2006, 01:40:33 pm
There's nothing you have to do, it should just be there after a crash. I can't tell where it is under Linux (never seen a crash under Linux), but on the rare crashes that I see under Windows, it puts them into the executable folder (for Linux, my guess would be your home directory).

hrrm??? no luck for mee  :cry:
and i doubt i will ever try windoze again ;)