OxygenCobalt / Auxio

A simple, rational music player for android
GNU General Public License v3.0
1.82k stars 120 forks source link

Crash on music loading due to intelligent sort name creation #414

Closed bugtrapper closed 1 year ago

bugtrapper commented 1 year ago

Describe the Bug/Crash

When opening Auxio 3.0.4, it automatically scans the music library. When this is completed, the app crashes before moving over to the library view. It happens to me both a fresh reinstall (after giving permission to read the music folders) as well as after upgrading from 3.0.3.

3.0.3 works fine.

Describe the intended behavior

The App shouldn't crash.

What android version do you use?

Android 13

What device model do you use?

Xiaomi Mi 8 "dipper" (LineageOS 20.0 / Android 13)

Bug report

logcat.txt

Duplicates

smallbillgates commented 1 year ago

I also have this. Pixel 4A5G with calyxOS.

OxygenCobalt commented 1 year ago

Likely bug with the new sort name system's string processing. Can you try disabling "Content -> Intelligent Sort Names" on a fresh install before granting permission? I'd also like a sample file, since this is an edge-case I have not encountered with my library. @smallbillgates @bugtrapper

This should be a trivial fix once I can identify it, but I probably won't be able to make a release for it until a month or so from now.

bugtrapper commented 1 year ago

You're right, disabling the option prevents the crash on my device with this version. Thank you!

What kind of sample file would you like? A single music file which reliably crashes the app?

07.04.2023 16:37:13

Likely bug with the new sort name system's string processing. Can you try disabling "Content -> Intelligent Sort Names" on a fresh install before granting permission? I'd also like a sample file, since this is an edge-case I have not encountered with my library. @smallbillgates[https://github.com/smallbillgates] @bugtrapper[https://github.com/bugtrapper]

OxygenCobalt commented 1 year ago

Wait, I just realized that you can't provide a sample file since you don't know what file is causing the issue :facepalm:. Could you try a debug APK from here and then record the crash again? I need a specific line to debug, which isn't available in the release builds @bugtrapper.

anonymous5555522222 commented 1 year ago

Same here, when I updated to 3.0.4 from F-Droid. My Android's version is 10.

OxygenCobalt commented 1 year ago

Uuugh. Every time I make a minor version to fix one major issue another one pops up. I really need to start unit testing.

anonymous5555522222 commented 1 year ago

Likely bug with the new sort name system's string processing. Can you try disabling "Content -> Intelligent Sort Names" on a fresh install before granting permission? I'd also like a sample file, since this is an edge-case I have not encountered with my library. @smallbillgates @bugtrapper

This should be a trivial fix once I can identify it, but I probably won't be able to make a release for it until a month or so from now.

Thank you! A reinstall wasn't even needed, I just had to remove the storage permission and disable that option, this way all my tuning on the app won't vanish. I will turn it back on when this gets fixed.

anonymous5555522222 commented 1 year ago

Wait, I just realized that you can't provide a sample file since you don't know what file is causing the issue 🤦. Could you try a debug APK from here and then record the crash again? I need a specific line to debug, which isn't available in the release builds @bugtrapper.

By the way, this page is giving me a 404 error.

OxygenCobalt commented 1 year ago

Huh. Okay. Here's the APK directly then @anonymous5555522222 @bugtrapper. Just take another bug report of the crash like prior. Nothing else you need to change.

Auxio_Canary.zip

anonymous5555522222 commented 1 year ago

Huh. Okay. Here's the APK directly then @anonymous5555522222 @bugtrapper. Just take another bug report of the crash like prior. Nothing else you need to change.

Auxio_Canary.zip

This build is not crashing for me, it gets stuck in "Loading your music library" instead...

OxygenCobalt commented 1 year ago

Probably the half-finished playlist implementation being busted again @anonymous5555522222. Try this one:

Auxio_Canary.zip

bugtrapper commented 1 year ago

Huh. Okay. Here's the APK directly then @anonymous5555522222 @bugtrapper. Just take another bug report of the crash like prior. Nothing else you need to change.

Auxio_Canary.zip

Thank you. I have the same issue as anonymous5555522222 with the app being stuck in "Loading your music library". Here's the logcat of it anyway: logcat 11179835.txt

Probably the half-finished playlist implementation being busted again @anonymous5555522222. Try this one:

Auxio_Canary.zip

This one properly crashes! :) Here's the logcat for that version: logcat 11180301.txt

OxygenCobalt commented 1 year ago

Okay, I know the issue now. When Auxio attempts to dynamically handle the sorting names, some cases lead to an empty string. There could be a two cases here:

  1. Titles that are just The, An, etc.
  2. Titles that are entirely digits, but not parsable as a number for some reason. Like, 3000000000

This would result in an empty left-over string that would then later have the first character grabbed for the fast scroller. This ends up crashing since the string is empty. As for why it seemingly entirely kills the app process, it's probably parallelized music loading ruining my life again. Unexpected exceptions suck in this regard.

I will try to fix this as soon as I can. I am so terribly busy right now.

bugtrapper commented 1 year ago

I'm glad the logs seemed to be helpful. Thanks again for the quick support and the workaround! 👍 Feel free to highlight me with any additional test versions if I can be of any help.

nicoboss66 commented 1 year ago

hi, i’m having the same issue since 3.0.4 installation from F-Droid on a S9 with /e/os 3.0.3 works fine crashes even with intelligent sort name creation disabled though

OxygenCobalt commented 1 year ago

Can you provide a bug report @nicoboss66?

nicoboss66 commented 1 year ago

Can you provide a bug report @nicoboss66?

thanks ! I installed and run the second Auxio Canary you provided (that crashes exactlty at the same point as Auxio3.0.4), but unfortunately i can’t figure out how to get/find the logcat.txt

OxygenCobalt commented 1 year ago

Just share the bug report file @nicoboss66.

nicoboss66 commented 1 year ago

sorry, but i m only able to get a 42Mo zip file that does not contain any logcat.txt file I m certainly not doing things right as i never did it before though

OxygenCobalt commented 1 year ago

In the zip, you will see a file called something like bugreport-[name]-[random numbers/letters]-[date].txt. Upload that @nicoboss66.

nicoboss66 commented 1 year ago

Hello, it is always a file of more than 20 Mb And since this file most likely contains sensitive data from my device, how can I reduce it to what would be useful to you and/or send it to you privately?

OxygenCobalt commented 1 year ago

Just take the portion between ------ SYSTEM LOG ------ and ----- EVENT LOG ------ @nicoboss66.

nicoboss66 commented 1 year ago

bugreport-starltexx-QQ3A.200805.001-2023-04-11-09-49-43.txt here it is hope it helps and thank you for the hints to get it

OxygenCobalt commented 1 year ago

It's the same issue as the one provided earlier @nicoboss66.

OxygenCobalt commented 1 year ago

Dev branch should have a fix for this now. Here is a debug APK:

Auxio_Canary.zip

OxygenCobalt commented 1 year ago

Care to test the APK @bugtrapper @nicoboss66 @anonymous5555522222?

bugtrapper commented 1 year ago

I can confirm that the issue is fixed for my device in the debug build. The app no longer crashes when scanning the music library with "Content -> Intelligent Sort Names" enabled.

Awesome!

Xiaomi Mi 8 "dipper" (LineageOS 20.0 / Android 13)

nicoboss66 commented 1 year ago

Works like a charm here too, thanks ! Samsung S9 (/e/os 1.9 / Android 10)

OxygenCobalt commented 1 year ago

Okay, I am going to make a release ASAP.

OxygenCobalt commented 1 year ago

This should be available in 3.0.5 now, thanks to @chrispalmeri's PR when I had basically no time to pull a fix for this.

anonymous5555522222 commented 1 year ago

Care to test the APK @bugtrapper @nicoboss66 @anonymous5555522222?

Sorry for my inactivity. I have just tested it and it does not crash.