* bug#11380: emacs compilation fails in call to oblookup() with len=-1
@ 2012-04-29 17:59 Dov Grobgeld
2012-04-29 18:13 ` Andreas Schwab
0 siblings, 1 reply; 6+ messages in thread
From: Dov Grobgeld @ 2012-04-29 17:59 UTC (permalink / raw)
To: 11380
[-- 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 --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#11380: emacs compilation fails in call to oblookup() with len=-1
2012-04-29 17:59 bug#11380: emacs compilation fails in call to oblookup() with len=-1 Dov Grobgeld
@ 2012-04-29 18:13 ` Andreas Schwab
2012-04-29 18:41 ` Dov Grobgeld
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2012-04-29 18:13 UTC (permalink / raw)
To: Dov Grobgeld; +Cc: 11380
Dov Grobgeld <dov.grobgeld@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@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] 6+ messages in thread
* bug#11380: emacs compilation fails in call to oblookup() with len=-1
2012-04-29 18:13 ` Andreas Schwab
@ 2012-04-29 18:41 ` Dov Grobgeld
2012-04-29 20:09 ` Andreas Schwab
2012-04-29 20:59 ` Eli Zaretskii
0 siblings, 2 replies; 6+ messages in thread
From: Dov Grobgeld @ 2012-04-29 18:41 UTC (permalink / raw)
To: Andreas Schwab; +Cc: 11380
[-- Attachment #1: Type: text/plain, Size: 5926 bytes --]
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@linux-m68k.org> wrote:
> Dov Grobgeld <dov.grobgeld@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@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>
[-- Attachment #2: Type: text/html, Size: 7865 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-04-30 5:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-29 17:59 bug#11380: emacs compilation fails in call to oblookup() with len=-1 Dov Grobgeld
2012-04-29 18:13 ` 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
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.