dbTalk Databases Forums  

8.0B2 psql \e

comp.databases.postgresql.bugs comp.databases.postgresql.bugs


Discuss 8.0B2 psql \e in the comp.databases.postgresql.bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
elein
 
Posts: n/a

Default 8.0B2 psql \e - 09-13-2004 , 02:47 PM






Has anyone else experienced a segfault in psql on 8.0B2
when using \e? I can reproduce this consistently.

If not I'll trace it down if I can, but if it is a known
problem, I won't bother.

--elein
================================================== ==========
elein (AT) varlena (DOT) com Varlena, LLC www.varlena.com

PostgreSQL Consulting, Support & Training

PostgreSQL General Bits http://www.varlena.com/GeneralBits/
================================================== ===========
I have always depended on the [QA] of strangers.


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #2  
Old   
Alvaro Herrera
 
Posts: n/a

Default Re: 8.0B2 psql \e - 09-13-2004 , 03:05 PM






On Mon, Sep 13, 2004 at 12:47:54PM -0700, elein wrote:
Quote:
Has anyone else experienced a segfault in psql on 8.0B2
when using \e? I can reproduce this consistently.
I do it all the time and I haven't seen it ... is your query too long or
something? Care to show psql's backtrace?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Syntax error: function hell() needs an argument.
Please choose what hell you want to involve.


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
  #3  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: 8.0B2 psql \e - 09-13-2004 , 03:20 PM



On Mon, Sep 13, 2004 at 12:47:54PM -0700, elein wrote:
Quote:
Has anyone else experienced a segfault in psql on 8.0B2
when using \e? I can reproduce this consistently.

If not I'll trace it down if I can, but if it is a known
problem, I won't bother.
I'm using the latest CVS sources on Solaris 9 and can't reproduce
this problem. The segfault was identified in 8.0.0beta1 a month
ago but I thought it was fixed.

http://archives.postgresql.org/pgsql...8/msg00103.php

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)



Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: 8.0B2 psql \e - 09-13-2004 , 03:28 PM



elein <elein (AT) varlena (DOT) com> writes:
Quote:
Has anyone else experienced a segfault in psql on 8.0B2
when using \e? I can reproduce this consistently.
Hmm, we fixed a bug in \e not long ago, but it was pre-beta2 ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #5  
Old   
elein
 
Posts: n/a

Default Re: 8.0B2 psql \e - 09-13-2004 , 03:31 PM



This looks like the same bug as Michael's
http://archives.postgresql.org/pgsql...8/msg00103.php

trim_directory needs to check for a NULL pointer in path.

if ( path == NULL || path[0] == '\0' )

I'll verify I have the version I think I have...

(gdb) bt
#0 0x0805dd15 in trim_trailing_separator (path=0x0) at path.c:442
#1 0x0805d6b2 in canonicalize_path (path=0x0) at path.c:123
#2 0x0804af80 in exec_command (cmd=0x808f958 "e", scan_state=0x808ba30, query_buf=0x808bb80)
at command.c:378
#3 0x0804a964 in HandleSlashCmds (scan_state=0x808ba30, query_buf=0x808bb80) at command.c:86
#4 0x0804fd31 in MainLoop (source=0x40217a60) at mainloop.c:257
#5 0x080517b2 in main (argc=2, argv=0xbffff1f4) at startup.c:310
#6 0x401177ee in __libc_start_main () from /lib/libc.so.6

419 static void
420 trim_directory(char *path)
421 {
422 char *p;
423
424 if (path[0] == '\0')
425 return;
426
427 for (p = path + strlen(path) - 1; IS_DIR_SEP(*p) && p > path; p--)
428 ;
429 for (; !IS_DIR_SEP(*p) && p > path; p--)
430 ;
431 *p = '\0';
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) print path[0]
Cannot access memory at address 0x0


On Mon, Sep 13, 2004 at 02:20:14PM -0600, Michael Fuhr wrote:
Quote:
On Mon, Sep 13, 2004 at 12:47:54PM -0700, elein wrote:
Has anyone else experienced a segfault in psql on 8.0B2
when using \e? I can reproduce this consistently.

If not I'll trace it down if I can, but if it is a known
problem, I won't bother.

I'm using the latest CVS sources on Solaris 9 and can't reproduce
this problem. The segfault was identified in 8.0.0beta1 a month
ago but I thought it was fixed.

http://archives.postgresql.org/pgsql...8/msg00103.php

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #6  
Old   
elein
 
Posts: n/a

Default Re: 8.0B2 psql \e - 09-13-2004 , 03:36 PM



This is the source for beta2. Perhap the previous
fix was to add the path[0] check but the path == NULL
check was forgotten?

OR, is it a problem if path==NULL?

--elein

On Mon, Sep 13, 2004 at 01:31:26PM -0700, elein wrote:
Quote:
This looks like the same bug as Michael's
http://archives.postgresql.org/pgsql...8/msg00103.php

trim_directory needs to check for a NULL pointer in path.

if ( path == NULL || path[0] == '\0' )

I'll verify I have the version I think I have...

(gdb) bt
#0 0x0805dd15 in trim_trailing_separator (path=0x0) at path.c:442
#1 0x0805d6b2 in canonicalize_path (path=0x0) at path.c:123
#2 0x0804af80 in exec_command (cmd=0x808f958 "e", scan_state=0x808ba30, query_buf=0x808bb80)
at command.c:378
#3 0x0804a964 in HandleSlashCmds (scan_state=0x808ba30, query_buf=0x808bb80) at command.c:86
#4 0x0804fd31 in MainLoop (source=0x40217a60) at mainloop.c:257
#5 0x080517b2 in main (argc=2, argv=0xbffff1f4) at startup.c:310
#6 0x401177ee in __libc_start_main () from /lib/libc.so.6

419 static void
420 trim_directory(char *path)
421 {
422 char *p;
423
424 if (path[0] == '\0')
425 return;
426
427 for (p = path + strlen(path) - 1; IS_DIR_SEP(*p) && p > path; p--)
428 ;
429 for (; !IS_DIR_SEP(*p) && p > path; p--)
430 ;
431 *p = '\0';
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) print path[0]
Cannot access memory at address 0x0


On Mon, Sep 13, 2004 at 02:20:14PM -0600, Michael Fuhr wrote:
On Mon, Sep 13, 2004 at 12:47:54PM -0700, elein wrote:
Has anyone else experienced a segfault in psql on 8.0B2
when using \e? I can reproduce this consistently.

If not I'll trace it down if I can, but if it is a known
problem, I won't bother.

I'm using the latest CVS sources on Solaris 9 and can't reproduce
this problem. The segfault was identified in 8.0.0beta1 a month
ago but I thought it was fixed.

http://archives.postgresql.org/pgsql...8/msg00103.php

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
  #7  
Old   
Tom Lane
 
Posts: n/a

Default Re: 8.0B2 psql \e - 09-13-2004 , 04:04 PM



elein <elein (AT) varlena (DOT) com> writes:
Quote:
I'll verify I have the version I think I have...

(gdb) bt
#0 0x0805dd15 in trim_trailing_separator (path=0x0) at path.c:442
#1 0x0805d6b2 in canonicalize_path (path=0x0) at path.c:123
#2 0x0804af80 in exec_command (cmd=0x808f958 "e", scan_state=0x808ba30, query_buf=0x808bb80)
at command.c:378
You seem to be missing this patch:

http://developer.postgresql.org/cvsw...1.122;r2=1.123


regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.