You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2007/08/08 18:20:07 UTC

negative exit status in Windows builds

I've been noticing negative exit status reported in a few test
results on Windows. For example, in a 12d build with MSVC 8.0,
the following test results are reported:

   NAME                           STATUS   WARN    REAL
   21.cwchar.exe             -1073741811      0   0.047
   22.locale.messages.exe    -1073741811      0   1.282
   22.locale.time.put.exe    -1073741811      0   0.250
   23_allocator.exe          -1073741571      0   0.031
   27_filebuf.exe            -1073741811      0   0.063

I suspect it's because exec failing to map the error code(s)
to meaningful error strings. Farid, can you reproduce this
in your environment? If so, could you quickly see is there's
an easy fix? (If not, let me know, I'll open an issue for
it in Jira).

Thanks
Martin

RE: negative exit status in Windows builds

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Farid Zaripov [mailto:Farid_Zaripov@epam.com] 
> Sent: Wednesday, August 08, 2007 9:53 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: negative exit status in Windows builds
> 
> > I suspect it's because exec failing to map the error code(s) to 
> > meaningful error strings. Farid, can you reproduce this in your 
> > environment? If so, could you quickly see is there's an 
> easy fix? (If 
> > not, let me know, I'll open an issue for it in Jira).
> 
>   It's easy to fix, but what signals map these values to?

  Fixed: http://svn.apache.org/viewvc?view=rev&rev=564002

Farid.

Re: negative exit status in Windows builds

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Friday, August 10, 2007 6:36 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: negative exit status in Windows builds
>>
>> Farid Zaripov wrote:
>>>> -----Original Message-----
>>>> From: Martin Sebor [mailto:sebor@roguewave.com]
>>>> Sent: Wednesday, August 08, 2007 11:23 PM
>>>> To: stdcxx-dev@incubator.apache.org
>>>> Subject: Re: negative exit status in Windows builds
>>>>
>>>> STATUS_STACK_OVERFLOW can be mapped to SIGSTKFLT (used for this 
>>>> purpose on Linux).
>>>   But SIGSTKFLT is signals when the coprocessor experiences a stack 
>>> fault
>>> (http://en.wikipedia.org/wiki/SIGSTKFLT) and we have program stack 
>>> overflow.
>> What's the difference?
> 
>   The coprocessor stack is the memory inside coprocessor (set of the
> registers)
> and program stack is the part of the common RAM. 

I see. You're right, it probably wouldn't be appropriate to map
STATUS_STACK_OVERFLOW on the main processor to a coprocessor error,
even if it's not used anymore. Although by mapping to SIGSEGV we
are losing a valuable piece of information about the failure. It
would be nice if we could find a way to preserve it.

FWIW, I haven't found much information on SIGSTKFLT on the net.
The most informative description I came across is this one:

SIGSTKFLT
	
     This signal is defined only by Linux. This signal showed up in
     the earliest versions of Linux, intended to be used for stack
     faults taken by the math coprocessor. This signal is not
     generated by the kernel, but remains for backward compatibility.

http://book.chinaunix.net/special/ebook/addisonWesley/APUE2/0201433079/ch10lev1sec2.html

Martin

RE: negative exit status in Windows builds

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Friday, August 10, 2007 6:36 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: negative exit status in Windows builds
> 
> Farid Zaripov wrote:
> >> -----Original Message-----
> >> From: Martin Sebor [mailto:sebor@roguewave.com]
> >> Sent: Wednesday, August 08, 2007 11:23 PM
> >> To: stdcxx-dev@incubator.apache.org
> >> Subject: Re: negative exit status in Windows builds
> >>
> >> STATUS_STACK_OVERFLOW can be mapped to SIGSTKFLT (used for this 
> >> purpose on Linux).
> > 
> >   But SIGSTKFLT is signals when the coprocessor experiences a stack 
> > fault
> > (http://en.wikipedia.org/wiki/SIGSTKFLT) and we have program stack 
> > overflow.
> 
> What's the difference?

  The coprocessor stack is the memory inside coprocessor (set of the
registers)
and program stack is the part of the common RAM. 

Farid.

Re: negative exit status in Windows builds

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Wednesday, August 08, 2007 11:23 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: negative exit status in Windows builds
>>
>> STATUS_STACK_OVERFLOW can be mapped to SIGSTKFLT (used for 
>> this purpose on Linux).
> 
>   But SIGSTKFLT is signals when the coprocessor experiences a stack
> fault
> (http://en.wikipedia.org/wiki/SIGSTKFLT) and we have program stack
> overflow.

What's the difference?

Btw., from the Linux signal man page it looks like SIGSTKFLT
isn't used in the kernel (yet): http://linux.die.net/man/7/signal

Martin

RE: negative exit status in Windows builds

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Wednesday, August 08, 2007 11:23 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: negative exit status in Windows builds
> 
> STATUS_STACK_OVERFLOW can be mapped to SIGSTKFLT (used for 
> this purpose on Linux).

  But SIGSTKFLT is signals when the coprocessor experiences a stack
fault
(http://en.wikipedia.org/wiki/SIGSTKFLT) and we have program stack
overflow.

Farid.

Re: negative exit status in Windows builds

Posted by Martin Sebor <se...@roguewave.com>.
STATUS_STACK_OVERFLOW can be mapped to SIGSTKFLT (used for
this purpose on Linux). AFAICS, STATUS_INVALID_PARAMETER
doesn't seem to have an equivalent in the UNIX world so
unless you can find something that corresponds to it on
CygWin we'll need to make up a mnemonic for it. How does
PARAM sound?

Martin

Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
>> Sent: Wednesday, August 08, 2007 7:20 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: negative exit status in Windows builds
>>
>> I've been noticing negative exit status reported in a few 
>> test results on Windows. For example, in a 12d build with 
>> MSVC 8.0, the following test results are reported:
>>
>>    NAME                           STATUS   WARN    REAL
>>    21.cwchar.exe             -1073741811      0   0.047
>>    22.locale.messages.exe    -1073741811      0   1.282
>>    22.locale.time.put.exe    -1073741811      0   0.250
>>    27_filebuf.exe            -1073741811      0   0.063
> 
> All above: -1073741811 == 0xC000000D == STATUS_INVALID_PARAMETER
> 
> //
> // MessageId: STATUS_INVALID_PARAMETER
> //
> // MessageText:
> //
> //  An invalid parameter was passed to a service or function.
> //
> #define STATUS_INVALID_PARAMETER         ((NTSTATUS)0xC000000DL)
> 
>>    23_allocator.exe          -1073741571      0   0.031
> 
>   -1073741571 == 0xC00000FD == STATUS_STACK_OVERFLOW
> //
> // MessageId: STATUS_STACK_OVERFLOW
> //
> // MessageText:
> //
> //  A new guard page for the stack cannot be created.
> //
> #define STATUS_STACK_OVERFLOW            ((NTSTATUS)0xC00000FDL)    //
> winnt
> 
>> I suspect it's because exec failing to map the error code(s) 
>> to meaningful error strings. Farid, can you reproduce this in 
>> your environment? If so, could you quickly see is there's an 
>> easy fix? (If not, let me know, I'll open an issue for it in Jira).
> 
>   It's easy to fix, but what signals map these values to?
> 
> Farid.


RE: negative exit status in Windows builds

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
> Sent: Wednesday, August 08, 2007 7:20 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: negative exit status in Windows builds
> 
> I've been noticing negative exit status reported in a few 
> test results on Windows. For example, in a 12d build with 
> MSVC 8.0, the following test results are reported:
> 
>    NAME                           STATUS   WARN    REAL
>    21.cwchar.exe             -1073741811      0   0.047
>    22.locale.messages.exe    -1073741811      0   1.282
>    22.locale.time.put.exe    -1073741811      0   0.250
>    27_filebuf.exe            -1073741811      0   0.063

All above: -1073741811 == 0xC000000D == STATUS_INVALID_PARAMETER

//
// MessageId: STATUS_INVALID_PARAMETER
//
// MessageText:
//
//  An invalid parameter was passed to a service or function.
//
#define STATUS_INVALID_PARAMETER         ((NTSTATUS)0xC000000DL)

>    23_allocator.exe          -1073741571      0   0.031

  -1073741571 == 0xC00000FD == STATUS_STACK_OVERFLOW
//
// MessageId: STATUS_STACK_OVERFLOW
//
// MessageText:
//
//  A new guard page for the stack cannot be created.
//
#define STATUS_STACK_OVERFLOW            ((NTSTATUS)0xC00000FDL)    //
winnt

> I suspect it's because exec failing to map the error code(s) 
> to meaningful error strings. Farid, can you reproduce this in 
> your environment? If so, could you quickly see is there's an 
> easy fix? (If not, let me know, I'll open an issue for it in Jira).

  It's easy to fix, but what signals map these values to?

Farid.