Re: Perl 5.10 vs. PG 8.4 on Win32

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Perl 5.10 vs. PG 8.4 on Win32
Date: 2009-05-15 16:15:42
Message-ID: 937d27e10905150915h627d0aa5x340b51f7a0dcb1f1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, May 15, 2009 at 3:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dave Page <dpage(at)pgadmin(dot)org> writes:
>> On Fri, May 15, 2009 at 3:23 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Ho, that's pretty curious.  The first two messages are the trace of the
>>> atexit hook I recently installed, which means something called exit()
>>> or the moral equivalent thereof.  I wouldn't really expect that to
>>> happen in a crash situation ... is Windows dumb enough to try to run
>>> the atexit hooks of a crashed process?
>
>> Hmm, the MSDN docs don't say whether or not it will. A quick test,
>> forcing a crash by writing beyond the end of a char array shows that
>> it does follow spec and doesn't call the hooks.
>
> Try setting a breakpoint at atexit_callback() and seeing how it got
> there in the CREATE LANGUAGE test case.

Getting past the exception to get to the atexit_callback() breakpoint
in the debugger is proving a little tricky right now (and I have to
leave for the moment), so I'll play with that some more later.
Couldn't the callback have been called by another process though? The
crash did bring down the entire server, so assume other backends would
have terminated normally on the postmasters instruction.

Anyhoo, here's the backtrace for the actual problem:

...
perl510.dll!28028026()
> plperl.dll!plperl_init_interp() Line 452 C
plperl.dll!_PG_init() Line 229 C
postgres.exe!internal_load_library(const char * libname=0x01372048)
Line 287 C
postgres.exe!load_external_function(char * filename=0x013710d8, char
* funcname=0x01372bf0, char signalNotFound=' ', void * *
filehandle=0x00caf678) Line 116 C
postgres.exe!fmgr_c_validator(FunctionCallInfoData *
fcinfo=0x00caf600) Line 647 C
postgres.exe!OidFunctionCall1(unsigned int functionId=2247, unsigned
long arg1=40962) Line 1561 + 0x2f bytes C
postgres.exe!ProcedureCreate(const char * procedureName=0x01372120,
unsigned int procNamespace=11, char replace=0, char returnsSet=0,
unsigned int returnType=2280, unsigned int languageObjectId=13,
unsigned int languageValidator=2247, const char * prosrc=0x01372120,
const char * probin=0x01372a68, char isAgg=0, char isWindowFunc=0,
char security_definer=0, char isStrict=0, char volatility='v',
oidvector * parameterTypes=0x01372ac8, unsigned long
allParameterTypes=0, unsigned long parameterModes=0, unsigned long
parameterNames=0, List * parameterDefaults=0x00000000, unsigned long
proconfig=0, float procost=1.0000000, float prorows=0.00000000) Line
550 + 0x7 bytes C
postgres.exe!CreateProceduralLanguage(CreatePLangStmt *
stmt=0x0132c960) Line 154 + 0x52 bytes C
postgres.exe!ProcessUtility(Node * parsetree=0x0132c960, const char
* queryString=0x0132c118, ParamListInfoData * params=0x00000000, char
isTopLevel=' ', _DestReceiver * dest=0x0132cb10, char *
completionTag=0x00cafbc0) Line 961 + 0x6 bytes C
postgres.exe!PortalRunUtility(PortalData * portal=0x00000000, Node *
utilityStmt=0x00000000, char isTopLevel=' ', _DestReceiver *
dest=0x0132cb10, char * completionTag=0x00cafbc0) Line 1200 C
postgres.exe!PortalRunMulti(PortalData * portal=0x00000000, char
isTopLevel=' ', _DestReceiver * dest=0x0132cb10, _DestReceiver *
altdest=0x0132cb10, char * completionTag=0x00cafbc0) Line 1299 + 0x11
bytes C
postgres.exe!PortalRun(PortalData * portal=0x01372fc0, long
count=2147483647, char isTopLevel=' ', _DestReceiver *
dest=0x0132cb10, _DestReceiver * altdest=0x0132cb10, char *
completionTag=0x00cafbc0) Line 824 + 0x17 bytes C
postgres.exe!exec_simple_query(const char * query_string=0x00000000)
Line 998 C
postgres.exe!PostgresMain(int argc=4, char * * argv=0x012d5378,
const char * username=0x01115128) Line 3610 C
postgres.exe!BackendRun(Port * port=0x00cafd48) Line 3390 C
postgres.exe!SubPostmasterMain(int argc=3, char * * argv=0x01112950)
Line 3862 + 0x8 bytes C
postgres.exe!main(int argc=3, char * * argv=0x01112950) Line 165 +
0x7 bytes C
postgres.exe!__tmainCRTStartup() Line 597 + 0x17 bytes C

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-05-15 16:26:06 Re: Perl 5.10 vs. PG 8.4 on Win32
Previous Message Heikki Linnakangas 2009-05-15 15:46:19 Re: [HACKERS] Re: BUG #4796: Recovery followed by backup creates unrecoverable WAL-file