Post quake problem


#1

I built my app fine, but it looks like there are some Font problems, when trying to use embedded fonts (i remember posting this bug on OSX some time ago, there was a problem with memory allocation or memory copying on different platforms)

Here is a stack trace on Linux when starting my app

0  0x00007ffff6668abb  memcpy    
1  0x000000000050f315  juce::MemoryInputStream::read  /home/atom/devel/juce/modules/juce_core/streams/juce_MemoryInputStream.cpp  73
2  0x00000000005308ff  juce::GZIPDecompressorInputStream::read  /home/atom/devel/juce/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp  219
3  0x000000000050e1f8  juce::BufferedInputStream::ensureBuffered  /home/atom/devel/juce/modules/juce_core/streams/juce_BufferedInputStream.cpp  123
4  0x000000000050e333  juce::BufferedInputStream::read  /home/atom/devel/juce/modules/juce_core/streams/juce_BufferedInputStream.cpp  145
5  0x000000000050e738  juce::InputStream::readByte  /home/atom/devel/juce/modules/juce_core/streams/juce_InputStream.cpp  32
6  0x000000000050ec36  juce::InputStream::readString  /home/atom/devel/juce/modules/juce_core/streams/juce_InputStream.cpp  159
7  0x000000000050e541  juce::BufferedInputStream::readString  /home/atom/devel/juce/modules/juce_core/streams/juce_BufferedInputStream.cpp  195
8  0x00000000005dd7af  juce::CustomTypeface::CustomTypeface  /home/atom/devel/juce/modules/juce_graphics/fonts/juce_CustomTypeface.cpp  121
9  0x000000000079d54f  getBuiltInFont  /home/atom/devel/ctrlrv4/Source/Application/CtrlrUtilities.cpp  498
10  0x0000000000816d58  CtrlrLCDLabel::valueTreePropertyChanged  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrComponents/Labels/CtrlrLCDLabel.cpp  186
11  0x000000000063c0ac  juce::ListenerList<juce::ValueTree::Listener, juce::Array<juce::ValueTree::Listener*, juce::DummyCriticalSection> >::call<juce::ValueTree&, juce::Identifier const&>  /home/atom/devel/juce/modules/juce_events/broadcasters/juce_ListenerList.h  189
12  0x00000000006350b7  juce::ValueTree::SharedObject::sendPropertyChangeMessage  /home/atom/devel/juce/modules/juce_data_structures/values/juce_ValueTree.cpp  231
13  0x000000000063510f  juce::ValueTree::SharedObject::sendPropertyChangeMessage  /home/atom/devel/juce/modules/juce_data_structures/values/juce_ValueTree.cpp  240
14  0x0000000000635686  juce::ValueTree::SharedObject::setProperty  /home/atom/devel/juce/modules/juce_data_structures/values/juce_ValueTree.cpp  333
15  0x0000000000636f95  juce::ValueTree::setProperty  /home/atom/devel/juce/modules/juce_data_structures/values/juce_ValueTree.cpp  679
16  0x000000000088b360  CtrlrComponent::setProperty  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrComponents/CtrlrComponent.cpp  277
17  0x0000000000816000  CtrlrLCDLabel::CtrlrLCDLabel  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrComponents/Labels/CtrlrLCDLabel.cpp  56
18  0x0000000000861273  CtrlrComponentTypeManager::createComponent  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrComponents/CtrlrComponentTypeManager.cpp  46
19  0x0000000000861739  CtrlrComponentTypeManager::createComponent  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrComponents/CtrlrComponentTypeManager.cpp  75
20  0x00000000007675e4  CtrlrModulator::setComponentType  /home/atom/devel/ctrlrv4/Source/Core/CtrlrModulator.cpp  423
21  0x0000000000767777  CtrlrModulator::setComponentType  /home/atom/devel/ctrlrv4/Source/Core/CtrlrModulator.cpp  438
22  0x0000000000955396  CtrlrPanelCanvas::addNewComponent  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrPanel/CtrlrPanelCanvas.cpp  348
23  0x00000000009200fa  CtrlrPanelCanvas::handleRightClickOnCanvas  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrPanel/CtrlrPanelCanvasHandlers.cpp  99
24  0x0000000000954709  CtrlrPanelCanvas::mouseDown  /home/atom/devel/ctrlrv4/Source/UIComponents/CtrlrPanel/CtrlrPanelCanvas.cpp  182
25  0x00000000004248af  juce::Component::internalMouseDown  /home/atom/devel/juce/modules/juce_gui_basics/components/juce_Component.cpp  2386
26  0x00000000004ad7d5  juce::MouseInputSourceInternal::sendMouseDown  /home/atom/devel/juce/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp  111
27  0x00000000004adb84  juce::MouseInputSourceInternal::setButtons  /home/atom/devel/juce/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp  176
28  0x00000000004ae06d  juce::MouseInputSourceInternal::handleEvent  /home/atom/devel/juce/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp  277
29  0x000000000042a336  juce::MouseInputSource::handleEvent  /home/atom/devel/juce/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp  526
30  0x0000000000497dee  juce::ComponentPeer::handleMouseEvent  /home/atom/devel/juce/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp  94
31  0x00000000004cf0fd  juce::LinuxComponentPeer::handleButtonPressEvent  /home/atom/devel/juce/modules/juce_gui_basics/native/juce_linux_Windowing.cpp  1404
32  0x00000000004ce7d1  juce::LinuxComponentPeer::handleWindowMessage  /home/atom/devel/juce/modules/juce_gui_basics/native/juce_linux_Windowing.cpp  1206
33  0x00000000004a52f7  juce::juce_windowMessageReceive  /home/atom/devel/juce/modules/juce_gui_basics/native/juce_linux_Windowing.cpp  2599
34  0x0000000000573f27  juce::InternalMessageQueue::dispatchNextXEvent  /home/atom/devel/juce/modules/juce_events/native/juce_linux_Messaging.cpp  186
35  0x0000000000573ae6  juce::InternalMessageQueue::dispatchNextEvent  /home/atom/devel/juce/modules/juce_events/native/juce_linux_Messaging.cpp  94
36  0x0000000000572aa2  juce::MessageManager::dispatchNextMessageOnSystemQueue  /home/atom/devel/juce/modules/juce_events/native/juce_linux_Messaging.cpp  451
37  0x000000000056fc71  juce::MessageManager::runDispatchLoopUntil  /home/atom/devel/juce/modules/juce_events/messages/juce_MessageManager.cpp  143
38  0x000000000056fbdf  juce::MessageManager::runDispatchLoop  /home/atom/devel/juce/modules/juce_events/messages/juce_MessageManager.cpp  123
39  0x00000000004a1d77  juce::JUCEApplication::main  /home/atom/devel/juce/modules/juce_gui_basics/application/juce_Application.cpp  213
40  0x00000000004a1f03  juce::JUCEApplication::main  /home/atom/devel/juce/modules/juce_gui_basics/application/juce_Application.cpp  261
41  0x0000000000787780  main  /home/atom/devel/ctrlrv4/Source/Application/StandaloneWrapper/CtrlrStandaloneApplication.cpp  40

#2

Hmm. Looking at the code in that stack trace, I can’t see any obvious mistakes, it looks to me like you might be passing it a pointer to a duff MemoryInputStream or something?


#3

this is a resource built from a file in Jucer, nothing special here, it works on windows and mac (it used to fail on mac then you fixed something)


#4

Well, looking at the code I can’t see any bugs - I think you’d need to send me some code that reproduces it…


#5

fyi the mac error report for the same problem

http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=7247


#6

I already fixed the problem that you mentioned in that other thread - I can’t see anything wrong with the code now.

Can you give me some code I can paste into the demo that’ll make this happen? If not, I can’t really see any way I can track it down.


#7

Wanted to test some of that code but i can’t build JuceDemo with the latest tip:


In file included from ../../../../modules/juce_opengl/juce_opengl.cpp:149:0:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In constructor ‘juce::WindowedGLContext::WindowedGLContext(juce::Component*, const juce::OpenGLPixelFormat&, __GLXcontextRec*)’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:38:9: error: ‘LinuxComponentPeer’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:38:29: error: expected primary-expression before ‘const’
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:38:29: error: expected ‘;’ before ‘const’
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:39:13: error: ‘peer’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:43:16: error: ‘display’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:68:35: error: ‘peer’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:84:54: error: ‘windowHandleXContext’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In destructor ‘virtual juce::WindowedGLContext::~WindowedGLContext()’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:98:23: error: ‘display’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In member function ‘virtual void juce::WindowedGLContext::deleteContext()’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:109:32: error: ‘display’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In member function ‘virtual bool juce::WindowedGLContext::makeActive() const’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:119:32: error: ‘display’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In member function ‘virtual bool juce::WindowedGLContext::makeInactive() const’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:126:50: error: ‘display’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In member function ‘virtual void juce::WindowedGLContext::updateWindowPosition(const juce::Rectangle<int>&)’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:148:28: error: ‘display’ was not declared in this scope
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp: In member function ‘virtual void juce::WindowedGLContext::swapBuffers()’:
../../../../modules/juce_opengl/native/juce_linux_OpenGLComponent.cpp:155:25: error: ‘display’ was not declared in this scope
make: *** [build/intermediate/Debug/juce_opengl_1890bee0.o] Error 1

#8

Oops! Sorry, I’ve fixed that now.


#9

I think i found the problem here, i was using a copy/paste method from the fontserializer by zamrate, and that was causing crashes when using the embedded font data. I wrote my own font serializer that writes data to a file and i added that file as a resource in the Introjucer and used that (in exactly the same way), and now it’s ok.