unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7082: 24.0.50; Bug in src/doc.c (Fsnarf_documentation)
@ 2010-09-21 14:39 Ari Roponen
  2010-09-21 19:37 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Ari Roponen @ 2010-09-21 14:39 UTC (permalink / raw)
  To: 7082


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@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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#7082: 24.0.50; Bug in src/doc.c (Fsnarf_documentation)
  2010-09-21 14:39 bug#7082: 24.0.50; Bug in src/doc.c (Fsnarf_documentation) Ari Roponen
@ 2010-09-21 19:37 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-09-21 19:37 UTC (permalink / raw)
  To: Ari Roponen; +Cc: 7082-done

Ari Roponen <ari.roponen@gmail.com> writes:

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

Thanks, installed.

Andreas.

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-21 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 14:39 bug#7082: 24.0.50; Bug in src/doc.c (Fsnarf_documentation) Ari Roponen
2010-09-21 19:37 ` Andreas Schwab

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).