Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2013 14:50:01 GMT
From:      AN <andy@neu.net>
To:        gnome@FreeBSD.org
Subject:   Re: ports/177462: graphics/dia: dia-0.97.2,1 fails to start
Message-ID:  <201304091450.r39Eo1E7077227@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/177462; it has been noted by GNATS.

From: AN <andy@neu.net>
To: Golyashov Sergey <svvord@ulona.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/177462: graphics/dia: dia-0.97.2,1 fails to start
Date: Tue, 9 Apr 2013 10:20:05 -0400 (EDT)

 Hi Golyashov:
 
 Thank you for your reply.  I am not a developer, would you please give me 
 exact instructions for how to apply patch.  Can i copy it to the files 
 directory in /usr/ports/grahics/dia?  What should i name the file?
 
 Thanks in advance.
 
 On Tue, 9 Apr 2013, Golyashov Sergey wrote:
 
 >
 > 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) {
 >



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304091450.r39Eo1E7077227>