public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Building libsigsegv on Cygwin64
@ 2014-02-21 15:46 Angelo Graziosi
  2014-02-21 16:11 ` Corinna Vinschen
  2014-03-02 17:21 ` Ken Brown
  0 siblings, 2 replies; 10+ messages in thread
From: Angelo Graziosi @ 2014-02-21 15:46 UTC (permalink / raw)
  To: cygwin

Trying to build libsigsegv-2.10 on Cygwin64 (using the src tarball and 
its .cygport file from x86 distribution), fails as follows

[...]
libtool: compile:  gcc -DHAVE_CONFIG_H -I. 
-I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -I.. -I. 
-I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -ggdb -O2 -pipe 
-Wimplicit-function-declaration 
-fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/build=/usr/src/debug/libsigsegv-2.10-1 
-fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10=/usr/src/debug/libsigsegv-2.10-1 
-c /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c 
-DDLL_EXPORT -DPIC -o .libs/handler.o
In file included from 
/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c:20:0:
/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c: In 
function 'main_exception_filter':
/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:218:43: 
error: 'struct _CONTEXT' has no member named 'Esp'
                ExceptionInfo->ContextRecord->Esp = new_safe_esp;
                                            ^
/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:220:43: 
error: 'struct _CONTEXT' has no member named 'Eip'
                ExceptionInfo->ContextRecord->Eip = (unsigned 
long)&stack_overflow_handler;
                                            ^
Makefile:399: set di istruzioni per l'obiettivo "handler.lo" non riuscito
make[1]: *** [handler.lo] Errore 1
make[1]: uscita dalla directory "/works/tmp/libsigsegv-2.10-1/build/src"
Makefile:344: set di istruzioni per l'obiettivo "install-recursive" non 
riuscito
make: *** [install-recursive] Errore 1

Since my Cygwin64 is a fesh installation, I wonder if I missed to 
installe some needed packages... or is that error to be expected on 
Cygwin64?


Thanks,
  Angelo.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-02-21 15:46 Building libsigsegv on Cygwin64 Angelo Graziosi
@ 2014-02-21 16:11 ` Corinna Vinschen
  2014-02-22 15:33   ` Ken Brown
  2014-03-02 17:21 ` Ken Brown
  1 sibling, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2014-02-21 16:11 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2235 bytes --]

On Feb 21 16:32, Angelo Graziosi wrote:
> Trying to build libsigsegv-2.10 on Cygwin64 (using the src tarball
> and its .cygport file from x86 distribution), fails as follows
> 
> [...]
> libtool: compile:  gcc -DHAVE_CONFIG_H -I.
> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -I.. -I.
> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -ggdb -O2
> -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/build=/usr/src/debug/libsigsegv-2.10-1 -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10=/usr/src/debug/libsigsegv-2.10-1
> -c /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c
> -DDLL_EXPORT -DPIC -o .libs/handler.o
> In file included from
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c:20:0:
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:
> In function 'main_exception_filter':
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:218:43:
> error: 'struct _CONTEXT' has no member named 'Esp'
>                ExceptionInfo->ContextRecord->Esp = new_safe_esp;
>                                            ^
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:220:43:
> error: 'struct _CONTEXT' has no member named 'Eip'
>                ExceptionInfo->ContextRecord->Eip = (unsigned
> long)&stack_overflow_handler;
>                                            ^
> Makefile:399: set di istruzioni per l'obiettivo "handler.lo" non riuscito
> make[1]: *** [handler.lo] Errore 1
> make[1]: uscita dalla directory "/works/tmp/libsigsegv-2.10-1/build/src"
> Makefile:344: set di istruzioni per l'obiettivo "install-recursive"
> non riuscito
> make: *** [install-recursive] Errore 1
> 
> Since my Cygwin64 is a fesh installation, I wonder if I missed to
> installe some needed packages... or is that error to be expected on
> Cygwin64?

Yes.  The above code appears not to know 64 bit CPUs.  The 64 bit
instruction pointer register is called Rip, rather than Eip, for
instance.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-02-21 16:11 ` Corinna Vinschen
@ 2014-02-22 15:33   ` Ken Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Ken Brown @ 2014-02-22 15:33 UTC (permalink / raw)
  To: cygwin

On 2/21/2014 10:46 AM, Corinna Vinschen wrote:
> On Feb 21 16:32, Angelo Graziosi wrote:
>> Trying to build libsigsegv-2.10 on Cygwin64 (using the src tarball
>> and its .cygport file from x86 distribution), fails as follows
>>
>> [...]
>> libtool: compile:  gcc -DHAVE_CONFIG_H -I.
>> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -I.. -I.
>> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -ggdb -O2
>> -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/build=/usr/src/debug/libsigsegv-2.10-1 -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10=/usr/src/debug/libsigsegv-2.10-1
>> -c /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c
>> -DDLL_EXPORT -DPIC -o .libs/handler.o
>> In file included from
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c:20:0:
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:
>> In function 'main_exception_filter':
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:218:43:
>> error: 'struct _CONTEXT' has no member named 'Esp'
>>                 ExceptionInfo->ContextRecord->Esp = new_safe_esp;
>>                                             ^
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:220:43:
>> error: 'struct _CONTEXT' has no member named 'Eip'
>>                 ExceptionInfo->ContextRecord->Eip = (unsigned
>> long)&stack_overflow_handler;
>>                                             ^
>> Makefile:399: set di istruzioni per l'obiettivo "handler.lo" non riuscito
>> make[1]: *** [handler.lo] Errore 1
>> make[1]: uscita dalla directory "/works/tmp/libsigsegv-2.10-1/build/src"
>> Makefile:344: set di istruzioni per l'obiettivo "install-recursive"
>> non riuscito
>> make: *** [install-recursive] Errore 1
>>
>> Since my Cygwin64 is a fesh installation, I wonder if I missed to
>> installe some needed packages... or is that error to be expected on
>> Cygwin64?
>
> Yes.  The above code appears not to know 64 bit CPUs.  The 64 bit
> instruction pointer register is called Rip, rather than Eip, for
> instance.

I just took a glance at the libsigsegv source code, and it supports 
several x86_64 platforms.  It should be possible to add support for 
x86_64-cygwin.  Reini, any chance you could look into this?

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-02-21 15:46 Building libsigsegv on Cygwin64 Angelo Graziosi
  2014-02-21 16:11 ` Corinna Vinschen
@ 2014-03-02 17:21 ` Ken Brown
  2014-03-02 18:33   ` Ken Brown
  2014-03-03 15:02   ` Corinna Vinschen
  1 sibling, 2 replies; 10+ messages in thread
From: Ken Brown @ 2014-03-02 17:21 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2379 bytes --]

On 2/21/2014 10:32 AM, Angelo Graziosi wrote:
> Trying to build libsigsegv-2.10 on Cygwin64 (using the src tarball and
> its .cygport file from x86 distribution), fails as follows
>
> [...]
> libtool: compile:  gcc -DHAVE_CONFIG_H -I.
> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -I.. -I.
> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -ggdb -O2 -pipe
> -Wimplicit-function-declaration
> -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/build=/usr/src/debug/libsigsegv-2.10-1
> -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10=/usr/src/debug/libsigsegv-2.10-1
> -c /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c
> -DDLL_EXPORT -DPIC -o .libs/handler.o
> In file included from
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c:20:0:
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c: In
> function 'main_exception_filter':
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:218:43:
> error: 'struct _CONTEXT' has no member named 'Esp'
>                 ExceptionInfo->ContextRecord->Esp = new_safe_esp;
>                                             ^
> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:220:43:
> error: 'struct _CONTEXT' has no member named 'Eip'
>                 ExceptionInfo->ContextRecord->Eip = (unsigned
> long)&stack_overflow_handler;
>                                             ^
> Makefile:399: set di istruzioni per l'obiettivo "handler.lo" non riuscito
> make[1]: *** [handler.lo] Errore 1
> make[1]: uscita dalla directory "/works/tmp/libsigsegv-2.10-1/build/src"
> Makefile:344: set di istruzioni per l'obiettivo "install-recursive" non
> riuscito
> make: *** [install-recursive] Errore 1
>
> Since my Cygwin64 is a fesh installation, I wonder if I missed to
> installe some needed packages... or is that error to be expected on
> Cygwin64?

I found the problem (or at least I found *a* problem):  There's a 
configure test "checking whether a fault handler according to POSIX 
works", which passes on 32-bit Cygwin but fails on 64-bit Cygwin.  I'm 
attaching a file containing the configure test.  Here's what happens in 
the 64-bit case:

$ gcc -o fault fault.c
$ ./fault.exe
$ echo $?
1

In the 32-bit case, the exit code is 0.

I don't know if this indicates a Cygwin bug or something wrong with the 
test.

Ken

[-- Attachment #2: fault.c --]
[-- Type: text/plain, Size: 1651 bytes --]

#include <stdlib.h>
#include <signal.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <sys/mman.h>
# include <fcntl.h>

# define zero_fd -1
# define map_flags MAP_ANON | MAP_PRIVATE
# define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0UL

unsigned long page;
int handler_called = 0;

void sigsegv_handler (int sig, siginfo_t *sip, void *ucp)
{
  void *fault_address = (void *) (sip->si_addr);
  handler_called++;
  if (handler_called == 10)
    exit (4);
  if (fault_address
      != (void*)((page + 0x678) & ~SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS))
    exit (3);
  if (mprotect ((void *) page, 0x10000, PROT_READ | PROT_WRITE) < 0)
    exit (2);
}

void crasher (unsigned long p)
{
  *(int *) (p + 0x678) = 42;
}

int main ()
{
  void *p;
  struct sigaction action;
  /* Preparations.  */
  /* Setup some mmaped memory.  */
  p = mmap ((void *) 0x12340000, 0x10000, PROT_READ | PROT_WRITE, map_flags, zero_fd, 0);
  if (p == (void *)(-1))
    exit (2);
  page = (unsigned long) p;
  /* Make it read-only.  */
  if (mprotect ((void *) page, 0x10000, PROT_READ) < 0)
    exit (2);
  /* Install the SIGSEGV handler.  */
  sigemptyset(&action.sa_mask);
  action.sa_sigaction = &sigsegv_handler;
  action.sa_flags = SA_SIGINFO;
  sigaction (SIGSEGV, &action, (struct sigaction *) NULL);
  sigaction (SIGBUS, &action, (struct sigaction *) NULL);
  /* The first write access should invoke the handler and then complete.  */
  crasher (page);
  /* The second write access should not invoke the handler.  */
  crasher (page);
  /* Check that the handler was called only once.  */
  if (handler_called != 1)
    exit (1);
  /* Test passed!  */
  return 0;
}


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-03-02 17:21 ` Ken Brown
@ 2014-03-02 18:33   ` Ken Brown
  2014-03-03 15:02   ` Corinna Vinschen
  1 sibling, 0 replies; 10+ messages in thread
From: Ken Brown @ 2014-03-02 18:33 UTC (permalink / raw)
  To: cygwin

On 3/2/2014 12:20 PM, Ken Brown wrote:
> On 2/21/2014 10:32 AM, Angelo Graziosi wrote:
>> Trying to build libsigsegv-2.10 on Cygwin64 (using the src tarball and
>> its .cygport file from x86 distribution), fails as follows
>>
>> [...]
>> libtool: compile:  gcc -DHAVE_CONFIG_H -I.
>> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -I.. -I.
>> -I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -ggdb -O2 -pipe
>> -Wimplicit-function-declaration
>> -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/build=/usr/src/debug/libsigsegv-2.10-1
>>
>> -fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10=/usr/src/debug/libsigsegv-2.10-1
>>
>> -c /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c
>> -DDLL_EXPORT -DPIC -o .libs/handler.o
>> In file included from
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c:20:0:
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c: In
>> function 'main_exception_filter':
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:218:43:
>>
>> error: 'struct _CONTEXT' has no member named 'Esp'
>>                 ExceptionInfo->ContextRecord->Esp = new_safe_esp;
>>                                             ^
>> /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:220:43:
>>
>> error: 'struct _CONTEXT' has no member named 'Eip'
>>                 ExceptionInfo->ContextRecord->Eip = (unsigned
>> long)&stack_overflow_handler;
>>                                             ^
>> Makefile:399: set di istruzioni per l'obiettivo "handler.lo" non riuscito
>> make[1]: *** [handler.lo] Errore 1
>> make[1]: uscita dalla directory "/works/tmp/libsigsegv-2.10-1/build/src"
>> Makefile:344: set di istruzioni per l'obiettivo "install-recursive" non
>> riuscito
>> make: *** [install-recursive] Errore 1
>>
>> Since my Cygwin64 is a fesh installation, I wonder if I missed to
>> installe some needed packages... or is that error to be expected on
>> Cygwin64?
>
> I found the problem (or at least I found *a* problem):  There's a

Sorry, this is obviously not *the* problem.  The problem I found needs 
to be addressed, but the problem Angelo encountered is exactly what 
Corinna said: The code in handler-win32.c needs to be extended to work 
in the x86_64 case, as is done on other platforms in handler-unix.c.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-03-02 17:21 ` Ken Brown
  2014-03-02 18:33   ` Ken Brown
@ 2014-03-03 15:02   ` Corinna Vinschen
  2014-03-03 15:15     ` Kai Tietz
  2014-03-03 17:24     ` Corinna Vinschen
  1 sibling, 2 replies; 10+ messages in thread
From: Corinna Vinschen @ 2014-03-03 15:02 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 3373 bytes --]

On Mar  2 12:20, Ken Brown wrote:
> On 2/21/2014 10:32 AM, Angelo Graziosi wrote:
> >Trying to build libsigsegv-2.10 on Cygwin64 (using the src tarball and
> >its .cygport file from x86 distribution), fails as follows
> >
> >[...]
> >libtool: compile:  gcc -DHAVE_CONFIG_H -I.
> >-I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -I.. -I.
> >-I/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src -ggdb -O2 -pipe
> >-Wimplicit-function-declaration
> >-fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/build=/usr/src/debug/libsigsegv-2.10-1
> >-fdebug-prefix-map=/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10=/usr/src/debug/libsigsegv-2.10-1
> >-c /works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c
> >-DDLL_EXPORT -DPIC -o .libs/handler.o
> >In file included from
> >/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler.c:20:0:
> >/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c: In
> >function 'main_exception_filter':
> >/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:218:43:
> >error: 'struct _CONTEXT' has no member named 'Esp'
> >                ExceptionInfo->ContextRecord->Esp = new_safe_esp;
> >                                            ^
> >/works/tmp/libsigsegv-2.10-1/src/libsigsegv-2.10/src/handler-win32.c:220:43:
> >error: 'struct _CONTEXT' has no member named 'Eip'
> >                ExceptionInfo->ContextRecord->Eip = (unsigned
> >long)&stack_overflow_handler;
> >                                            ^
> >Makefile:399: set di istruzioni per l'obiettivo "handler.lo" non riuscito
> >make[1]: *** [handler.lo] Errore 1
> >make[1]: uscita dalla directory "/works/tmp/libsigsegv-2.10-1/build/src"
> >Makefile:344: set di istruzioni per l'obiettivo "install-recursive" non
> >riuscito
> >make: *** [install-recursive] Errore 1
> >
> >Since my Cygwin64 is a fesh installation, I wonder if I missed to
> >installe some needed packages... or is that error to be expected on
> >Cygwin64?
> 
> I found the problem (or at least I found *a* problem):  There's a
> configure test "checking whether a fault handler according to POSIX
> works", which passes on 32-bit Cygwin but fails on 64-bit Cygwin.
> I'm attaching a file containing the configure test.  Here's what
> happens in the 64-bit case:
> 
> $ gcc -o fault fault.c
> $ ./fault.exe
> $ echo $?
> 1
> 
> In the 32-bit case, the exit code is 0.
> 
> I don't know if this indicates a Cygwin bug or something wrong with
> the test.

It indicates a Cygwin bug.  Thanks for the report and the testcase.

The joke here is, the signal handler function gets called twice for the
same exception.  Proof is that you can remove the second call to crasher
and still sigsegv_handler gets called twice.

I see why this happens, but I'm not quite sure yet how to fix it
completely.  I can easily fix this for the normal case as well as for
the case a process gets started by the debugger.  But I have trouble as
soon as a debugger gets attached to a process after the process already
started.

Does anybody know if there's a way for a process to be getting notified
if a debugger attaches to or detaches from it?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-03-03 15:02   ` Corinna Vinschen
@ 2014-03-03 15:15     ` Kai Tietz
  2014-03-03 15:45       ` Corinna Vinschen
  2014-03-03 17:24     ` Corinna Vinschen
  1 sibling, 1 reply; 10+ messages in thread
From: Kai Tietz @ 2014-03-03 15:15 UTC (permalink / raw)
  To: cygwin

Hmm, I think that stuff around EXCEPTION_DEBUG_EVENT is that what you
are searching for.  See for some details
http://msdn.microsoft.com/en-us/library/windows/desktop/ms679299%28v=vs.85%29.aspx

Regards,
Kai

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-03-03 15:15     ` Kai Tietz
@ 2014-03-03 15:45       ` Corinna Vinschen
  0 siblings, 0 replies; 10+ messages in thread
From: Corinna Vinschen @ 2014-03-03 15:45 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

On Mar  3 16:15, Kai Tietz wrote:
> Hmm, I think that stuff around EXCEPTION_DEBUG_EVENT is that what you
> are searching for.  See for some details
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms679299%28v=vs.85%29.aspx

These are functions for the debugger.  I was looking for a way to allow
an inferior process to notice that a debugger has attached or detached.

But, never mind, I found a very simple fix which seems to solve this in all
cases.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-03-03 15:02   ` Corinna Vinschen
  2014-03-03 15:15     ` Kai Tietz
@ 2014-03-03 17:24     ` Corinna Vinschen
  2014-03-03 20:05       ` Ken Brown
  1 sibling, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2014-03-03 17:24 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]

On Mar  3 16:02, Corinna Vinschen wrote:
> On Mar  2 12:20, Ken Brown wrote:
> [...]
> > I found the problem (or at least I found *a* problem):  There's a
> > configure test "checking whether a fault handler according to POSIX
> > works", which passes on 32-bit Cygwin but fails on 64-bit Cygwin.
> > I'm attaching a file containing the configure test.  Here's what
> > happens in the 64-bit case:
> > 
> > $ gcc -o fault fault.c
> > $ ./fault.exe
> > $ echo $?
> > 1
> > 
> > In the 32-bit case, the exit code is 0.
> > 
> > I don't know if this indicates a Cygwin bug or something wrong with
> > the test.
> 
> It indicates a Cygwin bug.  Thanks for the report and the testcase.
> 
> The joke here is, the signal handler function gets called twice for the
> same exception.  Proof is that you can remove the second call to crasher
> and still sigsegv_handler gets called twice.

I just created a new snapshot which contains the fix.  Would you mind
to test it?  It doesn't fix the fact that libsigsegv is missing 64 bit
Windows/Cygwin support, of course...


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Building libsigsegv on Cygwin64
  2014-03-03 17:24     ` Corinna Vinschen
@ 2014-03-03 20:05       ` Ken Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Ken Brown @ 2014-03-03 20:05 UTC (permalink / raw)
  To: cygwin

On 3/3/2014 12:06 PM, Corinna Vinschen wrote:
> On Mar  3 16:02, Corinna Vinschen wrote:
>> On Mar  2 12:20, Ken Brown wrote:
>> [...]
>>> I found the problem (or at least I found *a* problem):  There's a
>>> configure test "checking whether a fault handler according to POSIX
>>> works", which passes on 32-bit Cygwin but fails on 64-bit Cygwin.
>>> I'm attaching a file containing the configure test.  Here's what
>>> happens in the 64-bit case:
>>>
>>> $ gcc -o fault fault.c
>>> $ ./fault.exe
>>> $ echo $?
>>> 1
>>>
>>> In the 32-bit case, the exit code is 0.
>>>
>>> I don't know if this indicates a Cygwin bug or something wrong with
>>> the test.
>>
>> It indicates a Cygwin bug.  Thanks for the report and the testcase.
>>
>> The joke here is, the signal handler function gets called twice for the
>> same exception.  Proof is that you can remove the second call to crasher
>> and still sigsegv_handler gets called twice.
>
> I just created a new snapshot which contains the fix.  Would you mind
> to test it?

It's fixed.  Thanks.

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-03-03 18:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21 15:46 Building libsigsegv on Cygwin64 Angelo Graziosi
2014-02-21 16:11 ` Corinna Vinschen
2014-02-22 15:33   ` Ken Brown
2014-03-02 17:21 ` Ken Brown
2014-03-02 18:33   ` Ken Brown
2014-03-03 15:02   ` Corinna Vinschen
2014-03-03 15:15     ` Kai Tietz
2014-03-03 15:45       ` Corinna Vinschen
2014-03-03 17:24     ` Corinna Vinschen
2014-03-03 20:05       ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).