We have a strange problem in Solaris 11.4.
The problem arise when a code as the following is run from Perl
my $emptystring = ""; syswrite STDOUT, $emptystring;
The execution of a syswrite call with an empty variable provoques that the OpenSSH session is killed :-(
The problem is new for us, and it's arise after the migration from Solaris 11.3 to Solaris 11.4 and with OpenSSH 8.1 (with previous 7.9 version the problem is not there)
This error occurs only if the output is the standard output. If the output of the script is redirected to a file everything works ok
If the script is traced with
truss the error occurs in a
write call like this one:
23886: write(1, 0x004B6450, 0) = 0
The write call shown is for when everything is ok, when the error arises the session is killed and the truss output is stopped et this line and everything after is not shown.
More info: We have tested binaries compiled for Solaris 11.3 and they work!. So apparently the problem comes from our compilation, but we don't know yet why .... On continue ...
More info: There is no remarkable difference between la compilation. The logs of the server OpenSSH show that the empty value is taken as an EOF, as we can see in the following image, that show the difference between a OpenSSH with this bug and another one which behaves correctly.
The lines showing it are the following:
debug2: channel 0: read<=0 rfd 16 len 0 debug2: channel 0: read failed debug2: channel 0: chan_shutdown_read (i0 o0 sock -1 wfd 16 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug3: send packet: type 96 debug2: channel 0: input drain -> closed