Author Topic: C::B Just decided to start crashing while loading my project  (Read 5724 times)

Offline CBLaw

  • Single posting newcomer
  • *
  • Posts: 8
C::B Just decided to start crashing while loading my project
« on: April 04, 2009, 04:11:49 pm »
Hey everyone:
   Sorry if this has been solved elsewhere. This forum is running WAY too slow for me this morning + I'm desparite, Ticked-off, and kinda in a hurry.

I've been enjoying developing for Ubuntu (8.10) and C:B (8.02) since Jan 1st. Until last night everything was going smooth until I installed intel C/C++.

I have a workspace going with a few statc lib projects, and a console app to test the libs. I installed intel c as per the instructions and just to see if it worked I changed the compiler of my test project to intel c. The compiler did not work (invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]), so I quit C:B without saving changes, and spent about 3 hours with google. I pieced it all together bit by bit, and finialy was able to create a SDL project from the new project templates and compile it and run it. Naturally I was excited, so I loaded up my workspace and it crashed during loading. So I went to my Dropbox (online backup) and tried loading yesterdays workspace and still a crash. It does get right to the end of the load 'cause i can see my source teasing me behind the crash report.
   I did try loading each project into a blank workspace one at a time, and it realy does seem to crash only on my test app project.
I can provide the crash report if it helps. For now I thought I'd supply a few files of intrest to see if someone knows something...

Heres a block of text that I had to add to .bashrc and .profile. This same block is at the bottom of each file:
Code
# Intel Compiler
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/Compiler/11.0/083/lib/ia32
export PATH=$PATH:/opt/intel/Compiler/11.0/083/bin/ia32
export LANG=C
export LC_ALL=C

...Don't know if it means much to C:B, but it does make Intel C work. And here's my .CBP file that won't load...

Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="TestICD" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/TestICD" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option external_deps="../Lib/Debug/libICD.a;" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-g" />
</Compiler>
<Linker>
<Add option="-pg" />
<Add library="../ScriptEngine/DebugLib/libScriptEngine.a" />
<Add library="../Lib/Debug/libICD.a" />
<Add library="../TinyXML/Lib/Debug/libTinyXML.a" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin/Release/TestICD" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option external_deps="../Lib/Release/libICD.a;" />
<Option type="1" />
<Option compiler="gcc" />
<Option use_console_runner="0" />
<Compiler>
<Add option="-march=pentium4" />
<Add option="-fexpensive-optimizations" />
<Add option="-O3" />
<Add option="-O2" />
<Add option="-O1" />
<Add option="-O" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="../ScriptEngine/ReleaseLib/libScriptEngine.a" />
<Add library="../Lib/Release/libICD.a" />
<Add library="../TinyXML/Lib/Release/libTinyXML.a" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="`sdl-config --cflags`" />
</Compiler>
<Linker>
<Add option="`sdl-config --libs –cflags`" />
<Add library="GL" />
<Add library="X11" />
</Linker>
<Unit filename="ICDMain.cpp">
<Option weight="100" />
</Unit>
<Unit filename="cb.bmp" />
<Extensions>
<envvars />
<code_completion />
<debugger>
<search_path add="../bin/Debug" />
<search_path add="bin/Debug" />
<search_path add="obj/Debug" />
<search_path add="../Lib/Debug" />
<search_path add="../obj/Debug" />
</debugger>
<lib_finder disable_auto="1">
<lib name="gl" />
</lib_finder>
</Extensions>
</Project>
</CodeBlocks_project_file>

...Looks fine to me!!! and here's the .xml

Code
<?xml version="1.0" ?>
<ICDConfig>
    <!-- Settings for ICD -->
    <ScreenMode>
        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
    </ScreenMode>
    <Connection ip="xxx.xxx.x.x" timeout="123.456000" />
</ICDConfig>

...Connection ip was edited. .The .depend is long and boring so I'll skip that. Here's the last few lines from
debug report.

Code
    <frame level="30" function="g_main_context_dispatch" offset="000001e8"/>
    <frame level="31"/>
    <frame level="32" function="g_main_loop_run" offset="000001d2"/>
    <frame level="33" function="gtk_main" offset="000000b9"/>
    <frame level="34" function="wxEventLoop::Run()" offset="00000045"/>
    <frame level="35" function="wxAppBase::MainLoop()" offset="0000004e"/>
    <frame level="36" function="wxAppBase::OnRun()" offset="00000021"/>
    <frame level="37" file="/build/buildd/codeblocks-8.02/src/src/appglobals.h" line="589"/>
  </stack>
</report>

...And the .layout file:
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<File name="ICDMain.cpp" open="1" top="1" tabpos="1">
<Cursor position="6397" topLine="196" />
</File>
</CodeBlocks_layout_file>

...Cursor position is weird - if it's a line number I don't have 6397 lines yet. I did edit it and tried a few
smaller numbers and still no go-ski.

Any advice? I've reinstalled C:B and nothing. It will load, compile and run other console apps like mine with either GnuC or IntelC - it just don't like the one that I've spent the last 3 months working on anymore!

Of course I can make a new project, but I think it's important to bust this ghost. If I can't I don't know if I can continue using C:B knowing that it may break at anytime. The fact that it wont load yesterdays backup before any changes (that I didn't save) is spooky to me!

Thanks for any and all help - I always seem to need lots of it!


Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: C::B Just decided to start crashing while loading my project
« Reply #1 on: April 04, 2009, 04:46:26 pm »
No idea at the moment.

The whole "frame"-part of the debug-report is of interest (frame 0 to frame 30).

The other thing I would try if I where you, is to delete the layout-file or change "Settings -> Environment -> General settings -> On project load:" not to open the files on start.
By the way: the Cursor position is not the line, but the position in characters, so it's most likely correct.

You will now be able to see, if the crash occurs on load, or on file-opening/code-parsing.

On linux you can also start C::B from a console-window to see the debug-output, that might also be helpful.

And of course you can try to revert the changes, you had to do to make the intel-compiler work.
I think, if you have to force the system-language to the fallback (C) there might be something wrong with the compiler (or it's installation).

Offline CBLaw

  • Single posting newcomer
  • *
  • Posts: 8
Re: C::B Just decided to start crashing while loading my project
« Reply #2 on: April 04, 2009, 05:37:09 pm »
Well, I got it to load! I commented out all the changes in .bashrc and .profile and presto. This of course means no Intel C.  Haha. It's gonna take hours to put all the things I've been screwing with back now! I didn't realize that you had to restart your session in order for changes in .bashrc and .profile to take effect. Oh well, still it seems weird that C::B doesn't like those changes. I'd like it if some one could provide an explination and/or a work around. I don't NEED intel C, but it'd be nice.

Without:
   export LANG=C
   export LC_ALL=C
in those files, you get a catastrophic failure error of some sort from the intel compiler.

Thanks for the help and thanks to the C::B team for all their hard work on this IDE and forum! Great work! 8)

Edit: Here's the exact catastrophic error:
"Catastrophic error: could not set locale "" to allow processing of multibyte characters"

I've also posted for help over at Intel. If they come up with anything I'll report back. I'm starting to believe that the install is not meant for my version of Ubuntu. I may have to switch to OpenSuse.
« Last Edit: April 04, 2009, 09:32:16 pm by CBLaw »

Offline CBLaw

  • Single posting newcomer
  • *
  • Posts: 8
Re: C::B Just decided to start crashing while loading my project
« Reply #3 on: April 05, 2009, 03:31:35 am »
   Well, I still don't have a fix, but I've learned something. If I go to the terminal and type "locale" I can see
that LANG=en_CA.UTF-8. Looks to me like LANG is already set to something useful, so changing it to "c" could be problematic I guess.
   Hummm anyone know if I can issue a terminal command before the build to set LANG to "c" to make the Intel compiler happy, then after the build change it back to "en_CA.UTF-8" to make C::B happy?
Seems like a bad hack job, but if it works I'll call it a victory and finally sleep tonight!

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: C::B Just decided to start crashing while loading my project
« Reply #4 on: April 05, 2009, 11:59:31 am »
It is possible to set environment variables when you execute commands, and they will only be seen by the command. If the command you need to execute is icc and you want to execute it with LANG=C, you can issue the command: LANG=C icc. You may want to try replacing that in the Toolchain in Code::Blocks, but I have my doubts about it working as expected.

Another method is to use a script file that sets the environment variable before calling the compiler, and telling Code::Blocks to use that script as your compiler. The script file would look something like:

Code
export LANG=C
icc $@

Yet another method is to use the environment variables option in Code::Blocks. What I do not know is if they will be used when calling the compiler. You may want to try this one first.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: C::B Just decided to start crashing while loading my project
« Reply #5 on: April 05, 2009, 12:16:45 pm »
Yet another method is to use the environment variables option in Code::Blocks. What I do not know is if they will be used when calling the compiler. You may want to try this one first.

They will, I do that myself to change my german language to english. Otherwise I would have to change the regexes that analyse the compiler-output.

Offline CBLaw

  • Single posting newcomer
  • *
  • Posts: 8
Re: C::B Just decided to start crashing while loading my project
« Reply #6 on: April 05, 2009, 01:43:52 pm »
SUCCESS! :D   Phew! The compiler may be free, but factor in my time and it's an expensive compiler! Yeah setting LANG=C and LC_ALL=C via Settings->Environment->Environment Variables->"Setup (toggle) environment variables" finally worked!
   Thanks again for all the help! ...Now to get the debugger working...? :?