From: Fabrice Popineau <fabrice.popineau@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 22526@debbugs.gnu.org, andrewjmoreton@gmail.com
Subject: bug#22526: 25.0.90; Crash starting gnus
Date: Sat, 13 Feb 2016 17:08:07 +0100 [thread overview]
Message-ID: <CAFgFV9Oe62FhC4Vm4fUoSE+1riHoVjz85QtyAct6jJeYyirPVw@mail.gmail.com> (raw)
In-Reply-To: <83vb5s6gas.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]
Sorry for the delay with my answer, I'm trying to catch up with this
problem.
First, and about the patch Eli has offered for mmap_realloc(), I would be
interested in knowing
what was the error code at line 718:
DebPrint (("realloc enlarge: VirtualAlloc error %ld\n",
GetLastError ()));
I wonder if there is a case where it would fail on the VirtualAlloc() and
manage with the mmap_alloc() later.
I agree than in the case of a failure with VirtualAlloc(), we don't return
NULL here, which may be the root
of further problems.
Second, I don't see the problem in mmap_alloc(): if VirtualAlloc() fails, p
is NULL and this is the value returned
at line 668:
return *var = p;
Am I missing something here ?
Fabrice
2016-02-13 11:44 GMT+01:00 Eli Zaretskii <eliz@gnu.org>:
> > Date: Sat, 13 Feb 2016 10:28:37 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: 22526@debbugs.gnu.org
> >
> > FWIW, I'm not really sure that patch will fix the problem, for 2
> > reasons: (1) the code it fixes should only get executed very rarely,
> > if ever; and (2) according to my reading of gap_left, it should have
> > touched these addresses just before hitting the segfault. So I
> > believe there's some other factor at work here I cannot figure out.
>
> Answering my own question: #2 above can happen if the gap was already
> at the end of buffer text -- in that case, gap_left does nothing
> except update the gap position. The values shown in one of the
> previous backtraces indicate this is indeed what happened here. And
> in that case, line 411 of insdel.c is indeed the first one where the
> additional memory allocated by enlarge_buffer_text is touched.
>
> So it looks like the problem is indeed somewhere in w32heap.c.
>
> Btw, I see in mmap_malloc a problem similar to the one I tried to fix
> with the patch for mmap_realloc: if the call to VirtualAlloc that
> commits the reserved memory fails, mmap_malloc won't return NULL as it
> should.
>
> AFAIU, failure to commit reserved memory could happen if the system is
> short on physical memory. Are there other reasons?
>
[-- Attachment #2: Type: text/html, Size: 2982 bytes --]
next prev parent reply other threads:[~2016-02-13 16:08 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 22:13 bug#22526: 25.0.90; Crash starting gnus Andy Moreton
2016-02-07 5:42 ` Lars Ingebrigtsen
2016-02-07 16:00 ` Eli Zaretskii
2016-02-07 20:58 ` Andy Moreton
2016-02-07 21:05 ` Eli Zaretskii
2016-02-11 2:06 ` Andy Moreton
2016-02-11 20:27 ` Eli Zaretskii
2016-02-11 21:20 ` Andy Moreton
2016-02-11 21:26 ` Eli Zaretskii
2016-02-12 13:34 ` Andy Moreton
2016-02-12 16:16 ` Eli Zaretskii
2016-02-12 22:26 ` Andy Moreton
2016-02-13 8:28 ` Eli Zaretskii
2016-02-13 10:44 ` Eli Zaretskii
2016-02-13 16:08 ` Fabrice Popineau [this message]
2016-02-13 16:42 ` Eli Zaretskii
2016-02-13 21:35 ` Fabrice Popineau
2016-02-13 22:11 ` Eli Zaretskii
2016-02-13 23:44 ` Fabrice Popineau
2016-02-14 5:49 ` Eli Zaretskii
2016-02-14 9:05 ` Fabrice Popineau
2016-02-14 16:57 ` Eli Zaretskii
2016-02-14 5:41 ` Eli Zaretskii
2016-02-14 14:17 ` Andy Moreton
2016-02-14 16:55 ` Eli Zaretskii
2016-02-14 17:51 ` Eli Zaretskii
2016-02-14 21:04 ` Fabrice Popineau
2016-02-14 21:29 ` Eli Zaretskii
2016-02-14 21:31 ` Fabrice Popineau
2016-02-14 21:34 ` Eli Zaretskii
2016-02-14 21:41 ` Fabrice Popineau
2016-02-15 3:32 ` Eli Zaretskii
2016-02-15 8:09 ` Fabrice Popineau
2016-02-15 11:39 ` Eli Zaretskii
2016-02-13 15:16 ` Andy Moreton
2016-02-13 15:52 ` Eli Zaretskii
2016-02-13 21:26 ` Andy Moreton
2016-02-16 1:18 ` Andy Moreton
2016-02-16 3:46 ` Eli Zaretskii
2016-02-20 11:08 ` Eli Zaretskii
2016-02-20 16:17 ` Andy Moreton
2016-02-20 17:01 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFgFV9Oe62FhC4Vm4fUoSE+1riHoVjz85QtyAct6jJeYyirPVw@mail.gmail.com \
--to=fabrice.popineau@gmail.com \
--cc=22526@debbugs.gnu.org \
--cc=andrewjmoreton@gmail.com \
--cc=eliz@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).