0.5.3 crashes when trying to query FreeDB.

Ask questions and get answers on how to make Max behave.
Post Reply
Screwtape
Posts: 8
Joined: Tue Jan 24, 2006 11:48 am

0.5.3 crashes when trying to query FreeDB.

Post by Screwtape » Tue Jan 24, 2006 12:24 pm

I have a PowerMac G5 1.6GHz (the very first model of G5), running 10.4.4 and Max 0.5.3. I first discovered Max a few days ago, and I've since been re-ripping various albums where I felt iTunes' encoder fell far too short.

However, I've hit a snag. I have a disc here called 'Kong in Concert', which I downloaded from the official site and burnt myself. I suspect I burnt it correctly, because the CDDB ID of my disc matches the one in the freedb database. When I try to rip it in Max, the following things happen:
  1. I insert the disc
  2. I start Max
  3. Max takes a little while to appear, but that seems to be normal.
  4. When Max does appear, there's no data from FreeDB - which is unusual: normally when Max appears it's already gotten data.
  5. I click the "Query FreeDB" button in the toolbar, and immediately Max disappears and I get a "quit unexpectedly" dialog box.
The traceback from the crash log looks like this:

Code: Select all

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   libSystem.B.dylib    	0x90003008 strlen + 8
1   com.apple.Foundation 	0x928cd644 +[NSString stringWithUTF8String:] + 36
2   org.sbooth.Max       	0x0000b068 0x1000 + 41064
3   org.sbooth.Max       	0x00006c58 0x1000 + 23640
4   com.apple.AppKit     	0x93853ae4 -[NSToolbarButton sendAction:to:] + 76
5   com.apple.AppKit     	0x93853a84 -[NSToolbarButton sendAction] + 80
6   com.apple.AppKit     	0x938533dc -[NSToolbarItemViewer mouseDown:] + 1568
7   com.apple.AppKit     	0x936e7eb0 -[NSWindow sendEvent:] + 4616
8   com.apple.AppKit     	0x93690ef4 -[NSApplication sendEvent:] + 4172
9   com.apple.AppKit     	0x93688330 -[NSApplication run] + 508
10  com.apple.AppKit     	0x93778e68 NSApplicationMain + 452
11  org.sbooth.Max       	0x00002780 0x1000 + 6016
12  org.sbooth.Max       	0x00002628 0x1000 + 5672
The system log says nothing, and the console log says only "Max crashed".

Is there any other information I can provide? I do have some programming experience, but it's mostly in Python (my day job) and basic ANSI C (from University).

I'd be happy to run a hypothetical debugging build of Max, but I don't think my XCode-fu is strong enough to build the thing myself.

Screwtape
Posts: 8
Joined: Tue Jan 24, 2006 11:48 am

Post by Screwtape » Tue Jan 24, 2006 8:35 pm

Thanks to sbooth for sending me a copy of Max with debugging symbols intact.

The traceback now looks like this:

Code: Select all

Thread 0 Crashed:
0   libSystem.B.dylib    	0x90003008 strlen + 8
1   com.apple.Foundation 	0x928cd644 +[NSString stringWithUTF8String:] + 36
2   org.sbooth.Max       	0x0000b428 -[FreeDB fetchMatches] + 536 (crt.c:355)
3   org.sbooth.Max       	0x00007018 -[CompactDiscDocument queryFreeDB:] + 496 (crt.c:355)
4   com.apple.AppKit     	0x93853ae4 -[NSToolbarButton sendAction:to:] + 76
5   com.apple.AppKit     	0x93853a84 -[NSToolbarButton sendAction] + 80
6   com.apple.AppKit     	0x938533dc -[NSToolbarItemViewer mouseDown:] + 1568
7   com.apple.AppKit     	0x936e7eb0 -[NSWindow sendEvent:] + 4616
8   com.apple.AppKit     	0x93690ef4 -[NSApplication sendEvent:] + 4172
9   com.apple.AppKit     	0x93688330 -[NSApplication run] + 508
10  com.apple.AppKit     	0x93778e68 NSApplicationMain + 452
11  org.sbooth.Max       	0x00002b40 _start + 340 (crt.c:272)
12  org.sbooth.Max       	0x000029e8 start + 60
It turns out that there's only about 5 calls to [NSString stringWithUTF8String:] in [FreeDB fetchMatches], but it's not at all obvious which one might be causing the problem.

I guess I could try to build Max myself, but things are kinda busy at work at the moment and I don't have much free time. I'll see what I can do, but in the mean time I hope that traceback helps.

Screwtape
Posts: 8
Joined: Tue Jan 24, 2006 11:48 am

Post by Screwtape » Tue Jan 24, 2006 8:50 pm

I just ran Ethereal while Max was talking to FreeDB, and it turns out the conversation with the FreeDB server goes like this (I'll use bold for replies from the server):

201 eeyore.planetmirror.com CDDBP server v1.5PL3 ready at Wed Jan 25 06:41:57 2006
cddb hello thristian gmail.com Max 0.5.3
200 Hello and welcome thristian@gmail.com running Max 0.5.3
proto 6
201 OK, CDDB protocol level now: 6
cddb query 7f099e0a 10 150 17575 33050 51128 59757 82216 99704 128411 149532 157849 2464
200 soundtrack 7f099e0a Kong in Concert (Disc 1)
230 eeyore.planetmirror.com Closing connection. Goodbye.

I was using au.freedb.org at the time, but the same crash happens (I assume for the same reasons) with freedb.freedb.org.

If that's all the data that FreeDB is returning, I'm not at all surprised that Max is dying with null-pointer exceptions - maybe someone with more CDDBP experience than I can say whether it's legal for the server to return so little data.

User avatar
sbooth
Site Admin
Posts: 2445
Joined: Fri Dec 23, 2005 7:45 am
Location: USA
Contact:

Post by sbooth » Wed Jan 25, 2006 12:04 am

OK, this is definitely a bug in Max. The docs for stringWithUTF8String say

Code: Select all

stringWithUTF8String:
Returns a string created by copying the characters from bytes, which may not be NULL.
and it looks like libcddb returns NULL for fields that are absent from the reply. I'll open a bug in the tracker, fix it, and send another debug build for testing.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest