Why my program can't run under debian/Linux?

Dear all:

My program can run under debian/Linux by build progam CONFIG=Debug,
but it can build when CONFIG=Release, but it can not run, it still sop in this line:

src/core/juce_Atomoc.h:Line258

please help me!

Does the demo app run ok? If it does, then you’re probably doing something dodgy in your own code… And if the demo doesn’t run, then have you tried the latest juce version from GIT?

Dear jules:

i get the latest juce demo from GIT, and build them by CONFIG=Release , then it can not run too, and stop this too < src/core/juce_Atomoc.h:Line258 >

all can run under Debug Mode, but can not run under Release!!!

can you give me some help?

Well, it works just fine for me (in ubuntu)…

HAve you got the latest gcc? The atomics are generated by the compiler, so maybe you’re hitting a compiler bug…

src/core/juce_Atomoc.h:Line258: while (! compareAndSetBool (newValue, currentVal)) { currentVal = value; }

in this line, the run for ever, i use the latest gcc in debian/linux. compareAndSetBool always return false.

i come from China, my english is very poor, sorry.

Well, that’s a complete mystery… What else is on the call stack?

your latest demo app have same problem, so i think this is a bug, but i have no idea to solve this.
i need your help, thank you!

Yeah, I’d like to help you - that why I asked what was on the call stack? Have you tried debugging it? Since I can’t reproduce it, you’ll need to provide some more helpful information!

same here, the jucedemo in release mode hangs when starting:

$ gdb build/JuceDemo 
GNU gdb (Gentoo 7.2 p1) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /juce-trunk/extras/juce demo/Builds/Linux/build/JuceDemo...(no debugging symbols found)...done.
(gdb) run
Starting program: /juce-trunk/extras/juce demo/Builds/Linux/build/JuceDemo 
[Thread debugging using libthread_db enabled]
^C
Program received signal SIGINT, Interrupt.
0x0809ebb7 in juce::String::operator=(juce::String const&) ()
(gdb) bt
#0  0x0809ebb7 in juce::String::operator=(juce::String const&) ()
#1  0x080b13f9 in juce::XmlDocument::getDocumentElement(bool) ()
#2  0x080b1630 in juce::XmlDocument::parse(juce::File const&) ()
#3  0x08207649 in juce::FreeTypeInterface::FreeTypeInterface() ()
#4  0x08207853 in juce::FreeTypeInterface::getInstance() ()
#5  0x081eb31e in juce::Font::getPlatformDefaultFontNames(juce::String&, juce::String&, juce::String&, juce::String&) ()
#6  0x0816f92f in juce::LookAndFeel::LookAndFeel() ()
#7  0x08179575 in juce::LookAndFeel::setDefaultLookAndFeel(juce::LookAndFeel*) ()
#8  0x080b5cf0 in juce::initialiseJuce_GUI() ()
#9  0x08108f08 in juce::JUCEApplication::main(juce::String const&) ()
#10 0x0810904f in juce::JUCEApplication::main(int, char const**) ()
#11 0x0804f883 in main ()
  • gcc version 4.3.3 (Gentoo 4.3.3-r2 p1.2, pie-10.1.5)
  • Linux roxxorx 2.6.36-zen2 #2 ZEN SMP PREEMPT Fri Dec 3 12:42:34 CET 2010 i686 Intel® Core™2 Duo CPU T7500 @ 2.20GHz GenuineIntel GNU/Linux

any hints ?

ok, Dear jules, thank you very much!

same as you say, i haove debuged the demo app project, and discovery it stop at :

src/core/juce_Atomoc.h:Line258: while (! compareAndSetBool (newValue, currentVal)) { currentVal = value; }

int the while, compareAndSetBool (newValue, currentVal) always return false, the while execute for ever, so the jucedemo will hangs when starting like kraken say.

do you need any other help?
i use the latest Debian/Linux5.07, and use the latest gcc by apt-get.

Dear jules, kraken:

i find a not good method to solved this problem, it a temporary method.

in Release mode, set to “No optimistation” .just do this, the app can run normal.

i hope you can find better method to solved this!!!

neilzhu

It’s certainly a compiler problem - the code is perfectly ok and works for me with gcc 4.4.3 (and also gcc4.2 on the mac of course). Maybe try upgrading to 4.4.3…?