Opened 12 years ago

Closed 12 years ago

#3855 closed defect (fixed)

mythmusic segfaults during scan for new music

Reported by: skd5aner@… Owned by: stuartm
Priority: minor Milestone: 0.21
Component: mythmusic Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Running recent SVN (r14158), I am no longer able to scan for new music. Whenever I scan, it simply segfault. During troubleshooting, I had completely emptied the music tables. I found that it would find all the directories and subdirectories, then add the first song in the first directory. After that, it would segfault.

I also followed the advice by PaulH and dropped the music_ tables, deleted the MusicDBSchemaVer setting in the settings table, and allowed the tables to be recreated from scratch to make sure the schema was correct. I still saw the same results.

I've included a GDB and mythfrontend -v all log attached.

Attachments (4)

gdb.txt (10.1 KB) - added by skd5aner@… 12 years ago.
mythmusic.log (118.2 KB) - added by skd5aner@… 12 years ago.
metaiotaglib.patch (1.0 KB) - added by Bill <cizek@…> 12 years ago.
3855_possible_fixes.diff (1.9 KB) - added by stuartm 12 years ago.
Possible fixes for both segfaults

Download all attachments as: .zip

Change History (17)

Changed 12 years ago by skd5aner@…

Attachment: gdb.txt added

Changed 12 years ago by skd5aner@…

Attachment: mythmusic.log added

comment:1 Changed 12 years ago by Bill <cizek@…>

I ran across a similar problem over the weekend -- I'd get crashes if the title / artist / album or genre was blank.

The attached patch fixed it for me.

-Bill

Changed 12 years ago by Bill <cizek@…>

Attachment: metaiotaglib.patch added

comment:2 Changed 12 years ago by stuartm

Milestone: unknown0.21
Owner: changed from Isaac Richards to stuartm

Thank you for the patch Bill, I must admit I'd be scratching my head on this one.

comment:3 Changed 12 years ago by skd5aner@…

Well, the patch didn't help... I'm still seeing the same symptoms at the same time. Here is the last few lines of my log (-v all) before it crashes AFTER applying the patch:

2007-08-20 17:43:34.031 MSqlQuery: SELECT CONCAT_WS('/', path, filename), date_m
odified FROM music_songs LEFT JOIN music_directories ON music_songs.directory_id
=music_directories.directory_id WHERE filename NOT LIKE ('%://%')
2007-08-20 17:43:34.032 MSqlQuery: SELECT CONCAT_WS('/', path, filename) FROM mu
sic_albumart LEFT JOIN music_directories ON music_albumart.directory_id=music_di
rectories.directory_id WHERE music_albumart.embedded=0
2007-08-20 17:43:34.034 MSqlQuery: SELECT data FROM settings WHERE value = 'Albu
mArtFilter' AND hostname = 'raptor' ;
2007-08-20 17:43:34.035 MSqlQuery: SELECT data FROM settings WHERE value = 'Albu
mArtFilter' AND hostname IS NULL;
2007-08-20 17:43:34.035 MSqlQuery: SELECT data FROM settings WHERE value = 'NonI
D3FileNameFormat' AND hostname = 'raptor' ;
2007-08-20 17:43:34.057 MSqlQuery: SELECT artist_id FROM music_artists WHERE art
ist_name = '10 Years' ;
2007-08-20 17:43:34.057 MSqlQuery: INSERT INTO music_artists (artist_name) VALUE
S ('10 Years');
2007-08-20 17:43:34.057 MSqlQuery: SELECT LAST_INSERT_ID();
2007-08-20 17:43:34.057 MSqlQuery: SELECT album_id FROM music_albums WHERE artis
t_id = 1  AND album_name = 'The Autumn Effect' ;
2007-08-20 17:43:34.058 MSqlQuery: INSERT INTO music_albums (artist_id, album_na
me, compilation, year) VALUES (1, 'The Autumn Effect', 0, 2005);
2007-08-20 17:43:34.058 MSqlQuery: SELECT LAST_INSERT_ID();
2007-08-20 17:43:34.058 MSqlQuery: SELECT genre_id FROM music_genres WHERE genre
 = 'Unknown Genre' ;
2007-08-20 17:43:34.058 MSqlQuery: INSERT INTO music_genres (genre) VALUES ('Unk
nown Genre');
2007-08-20 17:43:34.059 MSqlQuery: SELECT LAST_INSERT_ID();
2007-08-20 17:43:34.059 MSqlQuery: INSERT INTO music_songs ( directory_id, lastp
lay, artist_id, album_id,  name,         genre_id, year,      track,     length,
       filename, rating,    format,    date_entered, date_modified ) VALUES (  2
, '2007-08-20T17:43:34', 1,   1,    'Wasteland',       1, 2005,     5, 230000,
    '05 ~ 10 Years -  Wasteland.mp3', 0,   '',   '2007-08-20T17:43:34',    '2007
-08-20T17:43:34' );
2007-08-20 17:43:34.060 MSqlQuery: SELECT LAST_INSERT_ID();
2007-08-20 17:43:34.060 MSqlQuery: SELECT albumart_id FROM music_albumart WHERE
song_id=1 AND imagetype=0;
2007-08-20 17:43:34.060 MSqlQuery: INSERT INTO music_albumart ( filename, imaget
ype, song_id, embedded ) VALUES ( '', 0, 1, 1 );
2007-08-20 17:43:34.061 MSqlQuery: INSERT INTO music_albumart SET filename = 'fo
lder.jpg', directory_id = 2, imagetype = 1;
2007-08-20 17:43:34.072 MythSocket(825f560:6): socket is readable
2007-08-20 17:43:34.072 MythSocket(825f560:6): cb->readyRead()

comment:4 Changed 12 years ago by paulh

Could someone email me a file that you know produces the segfault.

I have tried to create my own file with some blank tags but still couldn't get the segfault.

comment:5 Changed 12 years ago by stuartm

Are the files on a local filesystem or a mounted nfs/samba share?

comment:6 Changed 12 years ago by Bill <cizek@…>

My files are mounted locally. Unfortunately I don't know which one actually caused my crash -- I just fixed it and moved on.

comment:7 in reply to:  4 Changed 12 years ago by skd5aner@…

Replying to paulh:

Could someone email me a file that you know produces the segfault.

I have tried to create my own file with some blank tags but still couldn't get the segfault.

I will e-mail the first two files it tries to scan offline to you and stuart. The first one seems to enter into the db, but it never gets to the second one.

comment:8 in reply to:  5 Changed 12 years ago by skd5aner@…

Replying to stuartm:

Are the files on a local filesystem or a mounted nfs/samba share?

Stuart - It's me again (http://svn.mythtv.org/trac/ticket/3607). This is over a CIFS(Samba) share. I have not changed anything at all regarding my library (at least not the first two songs it scans) nor have I changed my mount settings which solved the last issue. The only thing I've done is upgrade myth to latest trunk and now I experience this segfault.

Thanks! Matt

comment:9 Changed 12 years ago by skd5aner@…

Just a follow up, I have eliminated some of the tracks as part of testing to see if it was the first track that caused a segfault or the second. Apparently, it was the second. I was able to add 13 more tracks before the next segfault. So it is apparently related to specific tracks. I will send those to Paul and Stuart offline.

comment:10 Changed 12 years ago by stuartm

First thing, we're looking at two different segfaults here and the patch supplied by Bill fixed the first. Someone else sent me a backtrace for this issue in IRC which included debugging symbols, it seems more like a taglib issue, but one that we can easily work around.

After Matt narrowed down the working/broken revisions I've got an idea for what the second problem might be, I'm putting together a patch now.

Changed 12 years ago by stuartm

Attachment: 3855_possible_fixes.diff added

Possible fixes for both segfaults

comment:11 Changed 12 years ago by stuartm

Patch attached which includes Bill's fix and a couple of possible fixes for Matt's segfault. I haven't tested these.

comment:12 Changed 12 years ago by skd5aner@…

I'm extremely happy to report that Stuart's patch does resolve my segfault issue. Thanks to Bill too, as I'm fairly sure that it's directly related.

Stuart - I still do get a segfault with visualizations as mentioned in #3792 and/or #3836, but obviously those have been reported. Now that I have songs again, I'll try to submit a gdb.txt for those tickets.

Thanks again! Matt

comment:13 Changed 12 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [14252]) Fixes the two taglib related mythmusic scanning segfaults detailed in #3855.

Fixes #3855

Note: See TracTickets for help on using tickets.