You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warning: ftp_nb_fget(): Closing data Connection. in /home/niels/php-src/memleak.php on line 11
[Fri Feb 10 21:53:49 2023] Script: '/home/niels/php-src/memleak.php'
/home/niels/php-src/ext/ftp/ftp.c(1631) : Freeing 0x00007f3176889000 (4108 bytes), script=/home/niels/php-src/memleak.php
=== Total 1 memory leaks detected ===
But I expected this output instead:
Warning: ftp_nb_fget(): Closing data Connection. in /home/niels/php-src/memleak.php on line 11
Seems like the ftp->data pointer gets overwritten before the previous action is done(? not sure, I haven't looked into detail). In any case the pointer is overwritten and the old one isn't freed.
Discovered while developing PR #10525.
There's actually a couple of places where ftp->data could get overwritten I think. Maybe we shouldn't allow doing two non-blocking actions at the same time?
PHP Version
PHP >=8.1
Operating System
Linux
The text was updated successfully, but these errors were encountered:
…b_fget
When the user does not fully consume the data stream, but instead opens
a new one, a memory leak occurs. Moreover, the state is invalid: when
more commands arrive they'll be handled out-of-sync because the state of
the client does not match what the server is doing.
This leads to all sorts of weirdness, for example:
Warning: ftp_nb_fget(): OK.
Fix it by gracefully closing the old data stream when a new data stream
is started.
Description
The following code:
Resulted in this output:
But I expected this output instead:
Seems like the
ftp->data
pointer gets overwritten before the previous action is done(? not sure, I haven't looked into detail). In any case the pointer is overwritten and the old one isn't freed.Discovered while developing PR #10525.
There's actually a couple of places where
ftp->data
could get overwritten I think. Maybe we shouldn't allow doing two non-blocking actions at the same time?PHP Version
PHP >=8.1
Operating System
Linux
The text was updated successfully, but these errors were encountered: