Fatal: ASSERT: "m_cobj" in file src/midiledhandler.cpp, line 16

Bug #254564 reported by ironstorm
4
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Critical
ironstorm
1.6
Fix Released
Critical
Albert Santoni

Bug Description

This Assert kills mixxx 1.6.0b4 on Mac OSX 10.5.4 when the Hercules RMX MIDI mapping is selected.

Removing the <lights> section from the bottom of the midi.xml file resolves the problem temporarily.

Here is the context leading up to the failure:
Debug: Created new VinylControlXwax!
Debug: Xwax Vinyl control starting with a sample rate of: 44100
Debug: Building timecode lookup tables...
Allocating 2097152 slots (8192Kb) for 20 bit timecode (Serato 2nd Ed., side A)
Debug: Created new VinylControlXwax!
Debug: SoundDevicePortAudio::open() "1, Hercules DJ Console RMX"
Debug: m_dSampleRate 44100
Debug: iLatencyMSec: 64
Debug: output channels: 4 | input channels: 0
Debug: iLatencySamples: 11292
Debug: iLatencyMSec: 64
Debug: Opening stream with id 1
Debug: Opened PortAudio stream successfully... starting
Debug: PortAudio: Started stream successfully
Debug: iNumDevicesOpenedForOutput: 1
Debug: iNumDevicesOpenedForInput: 0
Debug: SoundManager::getDeviceList
Debug: setupMappings( "/Applications/Mixxx.app/midi/Hercules DJ Console Rmx.led.midi.xml" )
Debug: Defaulting "jog" sensitivity to 50
Debug: Found option "hercjog"
Debug: Option: 8
Debug: Found option "button"
Debug: Option: 6
Debug: Found option "button"
Debug: Option: 6
Debug: Found option "switch"
Debug: Option: 7
Debug: Defaulting "jog" sensitivity to 50
Debug: Found option "hercjog"
Debug: Option: 8
Debug: Found option "button"
Debug: Option: 6
Debug: Found option "button"
Debug: Option: 6
Debug: Found option "switch"
Debug: Option: 7
Warning: No <midino> defined in MIDI map node: "#comment"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Debug: Defaulting "scratch" sensitivity to 50
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Warning: No <midino> defined in MIDI map node: "#comment"
Debug: Config value: "0 ch 1"
Debug: ControlObject::getControl returning NULL for ( "" , "" )
Fatal: ASSERT: "m_cobj" in file src/midiledhandler.cpp, line 16

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

My uber lazy suggestion is just to stick a guard in front of the function as seen in the patch below...
Please comment if anyone either wants to investigate the cause or has an even lazier fix...

Index: midiledhandler.cpp
===================================================================
--- midiledhandler.cpp (revision 2217)
+++ midiledhandler.cpp (working copy)
@@ -10,6 +10,7 @@
                                double max, unsigned char status, unsigned char byte1)
     : m_min(min), m_max(max), m_midi(midi), m_status(status), m_byte1(byte1) {

+ if (group.isEmpty() || name.isEmpty()) return;
     m_cobj = ControlObject::getControl(ConfigKey(group, name));

     //m_cobj should never be null, so Q_ASSERT here to make sure that we hear about it if it is null.

Revision history for this message
Albert Santoni (gamegod) wrote :

Why are those #comment blocks in there?

What happens if you try changing the comments to proper <!-- blah --> XML comments?

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

You can delete all the comments it still assert fails, you can have an empty lights block <lights></lights> and the assert also fails.

If you remove the <lights> block then it works without the leds.

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

BTW, the comments are in proper <!-- blah --> format... when they are parsed they are of DOM node type #comment.

Revision history for this message
Albert Santoni (gamegod) wrote :

Ah crap, this is showing up in the wild:
http://www.mixxx.org/forums/viewtopic.php?f=3&t=183

I'm going to take a look at your patch, do my best to make sure it doesn't break anything, then apply it (before the 1.6.0 release).

I wouldn't mark this bug as closed until we figure out what's really going on and fix it properly though.

Albert Santoni (gamegod)
Changed in mixxx:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
ironstorm (ironstorm-gmail) wrote :

I can also reproduce this error on Windows using the released 1.6.0 build w/ a Herc RMX

Revision history for this message
Albert Santoni (gamegod) wrote :

I'm trying to figure out why this happens, and I see that I committed your patch to trunk on August 5th, before the 1.6.0 release.

Looks like there's a separate issue (same code though) where an invalid group/control name is requested and a NULL ControlObject is being returned. Based on the feedback from the forums, I think it has to do with that "scratch" control, so that's the next place to look.

Revision history for this message
Albert Santoni (gamegod) wrote :

Ok, I see the problem right away now. From the RMX Midi mapping:

277 <!-- Scratch -->
278 <control>
279 <group>[Master]</group>
280 <key>scratch</key>
281 <miditype>Key</miditype>
282 <midino>0x29</midino>
283 <midichan>1</midichan>
284 </control>

There is no [Master] scratch control in Mixxx.

I'm going to remove this from the XML file, and it should resolve this bug. Garth, does this sound reasonable?

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

That's probably it... As an aside I think we should change
Q_ASSERT(m_cobj);
to
Q_ASSERT_X(m_cobj, "MidiLedHandler", "Invalid config group: '" + group + "' name:'" + name + "'");
If that's valid syntax...

Revision history for this message
Albert Santoni (gamegod) wrote :

We'll split the points on this one Garth :)

Changed in mixxx:
assignee: nobody → ironstorm
status: Confirmed → Fix Committed
assignee: ironstorm → ironstorm-gmail
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5014

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.