-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault with loudgain #23
Comments
I'd like to add that FLAC & MP3 files work just fine for me. I noticed this issue with |
Phew. Good question (and I’m happy to see someone uses it on a Windows machine!). Thanks for the build log, it looks okay You are saying it only happens with If you do a In the past we found that updating FFMpeg also helped in some cases (loudgain uses part of the FFMpeg libraries). |
I just noticed the m4a segfault on Debian 11, which offers Loudgain version "0.6.8+ds-1+b1" as a package.
These are downloaded files, I'll see if I can encode a random m4a file that reproduces the problem and upload it somewhere. |
@TylerVigario @deutrino The reason is because the current code stores a reference to a local object from the taglib function This same issue also affects WMA/ASF. To fix the bug, simply convert the reference to a local object. This effectively copies the object to the caller and prevents the issues seen above. See the below patch: diff --git a/src/tag.cc b/src/tag.cc
index 1c149f3..bd39aeb 100644
--- a/src/tag.cc
+++ b/src/tag.cc
@@ -512,7 +512,7 @@ void tag_remove_mp4(TagLib::MP4::Tag *tag) {
for(TagLib::MP4::ItemMap::Iterator item = items.begin();
item != items.end(); ++item)
#else
- TagLib::MP4::ItemListMap &items = tag->itemListMap();
+ TagLib::MP4::ItemListMap items = tag->itemListMap();
for(TagLib::MP4::ItemListMap::Iterator item = items.begin();
item != items.end(); ++item)
@@ -591,7 +591,7 @@ bool tag_clear_mp4(scan_result *scan) {
void tag_remove_asf(TagLib::ASF::Tag *tag) {
TagLib::String desc;
- TagLib::ASF::AttributeListMap &items = tag->attributeListMap();
+ TagLib::ASF::AttributeListMap items = tag->attributeListMap();
for(TagLib::ASF::AttributeListMap::Iterator item = items.begin();
item != items.end(); ++item)
@hughmcmaster I recommend applying the above patch to your Debian package to help @deutrino and others with this issue. This is a somewhat critical bug since it completely breaks M4A support with taglib <1.12 (current Stable) and WMA support for all versions. loudgain seems to have been abandoned, so it's unlikely this will be fixed upstream anytime soon, if ever. |
@complexlogic's patch works for me |
Can this problem be fixed? Here's a sample tape that fails with segmentation fault. I'm also running under WSL2 Ubuntu. |
You're brilliant for finding this. Would you consider forking and maintaining this code if it's really been abandoned? |
I see your rsgain tool. Will check that out. Thanks. |
First of all, really pleased I found this, looks like some great work.
Unfortunately, I'm not sure I have enough information to help the report.
I'm running Windows, but with WSL running Ubuntu 18.04.3.
Followed the instructions, very clear and familiar. No problems.
But running
loudgain
in any way on a file segfaults:$ loudgain song.mp3 [✔] Scanning 'song.mp3' ... [✔] Container: MP2/3 (MPEG audio layer 2/3) [mp3] Segmentation fault (core dumped)
It's the same with any filetype:
If running through
rgbpm
, it returns:For verbosity's sake, I'm including the build output:
Is there any way I can debug this?
The text was updated successfully, but these errors were encountered: