[vlc-devel] [PATCH 4/5] stream_ReadLine: support arbitrary length limit

Pierre Ynard linkfanel at yahoo.fr
Mon Sep 7 19:33:20 CEST 2020


> No. From the beginning I pointed out that the memory starvation
> problem came from users storing many lines simultaneously. I can do
> multiplications, thank you very much.

I must have missed it. All I can find is:

> The point is to prevent starving memory with an invalid stream.

But now maybe I get your point better. It still doesn't make sense to
me though. The caller can also keep making sized reads, and storing all
buffers simultaneously without freeing them, yet sized reads don't have
a limit. Lua playlist scripts can either way slurp the whole file, and
even a limit on readline() hardly fetters that. I've even seen one that
does:

> function parse()
>   local s = vlc.read(1e9)

And yes, that makes VLC malloc() 1 GB of memory.

So the limit doesn't really prevent much in that regard. And anyway,
it's not the job of the API to prevent users from shooting themselves
in the foot in obviously dumb ways. Especially not when it causes
limitations on proper users who read, parse, then free lines correctly
one at a time.

> WTF? You literally made up design bugs in the API to divert the
> discussion from the actual issue. And you called my arguments "FUD".
> 
> I DARE YOU TO CALL THAT CONSTRUCTIVE AGAIN. You are just trolling.

I didn't make it up. It's true that stream_ReadLine() doesn't
differentiate between error and EOF. I just didn't know about
stream_Eof(), so that was an honest mistake if anything. And it got that
element of solution brought up, so that was constructive.

As for stream_Peek(), if think you're the one mistaken. But that's
constructive too because it reveals that apparently we're in agreement
on how it should be used.

I'm sorry if you were upset that I called your point about consumers
FUD. I meant that it sounded like vague and unsubstantiated concerns
that something might go wrong. If you don't like being called out
on that though, maybe you should be a bit more specific in your
explanations and take the time to substantiate your arguments better.
That would be constructive. As I said, I still don't see exactly what
is going to go wrong with field consumers if the line length limit is
raised.

> -1 on patches 2-5.

What's wrong with patches 2 and 3?

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the vlc-devel mailing list