Re: CVS HEAD busted on Windows?

From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
To: dpage(at)vale-housing(dot)co(dot)uk
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, peter_e(at)gmx(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: CVS HEAD busted on Windows?
Date: 2006-06-21 17:41:43
Message-ID: 20060622.024143.74735394.y-asaba@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
Subject: Re: [HACKERS] CVS HEAD busted on Windows?
Date: Wed, 21 Jun 2006 15:39:34 +0100

>
>
> > -----Original Message-----
> > From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> > Sent: 21 June 2006 14:30
> > To: Dave Page
> > Cc: Peter Eisentraut; pgsql-hackers(at)postgresql(dot)org
> > Subject: Re: [HACKERS] CVS HEAD busted on Windows?
> >
> > "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
> > > killed it this morning (after 6+ hours of runtime) and it reported:
> > > pg_regress: could not set database default locales
> >
> > That would be here:
> >
> > "$bindir/psql" -q -X $psql_options -c "\
> > alter database \"$dbname\" set lc_messages to 'C';
> > alter database \"$dbname\" set lc_monetary to 'C';
> > alter database \"$dbname\" set lc_numeric to 'C';
> > alter database \"$dbname\" set lc_time to 'C';" "$dbname"
> > if [ $? -ne 0 ]; then
> > echo "$me: could not set database default locales"
> > (exit 2); exit
> > fi
> >
> > Could you gdb the attached backend and see what it's doing? Is it
> > actually consuming CPU, or just stuck?
>
> Hmmm, running it more interactively I see what was probably the hang
> when run from the scheduler:
>
> ---------------------------
> psql.exe - Application Error
> ---------------------------
> The instruction at "0x7c8396d0" referenced memory at "0x00000014". The
> memory could not be "read".
> Click on OK to terminate the program
> Click on CANCEL to debug the program
> ---------------------------
> OK Cancel
> ---------------------------
>
> (if that got fired off under the scheduler it would appear to hang as
> there would be no display to display it on, and no way to hit OK or
> Cancel).
>
> Unfortunately gdb is giving a somewhat useless backtrace (yes, this is a
> debug build):

I got a backtrace.

Program received signal SIGSEGV, Segmentation fault.
0x7c958fea in _libwsock32_a_iname ()
(gdb) bt
#0 0x7c958fea in _libwsock32_a_iname ()
#1 0x7c951538 in _libwsock32_a_iname ()
#2 0x7c94104b in _libwsock32_a_iname ()
#3 0x00404e68 in SendQuery (query=0x3d2669 "select 1") at common.c:815
#4 0x0040951a in main (argc=9, argv=0x3d27c8) at startup.c:306

cancelConnLock is not initialized (InitializeCriticalSection()) at
startup.c when psql execute with '-c' option.

Is the following patch right?

Index: startup.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/startup.c,v
retrieving revision 1.133
diff -c -r1.133 startup.c
*** startup.c 14 Jun 2006 16:49:02 -0000 1.133
--- startup.c 21 Jun 2006 17:36:26 -0000
***************
*** 303,308 ****
--- 303,313 ----
if (VariableEquals(pset.vars, "ECHO", "all"))
puts(options.action_string);

+ #ifdef WIN32
+ /* establish control-C handling for interactive operation */
+ setup_cancel_handler();
+ #endif
+
successResult = SendQuery(options.action_string)
? EXIT_SUCCESS : EXIT_FAILURE;
}

--
Yoshiyuki Asaba
y-asaba(at)sraoss(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Woodward 2006-06-21 18:10:31 vacuum, performance, and MVCC
Previous Message Magnus Hagander 2006-06-21 17:31:35 Re: UTF8 server-side on Win32?