[pgpool-hackers: 2798] Re: Garbage output
ishii at sraoss.co.jp
Fri May 11 10:45:38 JST 2018
I have studied this issue a little bit by using:
strace -t -f -ewrite -o /tmp/strace.log ./regress.sh 004
It showed interesting log at the time when "^@" appeared:
27415 10:10:12 write(0, "\0", 1 <unfinished ...>
where 27415 is the process id of pgpool main process. Since I cannot
use newer version of strace on this platform (Ubuntu 16) which allows
to use "strace -k", which shows stack trace. Fortunately I was able to
identify where above write comes from. In main/pgpool_main.c there's a
signal handler sigusr1_handler(int sig). The write came from here:
write(pipe_fds, "\0", 1);
If I change this to:
write(pipe_fds, "P", 1);
then I got "testing 004.watchdog...Pok."
instead of "testing 004.watchdog...^@ok."
Because terminal emulators ignore \0, other than emacs user does not
notice it. In fact I was able to observe "Pok." on terminal emulators.
Do you have any idea how to deal with this?
SRA OSS, Inc. Japan
> Since your commit:
> The regression test for 004.watchdog produces garbage output something
> like this:
> testing 004.watchdog...^@ok.
> Actually "^@" is 0x00 (NULL). Probably because I use emacs shell, I
> noticed it. You do not see it on an ordinary terminal. I guess
> watchdog produces NULL in the log (stderr or stdout) somewhere.
> Can you please fix it?
> Best regards,
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
More information about the pgpool-hackers