From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.1.0-0.4
Date: Mon, 06 Jul 2015 02:15:00 -0000 [thread overview]
Message-ID: <5599E4C5.1010109@cornell.edu> (raw)
In-Reply-To: <announce.20150705213417.GH2918@calimero.vinschen.de>
On 7/5/2015 5:34 PM, Corinna Vinschen wrote:
> This test release needs some good testing!
I repeated the emacs experiment discussed in the "[ANNOUNCEMENT] TEST RELEASE:
Cygwin 2.1.0-0.1" thread. In the 32-bit case, the results were more-or-less the
same as before: I forced a stack overflow, emacs recovered, I tried to continue
working, there was a second SIGSEGV, and handle_sigsegv bailed out because
garbage collection was in progress. This time I was unable to prevent the
second SIGSEGV by resetting max-specpdl-size and max-lisp-eval-depth. I'm not
sure what caused the second SIGSEGV, but it might have nothing to do with Cygwin.
In the 64-bit case, however, the recovery from stack overflow never happened
(i.e., the program never reached the siglongjmp). Here's a gdb session:
$ gdb ./emacs.exe
[...]
(gdb) b handle_sigsegv
Breakpoint 3 at 0x1005657b3: file ../../master/src/sysdep.c, line 1643.
(gdb) r -Q
Starting program: /home/kbrown/src/emacs/64build/src/emacs.exe -Q
[At this point I force stack overflow.]
Program received signal SIGSEGV, Segmentation fault.
0x000000010053b08b in builtin_lisp_symbol (index=290)
at ../../master/src/lisp.h:1069
1069 return make_lisp_symbol (lispsym + index);
(gdb) c
Continuing.
Breakpoint 3, handle_sigsegv (sig=11,
siginfo=0x100a3e190 <sigsegv_stack+65232>, arg=0x82de50)
at ../../master/src/sysdep.c:1643
1643 if (!gc_in_progress)
(gdb) l
1638 static void
1639 handle_sigsegv (int sig, siginfo_t *siginfo, void *arg)
1640 {
1641 /* Hard GC error may lead to stack overflow caused by
1642 too nested calls to mark_object. No way to survive. */
1643 if (!gc_in_progress)
1644 {
1645 struct rlimit rlim;
1646
1647 if (!getrlimit (RLIMIT_STACK, &rlim))
(gdb)
1648 {
1649 #ifdef CYGWIN
1650 enum { STACK_DANGER_ZONE = 32 * 1024 };
1651 #else
1652 enum { STACK_DANGER_ZONE = 16 * 1024 };
1653 #endif
1654 char *beg, *end, *addr;
1655
1656 beg = stack_bottom;
1657 end = stack_bottom + stack_direction * rlim.rlim_cur;
(gdb)
1658 if (beg > end)
1659 addr = beg, beg = end, end = addr;
1660 addr = (char *) siginfo->si_addr;
1661 /* If we're somewhere on stack and too close to
1662 one of its boundaries, most likely this is it. */
1663 if (beg < addr && addr < end
1664 && (addr - beg < STACK_DANGER_ZONE
1665 || end - addr < STACK_DANGER_ZONE))
1666 siglongjmp (return_to_command_loop, 1);
1667 }
(gdb) n
1647 if (!getrlimit (RLIMIT_STACK, &rlim))
(gdb)
1656 beg = stack_bottom;
(gdb)
1657 end = stack_bottom + stack_direction * rlim.rlim_cur;
(gdb)
1658 if (beg > end)
(gdb)
1660 addr = (char *) siginfo->si_addr;
(gdb)
1663 if (beg < addr && addr < end
(gdb) p beg
$1 = 0x82ca27 ""
(gdb) p addr
$2 = 0x33ff8 ""
Note that addr < beg, so we never reach the siglongjmp.
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
next prev parent reply other threads:[~2015-07-06 2:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-05 21:48 Corinna Vinschen
2015-07-06 2:15 ` Ken Brown [this message]
2015-07-06 10:02 ` Corinna Vinschen
2015-07-06 13:15 ` Ken Brown
2015-07-06 13:33 ` Ken Brown
2015-07-06 14:52 ` Corinna Vinschen
2015-07-06 14:45 ` Corinna Vinschen
2015-07-06 15:55 ` Ken Brown
2015-07-06 16:34 ` Corinna Vinschen
2015-07-07 15:49 ` Corinna Vinschen
2015-07-07 18:05 ` Ken Brown
2015-07-07 18:49 ` Corinna Vinschen
2015-07-07 19:37 ` Ken Brown
2015-07-08 8:16 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5599E4C5.1010109@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).