I have a crash using juce::TooltipWindow with two plugins in Ardour

Hello,
I have a problem with juce::TooltipWindow that i don’t understand please.
I wrote a very basic example of Plugin.
Following the example given in JUCE/examples/GUI/WidgetsDemo.h, in the Editor.h i declare:
an object:
juce::TooltipWindow ttw;
Then in Editor.cpp, for a widget i write:
object->setTooltip("text");
I i use only one instance of the plugin in DAW Ardour, this works fine, but if i use two instances, then if the mouse pass on the widget, the message “text” appears but DAW Ardour crashes. The debugger (gdb) message is :

Thread 1 (Thread 0x7ffff7a3b900 (LWP 41172) "ArdourGUI"):
#0  0x00007fffe91f075b in kill () at ../sysdeps/unix/syscall-template.S:120
#1  0x00007fff9193789c in juce::TooltipWindow::displayTipInternal (this=0x555557c2d4e8, screenPos=..., tip=..., shownManually=juce::TooltipWindow::no) at /home/faure/install/musique/JUCE/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp:141
#2  0x00007fff91937cc0 in operator() (__closure=0x7fffffffcea0) at /home/faure/install/musique/JUCE/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp:230
#3  0x00007fff91938013 in juce::TooltipWindow::timerCallback (this=0x555557c2d4e8) at /home/faure/install/musique/JUCE/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp:249
#4  0x00007fff91778c42 in juce::Timer::TimerThread::callTimers (this=0x55555d00dfc0) at /home/faure/install/musique/JUCE/modules/juce_events/timers/juce_Timer.cpp:115
#5  0x00007fff91778e6b in juce::Timer::TimerThread::CallTimersMessage::messageCallback (this=0x7fff38000b90) at /home/faure/install/musique/JUCE/modules/juce_events/timers/juce_Timer.cpp:181
#6  0x00007fff9177ac07 in juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}::operator()(int) const (__closure=0x55555aa01da0, fd=46) at /home/faure/install/musique/JUCE/modules/juce_events/native/juce_linux_Messaging.cpp:42

etc

May be i use tooltip in a bad way? Thanks,
Frédéric.

If you read your stack trace, the oddly named kill is something generally called to deliberately crash due to an unrecoverable error.

It’s interesting to know why juce::TooltipWindow::displayTipInternal called it. Let’s look at the code in juce_TooltipWindow.cpp line 141:

// Looks like you have more than one TooltipWindow showing the same tip..
// Be careful not to create more than one instance of this class with the
// same parent component!
jassertfalse;

Perhaps that comment above the failed assertion can give you a relevant pointer.

Btw I just tested to see if Auto-Align 2 exhibits this problem. It doesn’t.

The only difference from what you describe is that we declare

juce::TooltipWindow tooltipWindow {this};

In the plugin’s editor. So it appears to work fine with the added {this} parameter.

Yes, thanks it works fine with

juce::TooltipWindow tooltipWindow {this};

In the plugin’s editor.

1 Like