After upgrading gd-2.0.35_9,1 to the libgd-2.1.0,1 a definition of internal GD structure gdFontSmall is missed, and as a consequence some applications now gets a segmentation fault (e.g. MRTG). How-To-Repeat: Just a little demo for this bug: #include <gd.h> #include <gdfonts.h> int main() { printf("gdFontSmall: %p\n", gdFontSmall); printf("gdFontSmall-w: %d\n", gdFontSmall->w); return 0; } For gd-2.0.35_9,1 it print: gdFontSmall: 0x80076af80 gdFontSmall-w: 6 For libgd-2.1.0,1 it print: gdFontSmall: 0x0 Segmentation fault(core dumped)
Responsible Changed From-To: freebsd-ports-bugs->dinoex Over to maintainer (via the GNATS Auto Assign Tool)
State Changed From-To: open->feedback I can not reproduce your problem. Please deinstall libgd. and rebuild gd and all apps depending on it. clean jail: # pkg_add /usr/ports/packages9-amd64/All/libgd-2.1.0,1.tbz # pkg_version -v expat-2.1.0 = up-to-date with port fontconfig-2.10.93,1 = up-to-date with port freetype2-2.4.12_1 = up-to-date with port jbigkit-1.6 = up-to-date with port jpeg-8_4 = up-to-date with port libgd-2.1.0,1 = up-to-date with port png-1.5.17 = up-to-date with port tiff-4.0.3 = up-to-date with port # make bug-gd CFLAGS=-I/usr/local/include LDFLAGS="-L/usr/local/lib -lgd" # ldd ./bug-gd ./bug-gd: libgd.so.5 => /usr/local/lib/libgd.so.5 (0x80081a000) libc.so.7 => /lib/libc.so.7 (0x800a7c000) libjpeg.so.11 => /usr/local/lib/libjpeg.so.11 (0x800dda000) libz.so.6 => /lib/libz.so.6 (0x801011000) libm.so.5 => /lib/libm.so.5 (0x801225000) libpng15.so.15 => /usr/local/lib/libpng15.so.15 (0x801447000) libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x801675000) libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1 (0x801904000) libtiff.so.4 => /usr/local/lib/libtiff.so.4 (0x801b3d000) libthr.so.3 => /lib/libthr.so.3 (0x801dad000) libbz2.so.4 => /usr/lib/libbz2.so.4 (0x801fd1000) libexpat.so.6 => /usr/local/lib/libexpat.so.6 (0x8021e1000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x802405000) libjbig.so.1 => /usr/local/lib/libjbig.so.1 (0x802629000) # ./bug-gd gdFontSmall: 0x800a779e0 gdFontSmall-w: 6
Hello! I found a cause of a problem, it's a GD_FONTS variable set in my make.conf. If it set, bug-gd get segfaulted; if it commented out, bug-gd runs successfully. Can you confirm this bug by setting GD_FONTS in your building environment? I attached file with font I use to this letter. I'm using russian BDF font with GD lib for many years, so I hope this bug can be solved without renunciation of GD_FONTS variable. -- WBR, Alexey Markov.
BTW, the same problem exists for russian/gd and ukrainian/gd ports which uses x11-fonts/geminifonts. -- WBR, Alexey Markov.
Probably I have found a hint to solve this problem. It seems that gdfont[glst].[ch] file format slightly changed in the 2.1 branch of libgd. After pre-build stage I have made following changes in that files: 1. Add 'extern ' before 'BGD_EXPORT_DATA_PROT gdFontPtr' in the *.h files of fonts 2. Change BGD_EXPORT_DATA_IMPL to BGD_EXPORT_DATA_PROT in the *.c files of fonts 3. Add that three lines: #ifdef HAVE_CONFIG_H #include "config.h" #endif in the beginning of the *.c files of fonts After that libgd successfuly built with custom fonts and all depended applications (including MRTG) runs without segfaults. -- WBR, Alexey Markov.
This is a _partial_ patch for Makefile: I still can't figure out how to add three lines to the font files by standard Makefile means. -- WBR, Alexey Markov.
Author: dinoex Date: Thu Aug 15 19:12:46 2013 New Revision: 324782 URL: http://svnweb.freebsd.org/changeset/ports/324782 Log: - fix option GD_FONTS - fix bdftogd and bump PORTREVISION PR: 181250 Modified: head/graphics/gd/Makefile head/graphics/gd/files/patch-bdftogd Modified: head/graphics/gd/Makefile ============================================================================== --- head/graphics/gd/Makefile Thu Aug 15 19:02:34 2013 (r324781) +++ head/graphics/gd/Makefile Thu Aug 15 19:12:46 2013 (r324782) @@ -3,7 +3,7 @@ PORTNAME= libgd PORTVERSION= 2.1.0 -PORTREVISION?= 0 +PORTREVISION?= 1 PORTEPOCH= 1 CATEGORIES+= graphics MASTER_SITES= http://cdn.bitbucket.org/libgd/gd-libgd/downloads/ Modified: head/graphics/gd/files/patch-bdftogd ============================================================================== --- head/graphics/gd/files/patch-bdftogd Thu Aug 15 19:02:34 2013 (r324781) +++ head/graphics/gd/files/patch-bdftogd Thu Aug 15 19:12:46 2013 (r324782) @@ -1,5 +1,5 @@ --- src/bdftogd.orig 2013-06-25 11:58:23.000000000 +0200 -+++ src/bdftogd 2013-08-01 07:06:11.000000000 +0200 ++++ src/bdftogd 2013-08-15 21:03:29.000000000 +0200 @@ -24,6 +24,9 @@ my $filename = shift; $filename = 'gd' . $filename unless $filename =~ /^gd/i; @@ -10,12 +10,23 @@ if (-f "$filename.c") { die "File $filename.c already exists, won't overwrite\n"; } if (-f "$filename.h") { die "File $filename.h already exists, won't overwrite\n"; } -@@ -177,28 +180,40 @@ +@@ -139,6 +142,10 @@ + + $info + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ + #include "$filename.h" + + char ${gdname}Data[] = { +@@ -177,28 +184,40 @@ ${gdname}Data }; -gdFontPtr ${gdname} = &${gdname}Rep; -+BGD_EXPORT_DATA_IMPL gdFontPtr ${gdname} = &${gdname}Rep; ++BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep; -/* This file has not been truncated. */ +BGD_DECLARE(gdFontPtr) @@ -44,8 +55,8 @@ #include "gd.h" -extern gdFontPtr $gdname; -+ BGD_EXPORT_DATA_PROT gdFontPtr $gdname; -+ BGD_DECLARE(gdFontPtr) $gdfunc(void); ++extern BGD_EXPORT_DATA_PROT gdFontPtr $gdname; ++BGD_DECLARE(gdFontPtr) $gdfunc(void); +#ifdef __cplusplus +} _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->closed The patch to bdftogd should fix the problem for all fonts.