pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rick Otten <rotten@windfish.net>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14287: psql_history gets wiped out
Date: Fri, 12 Aug 2016 10:17:04 -0400
Message-ID: <fcab184f7c55b63146f3653ccfbe5f0c@www.windfish.net> (raw)
In-Reply-To: <24679.1470950130@sss.pgh.pa.us>
References: <20160811183456.GA656368@alvherre.pgsql>
	<15159.1470941747@sss.pgh.pa.us>
	<ab5dca6c005692f7bbf5820173b32101@www.windfish.net>
	<24679.1470950130@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

 

Here is what the last few lines of the strace look like during a normal
exit: 

rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(1, "\qn", 3) = 3
sendto(3,
"273335220x377`200210Z255251374X335206207r21212230271206246250v4375333n"...,
34, MSG_NOSIGNAL, NULL, 0) = 34
sendto(3, "253332220x377`200210Z256361U271I
330322J26732X?352u20026725210", 31, MSG_NOSIGNAL, NULL, 0) = 31
close(3) = 0
rt_sigaction(SIGPIPE, {SIG_DFL, [], SA_RESTORER|SA_RESTART,
0x7f263ea4ccb0}, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f263ea4ccb0},
8) = 0
open("/postgresql/.psql_history", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fchmod(3, 0600) = 0
fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x7f263f9e4000
open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) =
4
fstat(4, {st_mode=S_IFREG|0644, st_size=26258, ...}) = 0
mmap(NULL, 26258, PROT_READ, MAP_SHARED, 4, 0) = 0x7f263f9dd000
close(4) = 0
futex(0x7f263edd5a70, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(3, "_HiStOrY_V2_nselect\040*\040from"..., 663) = 663
close(3) = 0
munmap(0x7f263f9e4000, 4096) = 0
exit_group(0) = ?
+++ exited with 0 +++ 

And here is what the last few lines of the strace look like when I close
the (ssh terminal) window: 

read(0, 0x7ffd1140ff30, 1) = -1 EIO (Input/output error)
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS,
0x7ffd1140ff00) = -1 EIO (Input/output error)
ioctl(0, SNDCTL_TMR_STOP or SNDRV_TIMER_IOCTL_GINFO or TCSETSW, {B38400
opost isig icanon echo ...}) = -1 EIO (Input/output error)
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM CONT TSTP WINCH], [], 8) =
0
rt_sigaction(SIGINT, {0x7fb2dbc68920, [], SA_RESTORER|SA_RESTART,
0x7fb2daf38cb0}, NULL, 8) = 0
rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x7fb2daf38cb0}, NULL,
8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x7fb2daf38cb0}, NULL,
8) = 0
rt_sigaction(SIGHUP, {SIG_DFL, [], SA_RESTORER, 0x7fb2daf38cb0}, NULL,
8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, [], SA_RESTORER, 0x7fb2daf38cb0}, NULL,
8) = 0
rt_sigaction(SIGCONT, {SIG_DFL, [], SA_RESTORER, 0x7fb2daf38cb0}, NULL,
8) = 0
rt_sigaction(SIGWINCH, {SIG_DFL, [], SA_RESTORER, 0x7fb2daf38cb0}, NULL,
8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(1, "\qn", 3) = -1 EIO (Input/output error)
sendto(3, "273335Z35364t26322026031627225f216314250234
357~niQ254S&255gl"..., 34, MSG_NOSIGNAL, NULL, 0) = 34
--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=95075, si_uid=5432}
---
+++ killed by SIGHUP +++ 

I can send the full strace outputs if someone really wants them. 

On 2016-08-11 17:15, Tom Lane wrote: 

> Rick Otten <rotten@windfish.net> writes:
> 
>> I'm using the repo: deb http://apt.postgresql.org/pub/repos/apt/ [1] trusty-pgdg main 9.5 That repo version is using _libedit_, not _libreadline_:
> 
> Hmm. Our general experience is that libedit is buggier than libreadline,
> but I've not heard of this particular symptom before. It might be
> entertaining to see if you can strace psql while it's doing this.
> Something like
> 
> strace -o some.file psql ... usual parameters ...
> ... issue a command or two just to be sure there's history to write
> ... close window
> 
> and then look at the last few dozen lines of some.file.
> 
> regards, tom lane

 

Links:
------
[1] http://apt.postgresql.org/pub/repos/apt/

view thread (13+ messages)  latest in thread

Message-ID: <fcab184f7c55b63146f3653ccfbe5f0c@www.windfish.net>
Permalink:  ../fcab184f7c55b63146f3653ccfbe5f0c@www.windfish.net/
Also on:    postgresql.org/message-id/fcab184f7c55b63146f3653ccfbe5f0c@www.windfish.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rotten@windfish.net
  Subject: Re: BUG #14287: psql_history gets wiped out
  In-Reply-To: <fcab184f7c55b63146f3653ccfbe5f0c@www.windfish.net>
  References: <20160811183456.GA656368@alvherre.pgsql> <15159.1470941747@sss.pgh.pa.us> <ab5dca6c005692f7bbf5820173b32101@www.windfish.net> <24679.1470950130@sss.pgh.pa.us> <fcab184f7c55b63146f3653ccfbe5f0c@www.windfish.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox