libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Crash in copy_string

Open lunatichai opened this issue 11 months ago • 6 comments

Windows 11 x64 libtorrent 2.0.10 msvc2019

Crashed in copy_string() because m_storage size too much.

Image

Image

Image

lunatichai avatar Jan 28 '25 18:01 lunatichai

What's the size of the vector? Do you restrict the alert queue size? Do you pop alerts regularly?

arvidn avatar Jan 30 '25 07:01 arvidn

On a first screenshow you can see size 2147483637 Yes lt::settings_pack::alert_queue_size, std::numeric_limits::max() / 2 Yes

lunatichai avatar Feb 01 '25 09:02 lunatichai

numeric_limits is a template. Is that a limit of 2 billions or 4 quintillions?

Either way, it's probably going to make you run out of memory

arvidn avatar Feb 01 '25 10:02 arvidn

limit is int (i paste std::numeric_limits< int >::max() but in comment showed only std::numeric_limits::max()) memory 16gb

lunatichai avatar Feb 01 '25 12:02 lunatichai

1 billion alerts will make you run out of memory unless you pop them at a higher rate than they're produced. I imagine you're not doing that.

arvidn avatar Feb 01 '25 13:02 arvidn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 19 '25 05:07 stale[bot]