Random Segmentation Faults


#1

I'm having a lot of SIGSEGV all over the place at random places and random times on Android, I thinks it has to be with the memory, but I don't know where to look, I was testing a lot and didn't find any place that has memory issues (doesn't mean they don't exists, just I can't find them), and here are the reasons I can't find the bug, every crash is in a different place and almost all of them are just in JUCE code:

Log 1:  signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

I/DEBUG   ( 5398): backtrace:
I/DEBUG   ( 5398):     #00  pc 000117d0  /system/lib/libc.so (dlfree+1191)
I/DEBUG   ( 5398):     #01  pc 0000dd1f  /system/lib/libc.so (free+10)
I/DEBUG   ( 5398):     #02  pc 00860fc4  /data/app-lib/com.edrans.wimc-66/libjuce_jni.so (juce::HeapBlock<juce::Component*, false>::~HeapBlock()+28)
I/DEBUG   ( 5398):     #03  pc 008465b8  /data/app-lib/com.edrans.wimc-66/libjuce_jni.so (juce::ArrayAllocationBase<juce::Component*, juce::DummyCriticalSection>::~ArrayAllocationBase()+24)
I/DEBUG   ( 5398):     #04  pc 00823484  /data/app-lib/com.edrans.wimc-66/libjuce_jni.so (juce::Array<juce::Component*, juce::DummyCriticalSection, 0>::~Array()+32)
I/DEBUG   ( 5398):     #05  pc 007516e4  /data/app-lib/com.edrans.wimc-66/libjuce_jni.so (juce::Component::~Component()+664)

Log 2: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

I/DEBUG   ( 5398): backtrace:
I/DEBUG   ( 5398):     #00  pc 000117d0  /system/lib/libc.so (dlfree+1191)
I/DEBUG   ( 5398):     #01  pc 0000dd1f  /system/lib/libc.so (free+10)
I/DEBUG   ( 5398):     #02  pc 005bcca0  /data/app-lib/com.edrans.wimc-67/libjuce_jni.so (juce::StringHolder::release(juce::StringHolder*)+92)
I/DEBUG   ( 5398):     #03  pc 005bcce4  /data/app-lib/com.edrans.wimc-67/libjuce_jni.so (juce::StringHolder::release(juce::CharPointer_UTF8)+52)
I/DEBUG   ( 5398):     #04  pc 005bcf60  /data/app-lib/com.edrans.wimc-67/libjuce_jni.so (juce::String::~String()+44)
I/DEBUG   ( 5398):     #05  pc 00751714  /data/app-lib/com.edrans.wimc-67/libjuce_jni.so (juce::Component::~Component()+744)

Log 3: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000027

I/DEBUG   ( 5398): backtrace:
I/DEBUG   ( 5398):     #00  pc 007dedbc  /data/app-lib/com.edrans.wimc-69/libjuce_jni.so (juce::Label::paint(juce::Graphics&)+40)
I/DEBUG   ( 5398):     #01  pc 007572a4  /data/app-lib/com.edrans.wimc-69/libjuce_jni.so (juce::Component::paintComponentAndChildren(juce::Graphics&)+276)

Log 4: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

(the last line at #06 is my code, where I just set a ScopedPointer<Label> to null and decrement a static int counter)

I/DEBUG   ( 5398): backtrace:
I/DEBUG   ( 5398):     #00  pc 000117d0  /system/lib/libc.so (dlfree+1191)
I/DEBUG   ( 5398):     #01  pc 0000dd1f  /system/lib/libc.so (free+10)
I/DEBUG   ( 5398):     #02  pc 00398f94  /data/app-lib/com.edrans.wimc-70/libjuce_jni.so (juce::HeapBlock<IngredientComponent::Listener*, false>::~HeapBlock()+28)
I/DEBUG   ( 5398):     #03  pc 00398800  /data/app-lib/com.edrans.wimc-70/libjuce_jni.so (juce::ArrayAllocationBase<IngredientComponent::Listener*, juce::DummyCriticalSection>::~ArrayAllocationBase()+24)
I/DEBUG   ( 5398):     #04  pc 00397f98  /data/app-lib/com.edrans.wimc-70/libjuce_jni.so (juce::Array<IngredientComponent::Listener*, juce::DummyCriticalSection, 0>::~Array()+32)
I/DEBUG   ( 5398):     #05  pc 003974e0  /data/app-lib/com.edrans.wimc-70/libjuce_jni.so (juce::ListenerList<IngredientComponent::Listener, juce::Array<IngredientComponent::Listener*, juce::DummyCriticalSection, 0> >::~ListenerList()+24)
I/DEBUG   ( 5398):     #06  pc 0039685c  /data/app-lib/com.edrans.wimc-70/libjuce_jni.so (IngredientComponent::~IngredientComponent()+168)

Log 5: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 91089113

I/DEBUG   ( 5398): backtrace:
I/DEBUG   ( 5398):     #00  pc 00756d24  /data/app-lib/com.edrans.wimc-72/libjuce_jni.so (juce::Component::internalRepaintUnchecked(juce::Rectangle<int>, bool)+140)
I/DEBUG   ( 5398):     #01  pc 00756d14  /data/app-lib/com.edrans.wimc-72/libjuce_jni.so (juce::Component::internalRepaintUnchecked(juce::Rectangle<int>, bool)+124)

 

How can I find anything here? Some advice?

 

Note: on iOS this just works fine. I've tested on the iOS Simulator and a real iPad and nothing.