GNU bug report logs - #11380
emacs compilation fails in call to oblookup() with len=-1

Previous Next

Package: emacs;

Reported by: Dov Grobgeld <dov.grobgeld <at> gmail.com>

Date: Sun, 29 Apr 2012 18:02:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11380 in the body.
You can then email your comments to 11380 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11380; Package emacs. (Sun, 29 Apr 2012 18:02:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dov Grobgeld <dov.grobgeld <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 29 Apr 2012 18:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dov Grobgeld <dov.grobgeld <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: emacs compilation fails in call to oblookup() with len=-1
Date: Sun, 29 Apr 2012 20:59:29 +0300
[Message part 1 (text/plain, inline)]
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 <at> 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
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11380; Package emacs. (Sun, 29 Apr 2012 18:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 11380 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Dov Grobgeld <dov.grobgeld <at> gmail.com>
Cc: 11380 <at> debbugs.gnu.org
Subject: Re: bug#11380: emacs compilation fails in call to oblookup() with
	len=-1
Date: Sun, 29 Apr 2012 20:13:50 +0200
Dov Grobgeld <dov.grobgeld <at> gmail.com> writes:

> building emacs crashes in src/doc.c::oblookup() with len=-1.

That cannot happen unless make-docfile is broken.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11380; Package emacs. (Sun, 29 Apr 2012 18:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 11380 <at> debbugs.gnu.org (full text, mbox):

From: Dov Grobgeld <dov.grobgeld <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 11380 <at> debbugs.gnu.org
Subject: Re: bug#11380: emacs compilation fails in call to oblookup() with
	len=-1
Date: Sun, 29 Apr 2012 21:41:06 +0300
[Message part 1 (text/plain, inline)]
All I know is that this happened by the following steps:

1. git clone from  git://repo.or.cz/emacs.git commit e3e392d
2. Apply the following patch, (a compilation in debug mode workaround that
I reported in a different bug report):

diff --git a/lib-src/etags.c b/lib-src/etags.c
index c88473a..8e8fd8b 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -229,7 +229,7 @@ If you want regular expression support, you should
delete this notice and
  * SYNOPSIS:   Type *xnew (int n, Type);
  *             void xrnew (OldPointer, int n, Type);
  */
-#if DEBUG
+#if 0
 # include "chkmalloc.h"
 # define xnew(n,Type)    ((Type *) trace_malloc (__FILE__, __LINE__, \
                                                  (n) * sizeof (Type)))

3. configure and make by the following steps:

./autogen.sh
./configure --prefix=/usr/local/public-dev/ CPPFLAGS=-DDEBUG CFLAGS="-g
-O0"

which output:

Configured for `i686-pc-linux-gnu'.

  Where should the build process find the source code?
/space/pub-repos/emacs.git
  What operating system and machine description files should Emacs use?
        `s/gnu-linux.h'
  What compiler should emacs be built with?               gcc -std=gnu99 -g
-O0
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          GTK
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use -lpng?                                   yes
  Does Emacs use -lrsvg-2?                                yes
  Does Emacs use imagemagick?                             yes
  Does Emacs use -lgpm?                                   yes
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 yes
  Does Emacs use GSettings?                               yes
  Does Emacs use -lselinux?                               yes
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use -lm17n-flt?                              yes
  Does Emacs use -lotf?                                   yes
  Does Emacs use -lxft?                                   yes
  Does Emacs use toolkit scroll bars?                     yes

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

Here is a stacktrace of the crash:

#0  0x08200062 in hash_string (ptr=0xbfffe8db "(defalias
'save-selected-window '(macro . #[(&rest body)\037Fwindow-right\nReturn
WINDOW's right sibling.\nReturn nil if WINDOW is the root window of its
frame.  WINDOW can\nbe any window.\037Fwindow-left\nRetu"..., len=-1) at
fns.c:4116
#1  0x0821b647 in oblookup (obarray=139216261, ptr=0xbfffe8db "(defalias
'save-selected-window '(macro . #[(&rest body)\037Fwindow-right\nReturn
WINDOW's right sibling.\nReturn nil if WINDOW is the root window of its
frame.  WINDOW can\nbe any window.\037Fwindow-left\nRetu"..., size=0,
size_byte=-1) at lread.c:3906
#2  0x081e1b9e in Fsnarf_documentation (filename=139966033) at doc.c:658
#3  0x081f2779 in eval_sub (form=142566062) at eval.c:2283
#4  0x081ef753 in Fprogn (args=142562518) at eval.c:364
#5  0x081f08f9 in Flet (args=142574270) at eval.c:1053
#6  0x081f252c in eval_sub (form=142574310) at eval.c:2231
#7  0x081ef692 in Fif (args=142574342) at eval.c:314
#8  0x081f252c in eval_sub (form=142576646) at eval.c:2231
#9  0x08217a32 in readevalloop (readcharfun=139290210, stream=0x84edfb0,
sourcename=139299913, printflag=0, unibyte=139222370, readfun=139222370,
start=139222370, end=139222370) at lread.c:1837
#10 0x08216a15 in Fload (file=139299785, noerror=139222370,
nomessage=139222370, nosuffix=139222370, must_suffix=139222370) at
lread.c:1315
#11 0x081f284d in eval_sub (form=139201958) at eval.c:2297
#12 0x081f227d in Feval (form=139201958, lexical=139222370) at eval.c:2137
#13 0x0816dd7c in top_level_2 () at keyboard.c:1169
#14 0x081f1122 in internal_condition_case (bfun=0x816dd5f <top_level_2>,
handlers=139253426, hfun=0x816d9b9 <cmd_error>) at eval.c:1448
#15 0x0816ddb0 in top_level_1 (ignore=139222370) at keyboard.c:1177
#16 0x081f0bf4 in internal_catch (tag=139251378, func=0x816dd7e
<top_level_1>, arg=139222370) at eval.c:1205
#17 0x0816dce6 in command_loop () at keyboard.c:1132
#18 0x0816d5f2 in recursive_edit_1 () at keyboard.c:759
#19 0x0816d743 in Frecursive_edit () at keyboard.c:823
#20 0x0816bbc9 in main (argc=5, argv=0xbffff8e4) at emacs.c:1711

Lisp Backtrace:
"Snarf-documentation" (0xbfffebb4)
"let" (0xbfffedcc)
"if" (0xbfffeeec)
"load" (0xbffff164)


Regards,
Dov


On Sun, Apr 29, 2012 at 21:13, Andreas Schwab <schwab <at> linux-m68k.org> wrote:

> Dov Grobgeld <dov.grobgeld <at> gmail.com> writes:
>
> > building emacs crashes in src/doc.c::oblookup() with len=-1.
>
> That cannot happen unless make-docfile is broken.
>
> 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 2 (text/html, inline)]

Reply sent to Andreas Schwab <schwab <at> linux-m68k.org>:
You have taken responsibility. (Sun, 29 Apr 2012 20:11:01 GMT) Full text and rfc822 format available.

Notification sent to Dov Grobgeld <dov.grobgeld <at> gmail.com>:
bug acknowledged by developer. (Sun, 29 Apr 2012 20:11:01 GMT) Full text and rfc822 format available.

Message #16 received at 11380-done <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Dov Grobgeld <dov.grobgeld <at> gmail.com>
Cc: 11380-done <at> debbugs.gnu.org
Subject: Re: bug#11380: emacs compilation fails in call to oblookup() with
	len=-1
Date: Sun, 29 Apr 2012 22:09:08 +0200
As I said this can only happen if make-docfile is broken, which it was.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11380; Package emacs. (Sun, 29 Apr 2012 21:01:01 GMT) Full text and rfc822 format available.

Message #19 received at 11380 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dov Grobgeld <dov.grobgeld <at> gmail.com>
Cc: 11380 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#11380: emacs compilation fails in call to oblookup() with
	len=-1
Date: Sun, 29 Apr 2012 23:59:23 +0300
> Date: Sun, 29 Apr 2012 21:41:06 +0300
> From: Dov Grobgeld <dov.grobgeld <at> gmail.com>
> Cc: 11380 <at> debbugs.gnu.org
> 
> 3. configure and make by the following steps:
> 
> ./autogen.sh
> ./configure --prefix=/usr/local/public-dev/ CPPFLAGS=-DDEBUG CFLAGS="-g
> -O0"

Why are you compiling with -DDEBUG?  That does nothing useful.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11380; Package emacs. (Mon, 30 Apr 2012 05:09:02 GMT) Full text and rfc822 format available.

Message #22 received at 11380 <at> debbugs.gnu.org (full text, mbox):

From: Dov Grobgeld <dov.grobgeld <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 11380 <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#11380: emacs compilation fails in call to oblookup() with
	len=-1
Date: Mon, 30 Apr 2012 08:06:38 +0300
[Message part 1 (text/plain, inline)]
I see. My wrong assumption. But if it is not used, shouldn't all references
to #ifdef DEBUG be erased in the source?

Dov

On Sun, Apr 29, 2012 at 23:59, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sun, 29 Apr 2012 21:41:06 +0300
> > From: Dov Grobgeld <dov.grobgeld <at> gmail.com>
> > Cc: 11380 <at> debbugs.gnu.org
> >
> > 3. configure and make by the following steps:
> >
> > ./autogen.sh
> > ./configure --prefix=/usr/local/public-dev/ CPPFLAGS=-DDEBUG CFLAGS="-g
> > -O0"
>
> Why are you compiling with -DDEBUG?  That does nothing useful.
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 May 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 22 days ago.

Previous Next


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