packing-box / docker-packing-box

Docker image gathering packers and tools for making datasets of packed executables and training machine learning models for packing detection
GNU General Public License v3.0
49 stars 10 forks source link

Command line bugging on startup #15

Closed smarbal closed 2 years ago

smarbal commented 2 years ago

When launching the Packing Box, the command line is bugging visually (e.g. character inputs are not shown.). The issue can be solved after pressing Ctrl + C which will yield this output :

^C
[1]+  Done                    sudo Xvfb "${DISPLAY}" -screen 0 "${SCREENSIZE}x16"
dhondta commented 2 years ago

Hi @smarbal ! Good catch. I did not manage to find why it now messed up with STDIN when starting up the box but it seems it comes from the Xframe Virtual Buffer (Xvfb, the virtual X server for managing GUI-based applications from the terminal) when started with sudo, as your finding suggests (Ctrl+C ends the related process and then STDIN does not mess up anymore).

dhondta commented 2 years ago

@smarbal OK, I got it. This issue indeed comes from the fact the Xvfb command is run with sudo, hence allowing to create a temporary folder with owner root. This is aimed to, from what I could find, get file handles open for listening. While running the command without sudo then, we got error "_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root" that shows this fact. From here, I could find a fix by adding some options to not listen and therefore not create this folder that causes the error. I will push my fix now.