Instrumenting vsftpd cannot allocate memory by calling mmap.
Created by: anamhz
I am instrumenting vsftpd with the inscount tool however this problem happens with all the tools as far as I tested.
When I run vsftpd standalone with drrun it lauches the server fine. From the ftp client I can succesfully use "ftp localhost" command. In FTP client, after entering the username I get error from the client side '500 OOPS: mmap' and login failed and remote server has closed the connection. The server however still is running fine and again I can try to connect it till the same point.
I found the mmap line in the source code that fails. It is at line 988 (vsftpd 3.0.3) in sysdeputil.c file. I checked the arguments during runtime with printing them and they seem ok to me. The length is also 12288 which is not very big. I checked the memory during the runtime and about 13GB of memory out of 16GB is free. I checked the error of mmap call and stderror says it is 'cannot allocate memory' error. Of course, vsftpd runs fine without using drrun.
I am using Ubuntu 18.04 with cpu corei7 and 16GB RAM.
The vsftpd version I think does not matter however I tested with 3.0.3, 3.0.2, and 3.0.0. I suggest you to use the latest to repeat the issue as for the other two I made a change in the configuration to make them work.