GNU bug report logs - #7082
24.0.50; Bug in src/doc.c (Fsnarf_documentation)

Previous Next

Package: emacs;

Reported by: Ari Roponen <ari.roponen <at> gmail.com>

Date: Tue, 21 Sep 2010 14:38:02 UTC

Severity: normal

Found in version 24.0.50

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ari Roponen <ari.roponen <at> gmail.com>
Subject: bug#7082: closed (Re: bug#7082: 24.0.50; Bug in src/doc.c
 (Fsnarf_documentation))
Date: Tue, 21 Sep 2010 19:35:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#7082: 24.0.50; Bug in src/doc.c (Fsnarf_documentation)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 7082 <at> debbugs.gnu.org.

-- 
7082: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7082
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Ari Roponen <ari.roponen <at> gmail.com>
Cc: 7082-done <at> debbugs.gnu.org
Subject: Re: bug#7082: 24.0.50; Bug in src/doc.c (Fsnarf_documentation)
Date: Tue, 21 Sep 2010 21:37:29 +0200
Ari Roponen <ari.roponen <at> gmail.com> writes:

> 2010-09-21  Ari Roponen  <ari.roponen <at> gmail.com>  (tiny change)
>
> 	* doc.c (Fsnarf_documentation): Use memmove instead of memcpy as
> 	the regions may overlap.

Thanks, installed.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

[Message part 3 (message/rfc822, inline)]
From: Ari Roponen <ari.roponen <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; Bug in src/doc.c (Fsnarf_documentation)
Date: Tue, 21 Sep 2010 17:39:31 +0300
Hi,

recently compiling Emacs has not worked for me. The compilation always
aborts with this error:

  Loading emacs-lisp/float-sup...
  Loading vc/vc-hooks...
  Loading vc/ediff-hook...
  Loading tooltip...
  Finding pointers to doc strings...
  /bin/sh: line 8: 10391 Segmentation fault      (core dumped) LC_ALL=C `/bin/pwd`/temacs -batch -l loadup dump
  make[1]: *** [emacs] Error 1
  make[1]: Leaving directory `/usr/local/repos/emacs.git/src'
  make: *** [src] Error 2

After some debugging, I may have found the cause. I added an assert to
Fsnarf_documentation in src/doc.c just before the memcpy and it failed:

  Assertion `buf + filled < end' failed.

This means we should use memmove instead, as it can handle overlapping
regions properly.


2010-09-21  Ari Roponen  <ari.roponen <at> gmail.com>  (tiny change)

	* doc.c (Fsnarf_documentation): Use memmove instead of memcpy as
	the regions may overlap.


diff --git a/src/doc.c b/src/doc.c
index f8ab9d0..36f7c0e 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -678,7 +678,7 @@ the same file name is found in the `doc-directory'.  */)
 	}
       pos += end - buf;
       filled -= end - buf;
-      memcpy (buf, end, filled);
+      memmove (buf, end, filled);
     }
   emacs_close (fd);
   return Qnil;


In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.90.5)
 of 2010-09-21 on arirop
Windowing system distributor `Fedora Project', version 11.0.10899905
configured using `configure  '--with-x-toolkit=gtk3' '--with-imagemagick''

-- 
Ari Roponen



This bug report was last modified 14 years and 302 days ago.

Previous Next


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