Skip site navigation (1) Skip section navigation (2)


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Takayuki Tsunakawa <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Subject: Re: [HACKERS] Win32 WEXITSTATUS too
Date: 2007-01-23 15:32:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Takayuki Tsunakawa wrote:
> From: "Magnus Hagander" <magnus(at)hagander(dot)net>
> > Are you entirely sure that ntstatus.h is where to look? Because per
> > whatever docs I've found, that contains "device driver errors" and
> *not*
> > exception codes.
> Yes, what you are pointing out is correct.  winbase.h and winnt.h
> should be consulted instead of ntstatus.h.  See the the section
> "Return Value" in the following page:

Well, it seems to be in two place.  I see at:

	The ExceptionCode parameter is the number that the operating system
	assigned to the exception. You can see a list of various exception codes
	in WINNT.H by searching for #defines that start with "STATUS_". For
	example, the code for the all-too-familiar STATUS_ACCESS_VIOLATION is
	0xC0000005. A more complete set of exception codes can be found in
	NTSTATUS.H from the Windows NT DDK.

And it seems Wine also has it in both places.  The nice thing about
ntstatus.h is that it _only_ contains exception values, rather than
winnt.h, which has lots of other stuff too.

> Furthermore, the message is meaningless for users because they can do
> nothing with the information.  So, I think the message should say
> something like
> child process was terminated by exception %X
> This seems to be a bug of PostgreSQL.
> Please report this message with the details of the phynomenon to
> PostgreSQL developers.

I am hoping some of the hex values will have descriptions that will help
users solve problems in their operating system configuration, rather
than asking us.  If they are in a crisis, asking the community  might
not be quick enough.

FYI, here is a patch that recommends ntstatus.h:

This says you can get text for exceptions, but it didn't work for me,
but I didn't try loading ntdll.dll:

  Bruce Momjian   bruce(at)momjian(dot)us

  + If your life is a hard drive, Christ can be your backup. +

In response to


pgsql-hackers by date

Next:From: Magnus HaganderDate: 2007-01-23 15:33:16
Subject: Re: [HACKERS] Win32 WEXITSTATUS too
Previous:From: Simon RiggsDate: 2007-01-23 15:31:21
Subject: Re: Updateable cursors

pgsql-patches by date

Next:From: Magnus HaganderDate: 2007-01-23 15:33:16
Subject: Re: [HACKERS] Win32 WEXITSTATUS too
Previous:From: Tom LaneDate: 2007-01-23 15:31:12
Subject: Re: [HACKERS] Win32 WEXITSTATUS too

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group