christophhart / HISE

The open source framework for sample based instruments
http://hise.audio
Other
1.07k stars 123 forks source link

segfault on standalone for Linux #5

Closed davephillips closed 7 years ago

davephillips commented 8 years ago

Latest git pull, Fedora 21 x86_64, GCC 4.9.2.

Program received signal SIGSEGV, Segmentation fault. 0x000000000040d1ef in juce::CharPointer_UTF8::isEmpty ( this=0x18e6b28 juce::juce_xmltextContentAttributeName) at ../../JuceLibraryCode/modules/hi_backend/../../../../../hi_backend/../hi_modules/../hi_scripting/../hi_core/../JUCE/modules/juce_core/text/juce_CharPointer_UTF8.h:80 80 inline bool isEmpty() const noexcept { return *data == 0; }

Simple backtrace:

(gdb) bt

0 0x000000000040d1ef in juce::CharPointer_UTF8::isEmpty (

this=0x18e6b28 <juce::juce_xmltextContentAttributeName>)
at ../../JuceLibraryCode/modules/hi_backend/../../../../../hi_backend/../hi_modules/../hi_scripting/../hi_core/../JUCE/modules/juce_core/text/juce_CharPointer_UTF8.h:80

1 0x000000000045afe0 in juce::String::isEmpty (

this=0x18e6b28 <juce::juce_xmltextContentAttributeName>)
at ../../../../hi_backend/../hi_modules/../hi_scripting/../hi_core/../JUCE/modules/juce_core/text/juce_String.h:311

2 0x0000000000920a5f in juce::StringPool::getPooledString (

this=0x18e6b80 <juce::StringPool::getGlobalPool()::pool>, newString=...)
at ../../../../JUCE/modules/juce_core/text/juce_StringPool.cpp:136

3 0x00000000009162ab in juce::Identifier::Identifier (this=0x7fffffffca50,

nm=...) at ../../../../JUCE/modules/juce_core/text/juce_Identifier.cpp:51

4 0x000000000092e110 in juce::XmlElement::createTextElement (text=...)

at ../../../../JUCE/modules/juce_core/xml/juce_XmlElement.cpp:888

5 0x000000000092a07a in juce::XmlDocument::readChildElements (

this=0x7fffffffd5e0, parent=...)
at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:642

6 0x000000000092938e in juce::XmlDocument::readNextElement (

this=0x7fffffffd5e0, alsoParseSubElements=true)
at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:435

7 0x0000000000929b74 in juce::XmlDocument::readChildElements (

this=0x7fffffffd5e0, parent=...)
at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:549

8 0x000000000092938e in juce::XmlDocument::readNextElement (

this=0x7fffffffd5e0, alsoParseSubElements=true)
at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:435

9 0x0000000000928649 in juce::XmlDocument::parseDocumentElement (

this=0x7fffffffd5e0, textToParse=..., onlyReadOuterDocumentElement=false)
at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:215

10 0x00000000009281be in juce::XmlDocument::getDocumentElement (

this=0x7fffffffd5e0, onlyReadOuterDocumentElement=false)
at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:142

11 0x0000000000927e0f in juce::XmlDocument::parse (file=...)

at ../../../../JUCE/modules/juce_core/xml/juce_XmlDocument.cpp:56

12 0x0000000000a0d7a8 in juce::FTTypefaceList::getDefaultFontDirectories ()

at ../../../../JUCE/modules/juce_graphics/native/juce_linux_Fonts.cpp:34

13 0x0000000000a18320 in juce::FTTypefaceList::FTTypefaceList (this=0x18ea0c0)

at ../../../../JUCE/modules/juce_graphics/native/juce_freetype_Fonts.cpp:88

14 0x0000000000a18dd2 in juce::FTTypefaceList::getInstance ()

at ../../../../JUCE/modules/juce_graphics/native/juce_freetype_Fonts.cpp:227

15 0x0000000000a19149 in juce::FreeTypeTypeface::FreeTypeTypeface (

this=0x18ea280, data=0xe6d2c0 <HiBinaryData::temp_binary_data_15126>, 
dataSize=48812)
at ../../../../JUCE/modules/juce_graphics/native/juce_freetype_Fonts.cpp:303

16 0x0000000000a0dc93 in juce::Typeface::createSystemTypefaceFor (

data=0xe6d2c0 <HiBinaryData::temp_binary_data_15126>, dataSize=48812)
at ../../../../JUCE/modules/juce_graphics/native/juce_linux_Fonts.cpp:74

17 0x000000000040d070 in __static_initialization_and_destruction_0 (

__initialize_p=1, __priority=65535)
at ../../JuceLibraryCode/modules/hi_backend/../../../../../hi_backend/../hi_modules/../hi_scripting/../hi_core/Macros.h:71

18 0x000000000040d147 in _GLOBAL__sub_I_DspUnitTests.cpp(void) ()

at ../../../../hi_scripting/scripting/api/DspUnitTests.cpp:142

19 0x0000000000bc1ded in __libc_csu_init ()

20 0x000000327541ff6f in __libc_start_main () from /lib64/libc.so.6

21 0x000000000040ce89 in _start ()

christoph-hart commented 8 years ago

Sorry I don't have the time or the resources to offer linux support (although it's possible that it works out of the box).

If you want to send some pull requests that won't affect the other OS, I'm happy to check them in.

falkTX commented 8 years ago

I've seen some similar crashes to this, they are usually caused by the use of the static String::empty and/or File::null variables. Juce added a macro recently that disables those. We should try building with that.

Also, if your code uses String::empty you should really move it to String().

christoph-hart commented 8 years ago

Interesting. What's the macro's name (I never stumbled over it).

And I am using a lot of String::empty or File::null / File::nonexistent, but it should be a easy search & replace op if this is really all it needs.

falkTX commented 8 years ago

The macro is JUCE_ALLOW_STATIC_NULL_VARIABLES. (should manually be set to 0) More info here https://github.com/julianstorer/JUCE/blob/master/modules/juce_core/juce_core.h#L159

christoph-hart commented 8 years ago

Ah I see. The problem is I am a still on JUCE 4.1.0 and even if I get rid of the static references in my code it's still cluttered all over the JUCE code (I found the specific commit and it is a lot)

I'll need to upgrade at some time anyway, so this is another reason to do it...

Am Sonntag, 30. Oktober 2016 schrieb Filipe Coelho :

The macro is JUCE_ALLOW_STATIC_NULL_VARIABLES. (should manually be set to 0) More info here https://github.com/julianstorer/JUCE/blob/master/ modules/juce_core/juce_core.h#L159

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/christophhart/HISE/issues/5#issuecomment-257144773, or mute the thread https://github.com/notifications/unsubscribe-auth/AF_JMm5sLjwIZwUybke0XPg8F1-CtmC6ks5q5Ho6gaJpZM4KKoCi .

yellowcox commented 8 years ago

Hi,

Davephillips, can you give me your procedure to compile Hise under Linux? I didn't find any information for this OS... Thx a lot!

davephillips commented 8 years ago

@yellowcox I create the Linux makefile with the Introjucer then build from there. However, there are also a few capitalization fixes required (Common.h/common.h, LFOEditor/LfoEditor, maybe others) and you may need to ensure that you cancel references to the IPP libstuff (mostly in the hi_core module, IIRC). I've successfully built the plugin and standalone versions, but alas, the plugin won't instantiate in Bitwig or Ardour and the standalone segfaults with the error cited in my first message.

christoph-hart commented 8 years ago

Actually if you #define USE_IPP 0 in the AppConfig.h user section, it should not rely on any IPP stuff.

But as Falk said, as long as I have these static instances of File::nonexistent and String::empty scattered around the code you won't have a good time trying to run it on Linux. I'll do something about that as soon as I update the JUCE version.

christoph-hart commented 7 years ago

Alright, I'm on the latest JUCE version and removed all static null variables. If anybody with a Linux setup wants to retry compiling, now is the time :)

christoph-hart commented 7 years ago

Alright, it should run now. I was getting the same error messages but removing the static font typeface initializer fixed it.

I am on a VM with Ubuntu and can't figure out how to activate JACK there. The audio is pretty messed up so I can't test it properly.