milohr / babe-qt

This version is unmantained. The new version is now named VVAVE
https://phabricator.kde.org/source/vvave/
Other
140 stars 9 forks source link

Crash when adding new music sources #24

Closed diegogangl closed 7 years ago

diegogangl commented 7 years ago

Babe crashes when I add a new music source folder, however the files are actually added with covers, pictures, lyrics and all.

(also a small issue: covers look a little pixelated)

Stuff in the terminal:

Collection dir added:  "/home/januz/music/Prog/Darkwater"
Function Name:  void settings::populateDB(QString) new path for database action:  "/home/januz/music/Prog/Darkwater"
started wrrting to database...
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 03 Again.mp3"
the album has a title
writting to db:  "Again"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 05 The Play - I.mp3"
the album has a title
writting to db:  "The Play - I"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 06 The Play - II.mp3"
the album has a title
writting to db:  "The Play - II"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 01 2534167.mp3"
the album has a title
writting to db:  "2534167"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 07 Shattered.mp3"
the album has a title
writting to db:  "Shattered"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 02 All Eyes On Me.mp3"
the album has a title
writting to db:  "All Eyes On Me"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 08 Tallest Tree.mp3"
the album has a title
writting to db:  "Tallest Tree"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 09 In My Dreams.mp3"
the album has a title
writting to db:  "In My Dreams"
"/home/januz/music/Prog/Darkwater/Calling The Earth To Witness/Darkwater - Calling the Earth to Witness - 04 Habit.mp3"
the album has a title
writting to db:  "Habit"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 03 Into the Cold.mp3"
the album has a title
writting to db:  "Into the Cold"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 04 A Folls Utopia.mp3"
the album has a title
writting to db:  "A Folls Utopia"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 06 In the Blind of an Eye.mp3"
the album has a title
writting to db:  "In the Blind of an Eye"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 02 Why I Bleed.mp3"
the album has a title
writting to db:  "Why I Bleed"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 07 Fields of Sorrow.mp3"
the album has a title
writting to db:  "Fields of Sorrow"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 08 Without a Sound.mp3"
the album has a title
writting to db:  "Without a Sound"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 09 Walls of Deception.mp3"
the album has a title
writting to db:  "Walls of Deception"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 05 Queen of the Night.mp3"
the album has a title
writting to db:  "Queen of the Night"
"/home/januz/music/Prog/Darkwater/Where stories end/Darkwater - Where Stories End - 01 Breathe.mp3"
the album has a title
writting to db:  "Breathe"
finished wrrting to database
now it i time to put the tracks in the table ;)
ON POPULATE: "SELECT * FROM tracks"
The Query is:  "SELECT * FROM tracks"
found the query
finished populating tables, now ordering them
ON POPULATE ALBUM VIEW:
ON POPULATE HEADS VIEW:
good to hear it finished yay! now going to fetch artwork
"Darkwater" "Calling the Earth to Witness"
fixing the title string in order to get album title: "Again"
Going to try and get the art cover for:  "Calling the Earth to Witness" by "Darkwater" "Again"
thealbum name is: "Calling the Earth to Witness"
on setDataCover: "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=ba6f0bd3c887da9101c10a50cf2af133&artist=Darkwater&album=Calling the Earth to Witness"
the cover art url is "https://lastfm-img2.akamaized.net/i/u/300x300/548b9ef8736c4f0ea3f96fe078e30cea.png"
trying to save the array
Artwork[cover] inserted into DB "Calling the Earth to Witness" "Darkwater"
"Darkwater" "Where Stories End"
fixing the title string in order to get album title: "Into the Cold"
Going to try and get the art cover for:  "Where Stories End" by "Darkwater" "Into the Cold"
thealbum name is: "Where Stories End"
on setDataCover: "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=ba6f0bd3c887da9101c10a50cf2af133&artist=Darkwater&album=Where Stories End"
the cover art url is "https://lastfm-img2.akamaized.net/i/u/300x300/dcc7e02d5685489e98078b5beaa0d94c.png"
trying to save the array
Artwork[cover] inserted into DB "Where Stories End" "Darkwater"
trying to save the array
Artwork[head] inerted into DB "Darkwater"
duplicated paths in watcher removd:  0
now it i time to put the tracks in the table ;)
ON POPULATE: "SELECT * FROM tracks"
The Query is:  "SELECT * FROM tracks"
found the query
finished populating tables, now ordering them
ON POPULATE ALBUM VIEW:
ON POPULATE HEADS VIEW:
QXcbConnection: XCB error: 3 (BadWindow), sequence: 55321, resource id: 48240557, major code: 4 (DestroyWindow), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 55327, resource id: 48240620, major code: 4 (DestroyWindow), minor code: 0
fish: “code/babe-qt/Babe” terminated by signal SIGSEGV (Address boundary error)
milohr commented 7 years ago

that's weird. i just tried it and it all went okay. does this happens every time you add a new source folder?

diegogangl commented 7 years ago

Yup, just tested again and it still crashes

milohr commented 7 years ago

hmm i double checked and cloned from master, compile and added folders and it all went okay. could you describe what other things or steps are you doing prev adding a folder? thank you very much for taking the time

diegogangl commented 7 years ago

Sorry I forgot to check this. I just pulled and built again, and it's still failing. I tried with a folder with a single mp3 and it still crashed. I'm not doing anything in particular. Babe starts in the mode with the cover+playlist, I expand the UI and go into the preferences to add the folders. Then I just wait a few secs and it dies.

It seems to die on: ON POPULATE HEADS VIEW:

Is there any way I can make a debug build and get a trace or something?

milohr commented 7 years ago

maybe you could comment this lines (588 to 590) in mainWindow that loads the artists view(aka heads view) and see if the problem lays there.?

artistsTable->flushGrid(); artistsTable->populateTableViewHeads(settings_widget->getCollectionDB().getQuery("SELECT * FROM artists ORDER by title asc")); artistsTable->hideAlbumFrame();

milohr commented 7 years ago

btw is that single mp3 file the same than the ones you tried before if so, could you try with some different files? maybe there's some bug i'm not catching with some file's name...

and one more thing: what happens if instead of loading the folder you just drag and drop the files into the ui? does it crash does it play the files?

diegogangl commented 7 years ago

btw is that single mp3 file the same than the ones you tried before if so, could you try with some different files?

Nope, they were always different ones (since they do get added to library).

and one more thing: what happens if instead of loading the folder you just drag and drop the files into the ui? does it crash does it play the files?

Dragging files into the ui works perfectly but doesn't add them to the list of sources.

maybe you could comment this lines (588 to 590) in mainWindow that loads the artists view(aka heads view) and see if the problem lays there.?

Tried, but still crashes. Here's where it dies now:

finished populating tables, now ordering them
ON POPULATE ALBUM VIEW:
milohr commented 7 years ago

@diegogangl argggh idk apparently it writes the songs to the data base then updates the tables(without any artwork) and then fetches the art, when the artwork is ready it tries to reload the tables with the new artwork and that is when the app crashes.... so maybe you could try to remove the line that fetches the artwork in settings.cpp (line: 526 fetchArt();) if the new update in master does not fix your bug.

diegogangl commented 7 years ago

Still crashing :/

ON POPULATE ALBUM VIEW:
creating a new album[cover] for<< "Oceana Derek Sherinian"
ON POPULATE HEADS VIEW:
creating a new album[head] for<< "Derek Sherinian"
fish: “./Babe” terminated by signal SIGSEGV (Address boundary error)

With the fetchArt() line removed it seems to crash faster:

writting to db:  "Shame on the Night"
finished wrrting to database
good to hear it finished yay! now going to fetch artwork
duplicated paths in watcher removd:  0
fish: “./Babe” terminated by signal SIGSEGV (Address boundary error)
milohr commented 7 years ago

that's too weird now to me. because previously it was crashing after fetching art and now it crashes even before that.... and i've tried to reproduce the bug but i can't :( maybe you could try to keep on removing lines from that method and make it look like this:

void settings::finishedAddingTracks(bool state) { if (state) { ui->progressBar->hide(); ui->progressBar->setValue(0); emit collectionDBFinishedAdding(true); } }

btw thanks for helping

diegogangl commented 7 years ago

no prob! I tried that but it didn't change much. I ran this in GDB and this is where it's crashing:

Thread 1 "Babe" received signal SIGSEGV, Segmentation fault.
0x0000000000458a44 in AlbumsView::~AlbumsView() ()
milohr commented 7 years ago

i was manually deleting the object AlbumsView::~AlbumsView(){delete this;}

i've updated the master and removed it:

AlbumsView::~AlbumsView(){}

maybe you could give it another try now

diegogangl commented 7 years ago

It doesn't crash anymore, but it still exits?

creating a new album[head] for<< "Andrew W.K."
[Thread 0x7fffa2bef700 (LWP 3477) exited]
[Thread 0x7fffa1560700 (LWP 3479) exited]
[Thread 0x7fffe7ee9700 (LWP 3464) exited]
[Thread 0x7fffd0e19700 (LWP 3470) exited]
[Thread 0x7fffddadf700 (LWP 3465) exited]
[Thread 0x7fffb1804700 (LWP 3473) exited]
[Thread 0x7fffa3bf1700 (LWP 3475) exited]
[Thread 0x7fffb0de2700 (LWP 3474) exited]
[Thread 0x7fffb3fff700 (LWP 3471) exited]
[Thread 0x7fffd268e700 (LWP 3469) exited]
[Thread 0x7fffd4522700 (LWP 3468) exited]
[Inferior 1 (process 3443) exited normally]
milohr commented 7 years ago

what do you mean by it still exists? are you still using gdb to debug?

diegogangl commented 7 years ago

Both with and without gdb, it seems to exit "normally" after adding a source.

milohr commented 7 years ago

but it still crashes or...?

diegogangl commented 7 years ago

It closes. There are no errors in the terminal or gdb. You add a source and it just exits as if it was meant to do that.

diegogangl commented 7 years ago

Just pulled and tested this today, and the bug is gone. I don't know which commit fixed it tho. I removed all the files in ~/local/share/Babe before testing too (maybe that helped?). Anyways, closing this now. Thanks!