News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

CC makes C::B hang in ExpandBackticks

Started by Jenna, January 02, 2013, 01:09:01 PM

Previous topic - Next topic

MortenMacFly

Quote from: oBFusCATed on January 04, 2013, 12:02:26 PM
BTW: I'm looking why the no-change-build of cb is slow. It turned out that the DirectCommands object is recreated tons of times (takes 30-50% time).
Well it has to at least for each project you compile in the WS for deps (re-)computation, at least. It should instantiate as many times as you have project in your WS. Is that true?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: MortenMacFly on January 04, 2013, 01:49:16 PM
Well it has to at least for each project you compile in the WS for deps (re-)computation, at least. It should instantiate as many times as you have project in your WS. Is that true?
I think it is created for every file. I have to dig more, but my crashing bug is quite annoying and also the code there is a total mess of spaghetti. There is no way someone to understand or modify it easily.
(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!]

MortenMacFly

Quote from: oBFusCATed on January 04, 2013, 01:56:46 PM
also the code there is a total mess of spaghetti. There is no way someone to understand or modify it easily.
Where? Maybe if you tell someone can help...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: MortenMacFly on January 04, 2013, 02:01:30 PM
Where? Maybe if you tell someone can help...
Look at DoRunQueue and BuildStateMachine, also the DirectCommands class is a bit messy :(
(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!]

Alpha

Quote from: oBFusCATed on January 04, 2013, 03:46:47 PM
Quote from: MortenMacFly on January 04, 2013, 02:01:30 PM
Where? Maybe if you tell someone can help...
Look at DoRunQueue and BuildStateMachine, also the DirectCommands class is a bit messy :(
Tell me about it... :-\.  Every time I tried to modify something in there for the XML compiler branch, I came out with a headache.  I think the only way to make the build mechanism readable would be a complete rewrite of it, but that would be a huge amount of work (which is why I have, for the most part, avoided it).

MortenMacFly

#21
Quote from: oBFusCATed on January 04, 2013, 03:46:47 PM
Look at DoRunQueue and BuildStateMachine, also the DirectCommands class is a bit messy :(
Have a look at the attached images... ;-)

Edit: Removed images as they don't seem to help...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

WTF... I doubt it will help...

p.s. I hope you know these images will be deleted some day :)
(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!]

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Jens: Can you rebuild cb-unix.cpb with c::b compiled and started from another c::b?
(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!]

Jenna

Quote from: oBFusCATed on January 04, 2013, 10:40:00 PM
Jens: Can you rebuild cb-unix.cpb with c::b compiled and started from another c::b?
Yes.

oBFusCATed

(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!]

Jenna

Quote from: oBFusCATed on January 04, 2013, 11:54:23 PM
Quote from: jens on January 04, 2013, 11:23:10 PM
Yes.
Hm, have you modified the project to run cb in a terminal?
I only did it in debug-mode and this works (most of the time) if the ExpandBackticks stuff does not kick in.
But in normal mode it hangs reliably if it tries to build the first target.
With console output enabled it also works.
There are several errors shown before the project is loaded:

execvp(-version) failed with error 2!
execvp(-version) failed with error 2!

(codeblocks:22219): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:22219): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:22219): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:22219): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed


after (or while) loading the project the following errors are shown:

(codeblocks:22219): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:22219): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

** (codeblocks:22219): CRITICAL **: murrine_style_draw_flat_box: assertion `width >= -1' failed

** (codeblocks:22219): CRITICAL **: murrine_style_draw_flat_box: assertion `width >= -1' failed


The radio-errors/warnings are there for a long time (debugger-menu), the last two assertions are caused by wxExecute as far as I know and are also old.

The first two (execvp) messages are new as far as I can tell.
I will try to dig into it deeper (maybe Null-compiler ?).

oBFusCATed

Quote from: jens on January 05, 2013, 01:05:57 AM
But in normal mode it hangs reliably if it tries to build the first target.
So, if I understand correctly you are unable to build cb in the described case?

Quote from: jens on January 05, 2013, 01:05:57 AM
The first two (execvp) messages are new as far as I can tell.
I will try to dig into it deeper (maybe Null-compiler ?).
Yes, they are caused by the xml compiler code, Alpha can you look at them?
(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!]

Jenna

Quote from: oBFusCATed on January 05, 2013, 01:45:31 AM
Quote from: jens on January 05, 2013, 01:05:57 AM
But in normal mode it hangs reliably if it tries to build the first target.
So, if I understand correctly you are unable to build cb in the described case?

Quote from: jens on January 05, 2013, 01:05:57 AM
The first two (execvp) messages are new as far as I can tell.
I will try to dig into it deeper (maybe Null-compiler ?).
Yes, they are caused by the xml compiler code, Alpha can you look at them?
The error is triggered by bool Compiler::EvalXMLCondition(const wxXmlNode* node) .

This fixes the error, that causes "-version" to be the only command.
The error-message itself will still be there.
I suggest catching the error output and either give a more clear error message or just suppress it.

Index: src/plugins/compilergcc/resources/compilers/options_clang.xml
===================================================================
--- src/plugins/compilergcc/resources/compilers/options_clang.xml
+++ src/plugins/compilergcc/resources/compilers/options_clang.xml
@@ -25,7 +25,9 @@
         <Program name="LD"        value="clang++"/>
         <Program name="DBGconfig" value="gdb_debugger:Default"/>
         <Program name="LIB"       value="llvm-ar"/>
-        <if exec="llvm-ar -version">
+        <!-- LIB will be expanded to llvm-ar by Compiler::GetExecName()
+             llvm-ar can not be directly used here, because it can not be evaluated -->
+        <if exec="LIB -version">
             <!-- found, do nothing -->
         </if>
         <else>


And yes I can not compile C::B from a C::B running inside C::B which has no console output (either real console or gdb).