Skip to content

Memory leak & Potential Infinite loop when reading bad mp3 metadata #379

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

Open
hasezoey opened this issue May 3, 2025 · 1 comment
Open

Comments

@hasezoey
Copy link

hasezoey commented May 3, 2025

A user in termusic had reported a file which does not play and causes a massive memory leak.
After some investigation via heaptrack, the cause seems to be symphonia.

The method that causes massive Vec allocations (see screenshot for more):

527.7MB (98.8%) contribution to peak consumption in symphonia_metadata::id3v2::frames::read_text_frame::h64ac129897fc45b7 in termusic-server and below.

Screenshot as i cannot seem to copy a trace:

Image

Note that lofty fails to read the metadata of the file with:

Text decoding: UTF-16 string has an odd length

This can be reproduced with symphonia-play too.

symphonia (& symphonia-metadata) 0.5.4 & current master (ef9bbd8)
rustc 1.86.0

It does not happen in current dev-0.6 branch (c7efbcb)

@hasezoey
Copy link
Author

hasezoey commented May 3, 2025

I did a quick git bisect git bisect start --term-new=fixed --term-old=unfixed and this is the first good commit in dev-0.6:

31f3ffa586f5262d79ee8d6d7c6a34346a03bee5 is the first fixed commit
commit 31f3ffa586f5262d79ee8d6d7c6a34346a03bee5 (HEAD)
Author: Serghei Scobici <[email protected]>
Date:   Sat Jan 18 22:27:05 2025 +0200

    core (io): Advance reader's position if scan pattern is not found (#344).

 symphonia-core/src/io/buf_reader.rs | 13 +++++++------

(link 31f3ffa)

Could i maybe ask this fix to be backported to 0.5.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant