GNU bug report logs - #16986
Crash when idle

Previous Next

Package: emacs;

Reported by: Simon Carter <bbbscarter <at> gmail.com>

Date: Tue, 11 Mar 2014 11:35:02 UTC

Severity: important

Tags: moreinfo, patch

Merged with 16465, 16794, 16896, 17968

Found in versions 24.3.50, 24.3.92

Fixed in version 24.3.93

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Antipov <dmantipov <at> yandex.ru>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: Simon Carter <bbbscarter <at> gmail.com>, 16986 <at> debbugs.gnu.org
Subject: bug#16986: Fw: Re: Crash when idle
Date: Fri, 01 Aug 2014 12:17:31 +0400
[Message part 1 (text/plain, inline)]
On 07/23/2014 02:09 PM, YAMAMOTO Mitsuharu wrote:

> I suspect there are no direct references to the value of `directory'
> from stack contents or register values, and thus GC triggered by the
> above DECODE_FILE has collected the value of `directory' as a garbage.
> If that is the case, %rax at <+730> (i.e., &XSTRING(directory)->data)
> would become invalid.

Nice shot.

Clang 3.4 with -O2 -g3 generates:

0x0000000000531c21 <+721>:      callq  0x551570 <make_uninit_multibyte_string>
0x0000000000531c26 <+726>:      mov    %rax,%rbp
0x0000000000531c29 <+729>:      mov    0x17(%rbp),%rdi
0x0000000000531c2d <+733>:      mov    0x28(%rsp),%rax
0x0000000000531c32 <+738>:      mov    (%rax),%rsi
0x0000000000531c35 <+741>:      mov    0x38(%rsp),%rdx
0x0000000000531c3a <+746>:      callq  0x413050 <memcpy <at> plt>

GCC 4.8.3 with -O2 -g3 generates:

0x0000000000520e0d <+573>:      callq  0x5407e0 <make_uninit_multibyte_string>
0x0000000000520e12 <+578>:      mov    0x38(%rsp),%rsi
0x0000000000520e17 <+583>:      lea    -0x1(%rax),%r15
0x0000000000520e1b <+587>:      mov    0x20(%rsp),%rdx
0x0000000000520e20 <+592>:      mov    0x18(%r15),%rdi
0x0000000000520e24 <+596>:      mov    %rax,%rbx
0x0000000000520e27 <+599>:      mov    0x18(%rsi),%rsi
0x0000000000520e2b <+603>:      callq  0x413270 <memcpy <at> plt>

With an attached patch, clang generates:

0x0000000000531c01 <+689>:      callq  0x551560 <make_uninit_multibyte_string>
0x0000000000531c06 <+694>:      mov    0x17(%rax),%rdi
0x0000000000531c0a <+698>:      mov    %rax,%rbp
0x0000000000531c0d <+701>:      mov    0x68(%rsp),%rax
0x0000000000531c12 <+706>:      mov    0x17(%rax),%rsi
0x0000000000531c16 <+710>:      mov    0x50(%rsp),%rdx
0x0000000000531c1b <+715>:      callq  0x413050 <memcpy <at> plt>

I.e. with a displacement to %rsi.  OK to install?

Dmitry

[bug16986.patch (text/x-patch, attachment)]

This bug report was last modified 10 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.