all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dov Grobgeld <dov.grobgeld@gmail.com>
To: 11380@debbugs.gnu.org
Subject: bug#11380: emacs compilation fails in call to oblookup() with len=-1
Date: Sun, 29 Apr 2012 20:59:29 +0300	[thread overview]
Message-ID: <CA++fsGFJKS-E8xbt5g79VETDiEm-XMzYPccG7bES5r5UtCpeyQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4624 bytes --]

building emacs crashes in src/doc.c::oblookup() with len=-1. The following
patch solves the problem:

diff --git a/src/doc.c b/src/doc.c
index 9e48a4d..ce54fd2 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -655,41 +655,45 @@ the same file name is found in the `doc-directory'.
*/)
                 }
             }

-      sym = oblookup (Vobarray, p + 2,
-              multibyte_chars_in_text ((unsigned char *) p + 2,
-                           end - p - 2),
-              end - p - 2);
-      /* Check skip_file so that when a function is defined several
-         times in different files (typically, once in xterm, once in
-         w32term, ...), we only pay attention to the one that
-         matters.  */
-      if (! skip_file && SYMBOLP (sym))
-        {
-          /* Attach a docstring to a variable?  */
-          if (p[1] == 'V')
-        {
-          /* Install file-position as variable-documentation property
-             and make it negative for a user-variable
-             (doc starts with a `*').  */
-                  if (!NILP (Fboundp (sym)))
-                    Fput (sym, Qvariable_documentation,
-                          make_number ((pos + end + 1 - buf)
-                                       * (end[1] == '*' ? -1 : 1)));
-        }
-
-          /* Attach a docstring to a function?  */
-          else if (p[1] == 'F')
+          EMACS_INT len = end - p - 2;
+          if (len>0)
+            {
+              sym = oblookup (Vobarray, p + 2,
+                              multibyte_chars_in_text ((unsigned char *) p
+ 2,
+                                                       end - p - 2),
+                              len);
+              /* Check skip_file so that when a function is defined several
+                 times in different files (typically, once in xterm, once
in
+                 w32term, ...), we only pay attention to the one that
+                 matters.  */
+              if (! skip_file && SYMBOLP (sym))
                 {
-                  if (!NILP (Ffboundp (sym)))
-                    store_function_docstring (sym, pos + end + 1 - buf);
+                  /* Attach a docstring to a variable?  */
+                  if (p[1] == 'V')
+                    {
+                      /* Install file-position as variable-documentation
property
+                         and make it negative for a user-variable
+                         (doc starts with a `*').  */
+                      if (!NILP (Fboundp (sym)))
+                        Fput (sym, Qvariable_documentation,
+                              make_number ((pos + end + 1 - buf)
+                                           * (end[1] == '*' ? -1 : 1)));
+                    }
+
+                  /* Attach a docstring to a function?  */
+                  else if (p[1] == 'F')
+                    {
+                      if (!NILP (Ffboundp (sym)))
+                        store_function_docstring (sym, pos + end + 1 -
buf);
+                    }
+                  else if (p[1] == 'S')
+                    ; /* Just a source file name boundary marker.  Ignore
it.  */
+
+                  else
+                    error ("DOC file invalid at position %"pI"d", pos);
                 }
-          else if (p[1] == 'S')
-        ; /* Just a source file name boundary marker.  Ignore it.  */
-
-          else
-        error ("DOC file invalid at position %"pI"d", pos);
-        }
-    }
+            }
+      }
       pos += end - buf;
       filled -= end - buf;
       memmove (buf, end, filled);

Regards,
Dov

On Sun, Apr 29, 2012 at 20:41, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:

> Chucking out git head (git commit e3e392d from git://repo.or.cz/emacs.git)
> and doing a debug build as described below
> fails. The compilation looks for the non-existing file "chkmalloc.h".
>
> Here are the steps that I performed:
>
>   ./autogen.sh
>   ./configure --prefix=/usr/local/public-dev/ CPPFLAGS=-DDEBUG CFLAGS="-g
> -O0"
>   make
>
> which fails as follows:
>
> gcc -std=gnu99     -DHAVE_CONFIG_H -I. -I../src -I../lib
> -I/space/pub-repos/emacs.git/lib-src
> -I/space/pub-repos/emacs.git/lib-src/../src
> -I/space/pub-repos/emacs.git/lib-src/../lib  -Wl,-znocombreloc  -DDEBUG -g
> -O0 -DEMACS_NAME="\"GNU Emacs\"" \
>   -DVERSION="\"24.1.50\"" /space/pub-repos/emacs.git/lib-src/etags.c \
>   regex.o ../lib/libgnu.a  -o etags
> /space/pub-repos/emacs.git/lib-src/etags.c:233:24: fatal error:
> chkmalloc.h: No such file or directory
>
> System is: Linux grower 3.3.2-6.fc16.i686 #1 SMP Sat Apr 21 13:23:12 UTC
> 2012 i686 i686 i386 GNU/Linux
>
> Regards,
> Dov
>
>

[-- Attachment #2: Type: text/html, Size: 6733 bytes --]

             reply	other threads:[~2012-04-29 17:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-29 17:59 Dov Grobgeld [this message]
2012-04-29 18:13 ` bug#11380: emacs compilation fails in call to oblookup() with len=-1 Andreas Schwab
2012-04-29 18:41   ` Dov Grobgeld
2012-04-29 20:09     ` Andreas Schwab
2012-04-29 20:59     ` Eli Zaretskii
2012-04-30  5:06       ` Dov Grobgeld

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=CA++fsGFJKS-E8xbt5g79VETDiEm-XMzYPccG7bES5r5UtCpeyQ@mail.gmail.com \
    --to=dov.grobgeld@gmail.com \
    --cc=11380@debbugs.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.