[pgpool-hackers: 2798] Re: Garbage output

Tatsuo Ishii ishii at sraoss.co.jp
Fri May 11 10:45:38 JST 2018


Usama,

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[1], "\0", 1);

If I change this to:

	write(pipe_fds[1], "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?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

> Usama,
> 
> Since your commit:
> https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=a1ff51eea5a4e58e387ce3888a89bf056ea9f3c3
> 
> 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
> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers


More information about the pgpool-hackers mailing list