Jon TURNEY | 31 Mar 19:46 2015
Picon

[PATCH 0/3] Make detailled exception information available to signal handlers

Thanks for your help so far.  Here's another attempt at this.

Questions:

The ContextFlags member of the CONTEXT type is named cr2 in struct __mcontext. I 
don't understand how that can be right.

For a non-exception signal, we won't have aCONTEXT to provide.  Is one that is 
all zeroes acceptable?

Jon TURNEY (3):
  Rename struct ucontext to struct __mcontext
  Make mcontext and stack information available to signal handlers
  Add cygwin_internal() operation to convert siginfo_t * to
    EXCEPTION_RECORD *

 winsup/cygwin/ChangeLog               | 20 ++++++++++++++++++++
 winsup/cygwin/exception.h             |  1 +
 winsup/cygwin/exceptions.cc           | 20 ++++++++++++++++++--
 winsup/cygwin/external.cc             | 13 +++++++++++++
 winsup/cygwin/include/cygwin/signal.h | 18 +++++++++++-------
 winsup/cygwin/include/sys/cygwin.h    |  4 +++-
 winsup/cygwin/include/sys/ucontext.h  | 26 ++++++++++++++++++++++++++
 winsup/cygwin/include/ucontext.h      | 16 ++++++++++++++++
 8 files changed, 108 insertions(+), 10 deletions(-)
 create mode 100644 winsup/cygwin/include/sys/ucontext.h
 create mode 100644 winsup/cygwin/include/ucontext.h

--

-- 
2.1.4
(Continue reading)

Jon TURNEY | 26 Mar 16:25 2015
Picon

[PATCH] Make EXCEPTION_POINTERS available to signal handlers

Add ucontext.h header, defining ucontext_t and mcontext_t types.

Provide sigaction sighandlers with a ucontext_t parameter containing a
mcontext_t with exception context information, if available.

	* include/sys/ucontext.h (__ucontext): New header.
	* include/ucontext.h (_UCONTEXT_H): Ditto.
	* exception.h (cygwin_exception): Add exception_record accessor.
	* exceptions.cc (call_signal_handler): Provide ucontext_t
	parameter to signal handler function, if available.

Signed-off-by: Jon TURNEY <jon.turney <at> dronecode.org.uk>
---
 winsup/cygwin/ChangeLog              |  8 ++++++++
 winsup/cygwin/exception.h            |  1 +
 winsup/cygwin/exceptions.cc          | 16 ++++++++++++++--
 winsup/cygwin/include/sys/ucontext.h | 27 +++++++++++++++++++++++++++
 winsup/cygwin/include/ucontext.h     | 16 ++++++++++++++++
 5 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100644 winsup/cygwin/include/sys/ucontext.h
 create mode 100644 winsup/cygwin/include/ucontext.h

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 869beee..ce09390 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
 <at>  <at>  -1,3 +1,11  <at>  <at> 
+2015-03-26  Jon TURNEY  <jon.turney <at> dronecode.org.uk>
+
+	* include/sys/ucontext.h (__ucontext): New header.
(Continue reading)

Yaakov Selkowitz | 26 Mar 06:25 2015
Picon

[PATCH] cygwin: add GNU basename(3)

winsup/cygwin/
* common.din (__gnu_basename): Export.
* path.cc (__gnu_basename): New function.

winsup/doc/
* posix.xml (std-gnu): Add basename.
(std-notes): Add note about two forms of basename.
---
This depends on the newlib patch currently under discussion.

 winsup/cygwin/common.din |  1 +
 winsup/cygwin/path.cc    | 28 ++++++++++++++++++++++++++++
 winsup/doc/posix.xml     |  6 +++++-
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 42098ff..f14b331 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
 <at>  <at>  -61,6 +61,7  <at>  <at>  __fsetlocking SIGFE
 __fwritable NOSIGFE
 __fwriting NOSIGFE
 __getreent NOSIGFE
+__gnu_basename NOSIGFE
 __infinity NOSIGFE
 __isinfd NOSIGFE
 __isinff NOSIGFE
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 47c687f..b05333f 100644
--- a/winsup/cygwin/path.cc
(Continue reading)

Jon TURNEY | 13 Mar 15:25 2015
Picon

[PATCH] Fix winsup/doc to install into prefix

By default, docdir and htmldir are defined in terms of prefix, so make sure to
define it, so their values are prefix-relative.

Without this, 'make install' installs the documentation into /share/doc/ unless
configured otherwise.

	* Makefile.in (prefix): Define.
---
 winsup/doc/ChangeLog   | 4 ++++
 winsup/doc/Makefile.in | 1 +
 2 files changed, 5 insertions(+)

diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog
index aefb41e..814e651 100644
--- a/winsup/doc/ChangeLog
+++ b/winsup/doc/ChangeLog
 <at>  <at>  -1,3 +1,7  <at>  <at> 
+2015-03-13  Jon TURNEY  <jon.turney <at> dronecode.org.uk>
+
+	* Makefile.in (prefix): Define.
+
 2015-03-12  Corinna Vinschen  <corinna <at> vinschen.de>

 	* ntsec.xml (ntsec-mapping-nsswitch-desc): Fix typo.
diff --git a/winsup/doc/Makefile.in b/winsup/doc/Makefile.in
index 55fd850..5b2f0ed 100644
--- a/winsup/doc/Makefile.in
+++ b/winsup/doc/Makefile.in
 <at>  <at>  -12,6 +12,7  <at>  <at>  SHELL =  <at> SHELL <at> 
 srcdir =  <at> srcdir <at> 
(Continue reading)

Alexey Pavlov | 12 Mar 19:18 2015
Picon

braces around scalar initializer for type

Building MSYS2 runtime I'm get:

/build2/msys2-runtime/src/msys2-runtime/winsup/cygwin/net.cc:82:56:
error: braces around scalar initializer for type 'u_char {aka unsigned
char}'
 const struct in6_addr in6addr_any = {{IN6ADDR_ANY_INIT}};

                          ^
/build2/msys2-runtime/src/msys2-runtime/winsup/cygwin/net.cc:83:66:
error: braces around scalar initializer for type 'u_char {aka unsigned
char}'
 const struct in6_addr in6addr_loopback = {{IN6ADDR_LOOPBACK_INIT}};

                                               ^
/build2/msys2-runtime/src/msys2-runtime/winsup/cygwin/../Makefile.common:43:
recipe for target 'net.o' failed

So I think next patch can be applied:

From 9c11fcf2fc74601eb48e8060b6575b56be111a02 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow <at> gmail.com>
Date: Thu, 12 Mar 2015 14:33:39 +0300
Subject: [PATCH] Fix error "braces around scalar initializer for type"

---
 winsup/cygwin/net.cc                   | 4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index e06fd52..f9b317c 100644
(Continue reading)

Alexey Pavlov | 12 Mar 18:30 2015
Picon

Fix typo

From 9c11fcf2fc74601eb48e8060b6575b56be111a02 Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow <at> gmail.com>
Date: Thu, 12 Mar 2015 14:33:39 +0300
Subject: [PATCH] Fix typos.

---
 winsup/cygwin/include/cygwin/version.h | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/winsup/cygwin/include/cygwin/version.h
b/winsup/cygwin/include/cygwin/version.h
index b46fe24..71d118e 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
 <at>  <at>  -467,7 +467,7  <at>  <at>  details. */
            putwc_unlocked, putwchar_unlocked.
       284: Export sockatmark.
       285: Export wcstold.
-      285: Export cabsl, cimagl, creall, finitel, hypotl, sqrtl.
+      286: Export cabsl, cimagl, creall, finitel, hypotl, sqrtl.
       287: Export issetugid.
      */

--

-- 
2.3.0

Jon TURNEY | 12 Mar 15:05 2015
Picon

[PATCH] Improve stackdumps on x86_64


I was looking at the crash reported at [1]. Processing the stackdump gives:

> 0x000000018006ff23    signal_exit                                exceptions.cc:1234
> 0x00000001800713ea    _cygtls::call_signal_handler()             exceptions.cc:1490
> 0x0000000180121d04    sig_send(_pinfo*, siginfo_t&, _cygtls*)    sigproc.cc:714
> 0x000000018011ee5e    _pinfo::kill(siginfo_t&)                   signal.cc:252
> 0x000000018011f32b    kill0                                      signal.cc:303
> 0x000000018011f4fc    raise                                      signal.cc:289
> 0x000000018011f7bf    abort                                      signal.cc:376
> 0x00000001801528c5    dlfree                                     malloc.cc:4762
> 0x00000001800c52b3    free                                       sync.h:36
> 0x000000018011ae5b    ??                                         sigfe.s:43

Which is not entirely helpful.

We can see that an abort signal is being raised inside free, but the 
stacktrace stops at _sigbe, because unwinding that frame requires 
special measures.

Presumably run has some invalid heap use going on, but annoyingly the 
stackdump stops short of identifying the problem line.

Attached is a patch which teaches stack_info::walk() how to unwind these 
frames on x86_64.

Also attached is a small testcase, which currently produces a similar 
stackdump truncated at _sigbe, or with my patch applied:

> 0x0000000180070238    signal_exit                                exceptions.cc:1321
(Continue reading)

Yaakov Selkowitz | 10 Mar 17:26 2015
Picon

[PATCH] cygwin: fix __x86_64__ conditional in stdint.h

Signed-off-by: Yaakov Selkowitz <yselkowi <at> redhat.com>
---
 winsup/cygwin/ChangeLog        | 4 ++++
 winsup/cygwin/include/stdint.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 550490a..cd2dbb9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
 <at>  <at>  -1,3 +1,7  <at>  <at> 
+2015-03-10  Yaakov Selkowitz  <yselkowitz <at> cygwin.com>
+
+	* include/stdint.h: Fix __x86_64__ conditional.
+
 2015-03-05  Corinna Vinschen  <corinna <at> vinschen.de>

 	* tty.h (tty::set_master_ctl_closed): Rename from set_master_closed.
diff --git a/winsup/cygwin/include/stdint.h b/winsup/cygwin/include/stdint.h
index b670884..94b6b76 100644
--- a/winsup/cygwin/include/stdint.h
+++ b/winsup/cygwin/include/stdint.h
 <at>  <at>  -114,7 +114,7  <at>  <at>  typedef unsigned long long uintmax_t;
 #if !defined (__cplusplus) || defined (__STDC_LIMIT_MACROS) \
     || defined (__INSIDE_CYGWIN__)

-#if __x86_64__
+#ifdef __x86_64__
 # define __I64(n) n ## L
 # define __U64(n) n ## UL
(Continue reading)

Jon TURNEY | 19 Feb 14:21 2015
Picon

[PATCH] Compile sigfe.s with CFLAGS


CFLAGS isn't used when compiling the generated file sigfe.s, so if that 
contains -g, it lacks source debugging information.

2015-02-19  Jon TURNEY  <jon.turney <at> dronecode.org.uk>

	* Makefile.in (sigfe.o): Use CFLAGS.

Index: cygwin/Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/Makefile.in,v
retrieving revision 1.278
diff -u -u -p -r1.278 Makefile.in
--- cygwin/Makefile.in	28 Jan 2015 11:43:06 -0000	1.278
+++ cygwin/Makefile.in	19 Feb 2015 13:12:11 -0000
 <at>  <at>  -710,7 +710,7  <at>  <at>  sigfe.s: $(DEF_FILE)
 	[ -s $ <at>  ] && touch $ <at> 

 sigfe.o: sigfe.s
-	$(CC) -c -o $ <at>  $<
+	$(CC) ${CFLAGS} -c -o $ <at>  $<

 ctags: CTAGS
 tags:  CTAGS
Pierre A. Humblet | 23 Jan 03:05 2015
Picon

[PATCH] Add-on to gethostbyname2

Add-on to gethostbyname2, as discussed previously on main list.
The diff is also attached.

Pierre

2015-01-22  Pierre A. Humblet <pierre <at> phumblet.no-ip.org>

         * net.cc (cygwin_inet_pton): Declare.
         (gethostby_specials): New function.
         (gethostby_helper): Change returned addrtype in 4-to-6 case.
         (gethostbyname2): Call gethostby_specials.

cvs diff -up net.cc
Index: net.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/net.cc,v
retrieving revision 1.322
diff -u -p -r1.322 net.cc
--- net.cc      20 Jan 2015 18:23:19 -0000      1.322
+++ net.cc      23 Jan 2015 00:02:22 -0000
 <at>  <at>  -72,6 +72,7  <at>  <at>  extern "C"
    int __stdcall rcmd (char **ahost, unsigned short inport, char *locuser,
                       char *remuser, char *cmd, SOCKET * fd2p);
    int sscanf (const char *, const char *, ...);
+  int cygwin_inet_pton(int, const char *, void *);
    int cygwin_inet_aton(const char *, struct in_addr *);
    const char *cygwin_inet_ntop (int, const void *, char *, socklen_t);
    int dn_length1(const unsigned char *, const unsigned char *,
 <at>  <at>  -1168,6 +1169,97  <at>  <at>  memcpy4to6 (char *dst, const u_char *src
    memcpy (dst + 12, src, NS_INADDRSZ);
(Continue reading)

Yaakov Selkowitz | 18 Dec 18:21 2014

[PATCH] spelling fix for struct passwd

This field is spelled pw_passwd on Linux, and I haven't found a 
different spelling on other platforms (it is not mandated by POSIX). 
Patch attached.

--
Yaakov

Attachment (doc-ntsec-passwd.patch): text/x-patch, 730 bytes

Gmane