Skip to content
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

'read': negative length -1430667650 given (ArgumentError) - caused by id3tag #196

Closed
lao opened this issue Jan 10, 2022 · 0 comments · Fixed by #197
Closed

'read': negative length -1430667650 given (ArgumentError) - caused by id3tag #196

lao opened this issue Jan 10, 2022 · 0 comments · Fixed by #197

Comments

@lao
Copy link
Contributor

lao commented Jan 10, 2022

Hey all,

I am working with a very specific mp3 file trying to get all the metadata from it using format parser gem and I got the following error (StringIO throwing on read):

ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/audio_file.rb:53:in `read': negative length -1430667650 given (ArgumentError)

Unfortunately, I cannot share the file within this issue (as I am not the author) and I simply cannot recreate a file with the breaking scenario.

The problem is originated in the id3tag gem and I got it fixed a few days ago with this: krists/id3tag#31

Proposal

  • update the id3tag gem from version v0.14 to >= v0.14.2

Error traceback when using id3tag version v0.14:

Traceback (most recent call last):
        43: from exe/format_parser_inspect:22:in `<main>'
        42: from exe/format_parser_inspect:22:in `map'
        41: from exe/format_parser_inspect:24:in `block in <main>'
        40: from exe/format_parser_inspect:24:in `public_send'
        39: from /****/format_parser/lib/format_parser.rb:109:in `parse_file_at'
        38: from /****/format_parser/lib/format_parser.rb:109:in `open'
        37: from /****/format_parser/lib/format_parser.rb:110:in `block in parse_file_at'
        36: from /****/format_parser/lib/format_parser.rb:178:in `parse'
        35: from /****/format_parser/lib/format_parser.rb:178:in `to_a'
        34: from /****/format_parser/lib/format_parser.rb:178:in `each'
        33: from /****/format_parser/lib/format_parser.rb:178:in `each'
        32: from /****/format_parser/lib/format_parser.rb:178:in `each'
        31: from /****/format_parser/lib/format_parser.rb:178:in `each'
        30: from /****/format_parser/lib/format_parser.rb:174:in `block in parse'
        29: from /****/format_parser/lib/format_parser.rb:206:in `execute_parser_and_capture_expected_exceptions'
        28: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/measurometer-1.3.0/lib/measurometer.rb:48:in `instrument'
        27: from /****/format_parser/lib/format_parser.rb:207:in `block in execute_parser_and_capture_expected_exceptions'
        26: from /****/format_parser/lib/parsers/mp3_parser.rb:103:in `call'
        25: from /****/format_parser/lib/parsers/mp3_parser.rb:318:in `with_id3tag_local_configs'
        24: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag.rb:52:in `local_configuration'
        23: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/configuration.rb:9:in `local_configuration'
        22: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/configuration.rb:32:in `local_configuration'
        21: from /****/format_parser/lib/parsers/mp3_parser.rb:322:in `block in with_id3tag_local_configs'
        20: from /****/format_parser/lib/parsers/mp3_parser.rb:103:in `block in call'
        19: from /****/format_parser/lib/parsers/mp3_parser.rb:302:in `blend_id3_tags_into_hash'
        18: from /****/format_parser/lib/parsers/mp3_parser.rb:302:in `each_with_object'
        17: from /****/format_parser/lib/parsers/mp3_parser.rb:302:in `each'
        16: from /****/format_parser/lib/parsers/mp3_parser.rb:303:in `block in blend_id3_tags_into_hash'
        15: from /****/format_parser/lib/parsers/mp3_parser.rb:50:in `to_h'
        14: from /****/format_parser/lib/parsers/mp3_parser.rb:50:in `each_with_object'
        13: from /****/format_parser/lib/parsers/mp3_parser.rb:50:in `each'
        12: from /****/format_parser/lib/parsers/mp3_parser.rb:52:in `block in to_h'
        11: from /****/format_parser/lib/parsers/mp3_parser.rb:52:in `public_send'
        10: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:19:in `block (2 levels) in <class:Tag>'
         9: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:24:in `content_of_first_frame'
         8: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:40:in `first_frame_by_id'
         7: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:40:in `find'
         6: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:40:in `each'
         5: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:40:in `block in first_frame_by_id'
         4: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:64:in `frame_ids'
         3: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:68:in `frames'
         2: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/tag.rb:73:in `v2_frames'
         1: from /*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/audio_file.rb:59:in `v2_tag_body'
/*/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/id3tag-0.14.1/lib/id3tag/audio_file.rb:59:in `read': negative length -1430667650 given (ArgumentError)

Results when using id3tag version v0.14.2

mp3-id3tag-update-formatparser

@lao lao closed this as completed Jan 10, 2022
@lao lao reopened this Jan 10, 2022
@lao lao closed this as completed in #197 Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant