artemanufrij / playmymusic

An elementary OS app
http://anufrij.org/melody
96 stars 26 forks source link

Crash when loading music library #14

Closed Djcoper closed 6 years ago

Djcoper commented 6 years ago

Music Player only loads about 25% of files in music folder before crashing, I'm trying to find the file it crashes on.

Launching Music Player from terminal gives this output : [WARNING 02:28:48.441253] TagManager.vala:61: DISCOVER ERROR: No valid frames decoded before end of stream GST_DISCOVERER_ERROR (file:// "path to file" .mp3).

artemanufrij commented 6 years ago

Crashes Music Player every time?

PS: [WARNING 02:28:48.441253 is just a warning if ID3-Tags couldn't be read. It's not a reason for a crash....

jtrees commented 6 years ago

I also get a consistent crash on 3a8dae0c3dab3f2883f938b649ecf232298bf94f and am unable to start the app at all:

[1]    3379 segmentation fault (core dumped)  src/com.github.artemanufrij.playmymusic

It was also triggered during the initial library import. Perhaps there is a specific file in my collection that is causing it to crash?

Please let me know what I can provide to help you debug the issue.

artemanufrij commented 6 years ago

@jtrees, @Djcoper are you on daily or stable?

jtrees commented 6 years ago

I am on elementary OS stable, if that's what you mean.

artemanufrij commented 6 years ago

@jtrees have you only mp3 files? if not which types are you using?

artemanufrij commented 6 years ago

I found out what the rease was... I hope I can push a fix in few hours.

artemanufrij commented 6 years ago

@Djcoper, @jtrees could you test current master branch, please?

Djcoper commented 6 years ago

It's NOT crashing on current master branch, loaded everything perfectly.

P.S: I was sure a warning wouldn't cause crash but maybe terminal output would be useful.

artemanufrij commented 6 years ago

@Djcoper thank you very much for your support

jtrees commented 6 years ago

You are quite the ninja. It no longer crashes consistently with b1f1f2cec6451ec824dafe17f801619572d019a4 but I did get several crashes (about five) before the entire library import completed.

Here is the terminal output for one such instance. I hope it is helpful:

https://0bin.net/paste/kDqIjv1fWGufCx-o#O6epgHbEBmUpcxdMUjeZ-Newuqv/dRCvn1faH82PrCD

artemanufrij commented 6 years ago

@jtrees thanks for your feedback... I'm going to check it!

artemanufrij commented 6 years ago

unfortunately I can't reproduce it. But I implemented small fixes and I hoppe that it was the reason.

@jtrees could you test it please?

jtrees commented 6 years ago

Sure. I should probably clear the library database for that though, since now I have it all imported. Where are the files stored?

EDIT: Just noticed I can simply choose "Rescan Library" from the menu. Testing now...

jtrees commented 6 years ago

Unfortunately the issue still persists. I noticed a crash just as it was importing from an album with some PDFs in the same folder. Perhaps this has something to do with it?

Also, just for reference: My library consists mostly of flac and mp3 files with some ogg, m4a and potentially wav mixed in.

artemanufrij commented 6 years ago

I check if mime type is an audio file mime_type.contains ("audio/")

Djcoper commented 6 years ago

@artemanufrij after clearing all " music Player " data and rescanning the whole library the crashing has returned. :/ P.S: My library is stored a separate NTFS partition and all files referenced in terminal Warnings are small in file size, 5kb to 30kb max. terminal output : https://0bin.net/paste/VQYGYVXHBvqeJzJY#dHymbt+3DYkHPj8h76CiqZp8MyRQXdJdtAQN+PRHynZ

Djcoper commented 6 years ago

Also files referenced in terminal Warnings do not play in "Music Player" but the files are not corrupted as they play in noise and other media players.

artemanufrij commented 6 years ago

@Djcoper could you post one of your files please? I have to test it on my system....

Djcoper commented 6 years ago

These are the last lines of terminal output before crash.

(com.github.artemanufrij.playmymusic:6370): WARNING : DataBaseManager.vala:293: Error: 101: unknown error Track ID: 7 Segmentation fault (core dumped)

Djcoper commented 6 years ago

Clone this "https://github.com/Djcoper/Djcoper.github.io.git" then try to import ./staffgame/game_assets.

artemanufrij commented 6 years ago

these files can't be played also in noise...

bildschirmfoto von 2017-10-07 23 55 34

artemanufrij commented 6 years ago

@Djcoper could you test current master branch please?

Djcoper commented 6 years ago

hmm I was sure they played in noise earlier, in ether case these seem to be the files that caused the crashing for me.

It seems like noise has some mechanisms for detecting corrupted files then refusing to load them into its database.

screenshot from 2017-10-07 23 24 31

artemanufrij commented 6 years ago

Yes, both are based on Gst

artemanufrij commented 6 years ago

Hey guys @Djcoper @jtrees , could you test current branch please?

Djcoper commented 6 years ago

@artemanufrij Wow, just wow, I've thoroughly tested the program by clearing and reloading my library multiple times without a single crash! The program is now ignoring damaged files instead of crashing with Segmentation fault. I've also executed the program in the GNU debugger and all seems bug free on my end "claps"

Djcoper commented 6 years ago

I do wish "Play My Music" notified the user of which damaged files it was ignoring and maybe even offered to move the damaged files to trash like noise does, but that would be feature request because as of now the program is working as it should.

artemanufrij commented 6 years ago

@Djcoper Thank you very much for your feedback! I think we should open a separate issue for "ignoring files"

jtrees commented 6 years ago

Thanks for the new version. However, I am unable to start the app in order to test it. It currently (2f1cafaa2b17baa0fa55cba3825de5e222507e2c) crashes with this error:

(com.github.artemanufrij.playmymusic:21793): GLib-GIO-ERROR **: Settings schema 'com.github.artemanufrij.playmymusic' does not contain a key named 'play-in-background'
artemanufrij commented 6 years ago

@jtrees as first install it please. I changed gschema.xml file

sudo make install

jtrees commented 6 years ago

Ah, that was the problem. Unfortunately the fix doesn't work for me. I still get segmentation faults on importing. Is there any way I can figure out what the problematic files are?

artemanufrij commented 6 years ago

@jtrees It's not a music file issue... it's a problem with multi threading.

jtrees commented 6 years ago

Oooh, that's a tough one. Thanks for your efforts so far and good luck fixing the issue!

Djcoper commented 6 years ago

@jtrees Perhaps you can use process of elimination, Maybe you can partially load some bits of your library to determine when the Segmentation fault occurs for you.

artemanufrij commented 6 years ago

hey @jtrees, could you test it again please? I could improve some multithreading issues. I hope it fixed the crash you have.

thanks!

jtrees commented 6 years ago

Hell yeah! It works now (387687c90e5adea27a0e4ee2908d3e4f4c6ce186)! Now I can finally give try out this app. :)

Thanks for your persistence on this one.

artemanufrij commented 6 years ago

@Djcoper @jtrees Thank you very much guys!

I shipped already new release. It's waiting for human testing.