ports/177462: graphics/dia: dia-0.97.2,1 fails to start

Golyashov Sergey svvord at ulona.org
Tue Apr 9 07:00:03 UTC 2013


The following reply was made to PR ports/177462; it has been noted by GNATS.

From: Golyashov Sergey <svvord at ulona.org>
To: bug-followup at freebsd.org, andy at neu.net
Cc:  
Subject: Re: ports/177462: graphics/dia: dia-0.97.2,1 fails to start
Date: Tue, 09 Apr 2013 17:55:45 +1100

 Backtrace from [work dia]/objects/custom/shape_typeinfo.c:shape_typeinfo_load -> g_fopen -> fopen
 
 /usr/src/lib/libc/stdio/fopen.c:
 <<<===
 (gdb) n
 99      }
 (gdb) l
 94               * fseek and ftell.)
 95               */
 96              if (oflags & O_APPEND)
 97                      (void)_sseek(fp, (fpos_t)0, SEEK_END);
 98              return (fp);
 99      }
 (gdb) print fp
 $17 = (FILE *) 0x807eb0740
 (gdb) n
 shape_typeinfo_load (info=0x80a3ead00) at shape_typeinfo.c:200
 200       if (!f)
 (gdb) print f
 $18 = (FILE *) 0x7eb0740
 ===>>>
 
 fopen return (FILE *) 0x807eb0740 but g_fopen return (FILE *) 0x7eb0740
 
 So after call fread:
 
 Program received signal SIGSEGV, Segmentation fault.
 __fread (buf=0x7fffffffce20, size=512, count=1, fp=0x7eb0740) at /usr/src/lib/libc/stdio/fread.c:95
 95              ORIENT(fp, -1);
 
 This patch solves problem for me:
 
 --- objects/custom/shape_typeinfo.c.orig	2013-04-09 01:48:15.838095782 +1100
 +++ objects/custom/shape_typeinfo.c	2013-04-09 16:21:37.840874850 +1100
 @@ -196,7 +195,7 @@
      saxHandler.warning = _warning;
      once = TRUE;
    }
 -  f = g_fopen (info->filename, "rb");
 +  f = fopen (info->filename, "rb");
    if (!f)
      return FALSE;
    while ((n = fread (buffer, 1, BLOCKSIZE, f)) > 0) {
 


More information about the freebsd-gnome mailing list