emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Commit "Omit unused frame argument of font API's close function." breaks


From: Claudio Bley
Subject: Commit "Omit unused frame argument of font API's close function." breaks build and segfaults
Date: Fri, 25 Oct 2013 10:57:36 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 Emacs/24.3.50 (i686-pc-mingw32) MULE/6.0 (HANACHIRUSATO)

Hi.

Since commit address@hidden I receive these build failures:

gcc  -std=gnu99 -c -mtune=pentium4  
-I/c/Users/Claudio/src/emacs-dep/stage/include -DUSE_CRT_DLL=1 -I 
/c/Users/Claudio/build/emacs-w32/../../src/emacs/nt/inc -Demacs  -I. 
-I../../../src/emacs/src -I../lib -I../../../src/emacs/src/../lib  
-mtune=pentium4      -Ic:/Users/Claudio/src/emacs-dep/stage/include/libxml2     
      -MMD -MF deps/w32font.d -MP 
-Ic:/Users/Claudio/src/emacs-dep/stage/include 
-IC:/Users/Claudio/src/emacs-dep/stage/include      -g3 -O2 -gdwarf-2  
../../../src/emacs/src/w32font.c
../../../src/emacs/src/w32font.c:381:1: error: conflicting types for 
'w32font_close'
In file included from ../../../src/emacs/src/w32font.c:35:0:
../../../src/emacs/src/w32font.h:75:6: note: previous declaration of 
'w32font_close' was here
../../../src/emacs/src/w32font.c: In function 'w32font_close':
../../../src/emacs/src/w32font.c:394:9: error: 'i' undeclared (first use in 
this function)
../../../src/emacs/src/w32font.c:394:9: note: each undeclared identifier is 
reported only once for each function it appears in
make[1]: *** [w32font.o] Error 1
gcc  -std=gnu99 -c -mtune=pentium4  
-I/c/Users/Claudio/src/emacs-dep/stage/include -DUSE_CRT_DLL=1 -I 
/c/Users/Claudio/build/emacs-w32/../../src/emacs/nt/inc -Demacs  -I. 
-I../../../src/emacs/src -I../lib -I../../../src/emacs/src/../lib  
-mtune=pentium4      -Ic:/Users/Claudio/src/emacs-dep/stage/include/libxml2     
      -MMD -MF deps/w32term.d -MP 
-Ic:/Users/Claudio/src/emacs-dep/stage/include 
-IC:/Users/Claudio/src/emacs-dep/stage/include      -g3 -O2 -gdwarf-2  
../../../src/emacs/src/w32term.c
gcc  -std=gnu99 -c -mtune=pentium4  
-I/c/Users/Claudio/src/emacs-dep/stage/include -DUSE_CRT_DLL=1 -I 
/c/Users/Claudio/build/emacs-w32/../../src/emacs/nt/inc -Demacs  -I. 
-I../../../src/emacs/src -I../lib -I../../../src/emacs/src/../lib  
-mtune=pentium4      -Ic:/Users/Claudio/src/emacs-dep/stage/include/libxml2     
      -MMD -MF deps/w32uniscribe.d -MP 
-Ic:/Users/Claudio/src/emacs-dep/stage/include 
-IC:/Users/Claudio/src/emacs-dep/stage/include      -g3 -O2 -gdwarf-2  
../../../src/emacs/src/w32uniscribe.c
../../../src/emacs/src/w32uniscribe.c:975:5: warning: initialization from 
incompatible pointer type [enabled by default]
../../../src/emacs/src/w32uniscribe.c:975:5: warning: (near initialization for 
'uniscribe_font_driver.sys_close') [enabled by default]

After fixing it that way:

---- 8< ----------------------- >8 -----------------------------------1
diff --git a/src/w32font.c b/src/w32font.c
index dd21aca..d308a09 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -391,6 +391,7 @@ w32font_close (struct font *font)
       /* Free all the cached metrics.  */
       if (w32_font->cached_metrics)
        {
+    int i;
          for (i = 0; i < w32_font->n_cache_blocks; i++)
              xfree (w32_font->cached_metrics[i]);
          xfree (w32_font->cached_metrics);
diff --git a/src/w32font.h b/src/w32font.h
index 5622086..1991492 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -72,7 +72,7 @@ Lisp_Object w32font_match_internal (struct frame *f,
                                     int opentype_only);
 int w32font_open_internal (struct frame *f, Lisp_Object font_entity,
                            int pixel_size, Lisp_Object font_object);
-void w32font_close (struct frame *f, struct font *font);
+void w32font_close (struct font *font);
 int w32font_has_char (Lisp_Object entity, int c);
 int w32font_text_extents (struct font *font, unsigned *code, int nglyphs,
                           struct font_metrics *metrics);
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index b31baa0..d8873da 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -143,7 +143,7 @@ uniscribe_close (struct frame *f, struct font *font)
   if (uniscribe_font->cache)
     ScriptFreeCache (&(uniscribe_font->cache));

-  w32font_close (f, font);
+  w32font_close (font);
 }

 /* Return a list describing which scripts/languages FONT supports by
------ 8< ----------------------- >8 ---------------------------------

"emacs -Q" segfaults when starting:

Program received signal SIGSEGV, Segmentation fault.
_free_internal_nolock (ptr=0x39b4) at ../../../src/emacs/src/gmalloc.c:1056
1056              _heapinfo[block].free.size = _heapinfo[block].busy.info.size;
(gdb) bt
#0  _free_internal_nolock (ptr=0x39b4)
    at ../../../src/emacs/src/gmalloc.c:1056
#1  0x011515c6 in w32font_close (
    font=0x3c52de0 <_Jv_RegisterClasses+63253984>)
    at ../../../src/emacs/src/w32font.c:396
#2  0x010da0fa in cleanup_vector (vector=<optimized out>)
    at ../../../src/emacs/src/alloc.c:2850
#3  cleanup_vector (vector=<optimized out>)
    at ../../../src/emacs/src/alloc.c:2845
#4  0x010de0de in sweep_vectors () at ../../../src/emacs/src/alloc.c:2899
#5  gc_sweep () at ../../../src/emacs/src/alloc.c:6591
#6  Fgarbage_collect () at ../../../src/emacs/src/alloc.c:5514
#7  0x010f28af in maybe_gc () at ../../../src/emacs/src/lisp.h:4385
#8  eval_sub (address@hidden) at ../../../src/emacs/src/eval.c:2058
#9  0x01112662 in readevalloop (readcharfun=61379210,
    address@hidden, sourcename=62442305,
    address@hidden, address@hidden,
    unibyte=61261850, readfun=61261850, start=61261850, end=61261850)
    at ../../../src/emacs/src/lread.c:1876
#10 0x01113282 in Fload (file=18899409, address@hidden,
    address@hidden, nosuffix=61261850,
    must_suffix=<optimized out>, address@hidden)
    at ../../../src/emacs/src/lread.c:1352
#11 0x010f4c6a in Fautoload_do_load (fundef=18899470,
    address@hidden, macro_only=61261850)
    at ../../../src/emacs/src/eval.c:1944
#12 0x010f34ac in Ffuncall (nargs=2, args=0x88f12c)
    at ../../../src/emacs/src/eval.c:2853
#13 0x01123b63 in exec_byte_code (bytestr=1231, vector=68055616, maxdepth=20,
    args_template=61261850, nargs=0, args=0x2)
    at ../../../src/emacs/src/bytecode.c:919
#14 0x010f3225 in funcall_lambda (fun=19172141, address@hidden,
    address@hidden)
[43 frames omitted]

-- 
Claudio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]