Hey,
Zathura core 0.3.2. Needs the girara update I just posted.
This started out with me trying to fix the crash in the search feature in
the in-tree version. When I found the crash in 0.3.2, I had to dig deeper.
In short, in shortcuts.c:sc_search() triggers the stack protector when
it returns. I narrowed the stack trashing down to this line:
g_object_get(cur_page_widget, "draw-search-results", &draw, NULL);
I figured this out by doing a binary chop, inserting return statements until I
found the trouble line.
Valgrind does not detect this on linux. Malloc flags makes no difference,
nor does building -O0. Building zathura with egcc *does* fix the problem, so
I guess this is a bug in the base compiler stack protector(?).
Anyway, in the following diff I unconditionally build zathura with egcc.
We could decide to do so on only a subset of arches. Thoughts? I have
only tried this on amd64...
BTW, has anyone tried synctex support? You can sync your editor with zathura
and use a mouse click or keyboard shortcut to sync the editor and PDF views
(like CTRL+click in texworks).
Here is how to do this in vim:
https://gist.github.com/vext01/16df5bd48019d451e078
Comments and OKs for the following diff?
Index: Makefile
===================================================================
RCS file: /home/edd/cvsync/ports/textproc/zathura/core/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 2 Sep 2014 13:29:57 -0000 1.1.1.1
+++ Makefile 24 Nov 2014 21:20:49 -0000
@@ -1,13 +1,19 @@
# $OpenBSD: Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
-V = 0.2.9
-COMMENT = pdf viewer with vi-like keybindings
+V = 0.3.2
+COMMENT = PDF viewer with vi-like keybindings
DISTNAME = zathura-${V}
CATEGORIES = textproc x11
HOMEPAGE = http://pwmt.org/projects/zathura/
-MODULES = devel/gettext
+# Newer gcc4 is needed to work around a compiler bug.
+# When you search a PDF the stack protector erroneously(?) fires.
+MODULES = devel/gettext \
+ gcc4
+
+MODGCC4_ARCHS = *
+MODGCC4_LANGS = c
# MIT
PERMIT_PACKAGE_CDROM = Yes
@@ -23,7 +29,7 @@ BUILD_DEPENDS = textproc/py-docutils
RUN_DEPENDS = devel/desktop-file-utils
LIB_DEPENDS = graphics/gdk-pixbuf2 \
devel/libmagic \
- x11/girara
+ x11/girara>=0.2.3
MAKE_FLAGS = MANPREFIX=${PREFIX}/man \
DESKTOPPREFIX=${PREFIX}/share/applications \
Index: distinfo
===================================================================
RCS file: /home/edd/cvsync/ports/textproc/zathura/core/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo 2 Sep 2014 13:29:57 -0000 1.1.1.1
+++ distinfo 24 Nov 2014 12:14:31 -0000
@@ -1,2 +1,2 @@
-SHA256 (zathura-0.2.9.tar.gz) = LAcdQD7JNIuDlWeyiXhQvynZwkyFmCtVCaGkKacu4J8=
-SIZE (zathura-0.2.9.tar.gz) = 196690
+SHA256 (zathura-0.3.2.tar.gz) = /aZQPcWyH3xmcwF5j70sl4iX5otFVejHMZRc7NnRZeI=
+SIZE (zathura-0.3.2.tar.gz) = 202943
Index: patches/patch-Makefile
===================================================================
RCS file: /home/edd/cvsync/ports/textproc/zathura/core/patches/patch-Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-Makefile
--- patches/patch-Makefile 2 Sep 2014 13:29:57 -0000 1.1.1.1
+++ patches/patch-Makefile 24 Nov 2014 12:14:31 -0000
@@ -1,7 +1,10 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
---- Makefile.orig Tue Jun 24 22:31:41 2014
-+++ Makefile Tue Aug 26 23:20:25 2014
-@@ -148,7 +148,7 @@ gdb: debug
+
+Patch away hard-coded make.
+
+--- Makefile.orig Sun Nov 9 22:50:01 2014
++++ Makefile Mon Nov 24 11:53:18 2014
+@@ -219,7 +219,7 @@ gdb: debug
$(QUIET)cgdb ${PROJECT}-debug
test: ${OBJECTS}
@@ -10,3 +13,12 @@ $OpenBSD: patch-Makefile,v 1.1.1.1 2014/
dist: clean build-manpages
$(QUIET)tar -czf $(TARFILE) --exclude=.gitignore \
+@@ -228,7 +228,7 @@ dist: clean build-manpages
+ doc/_build/$(PROJECT).1 doc/_build/$(PROJECT)rc.5
+
+ doc:
+- $(QUIET)make -C doc
++ $(QUIET)${MAKE} -C doc
+
+ po:
+ $(QUIET)${MAKE} -C po
Index: patches/patch-tests_Makefile
===================================================================
RCS file: patches/patch-tests_Makefile
diff -N patches/patch-tests_Makefile
--- patches/patch-tests_Makefile 2 Sep 2014 13:29:57 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-tests_Makefile,v 1.1.1.1 2014/09/02 13:29:57 landry Exp $
---- tests/Makefile.orig Tue Jun 24 22:31:41 2014
-+++ tests/Makefile Tue Aug 26 23:20:25 2014
-@@ -47,7 +47,7 @@ options:
- $(QUIET)${CC} -c -I.. ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF
.depend/[email protected]
-
- ${PROJECT}: options ${OBJECTS}
-- $(QUIET)make -C ..
-+ $(QUIET)${MAKE} -C ..
- $(ECHO) CC -o $@
- $(QUIET)${CC} ${SFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${ZOBJECTS} ${LIBS}
-
Index: pkg/PLIST
===================================================================
RCS file: /home/edd/cvsync/ports/textproc/zathura/core/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 2 Sep 2014 13:29:57 -0000 1.1.1.1
+++ pkg/PLIST 24 Nov 2014 12:14:31 -0000
@@ -14,10 +14,13 @@ lib/pkgconfig/zathura.pc
lib/zathura/
@man man/man1/zathura.1
@man man/man5/zathurarc.5
+share/appdata/
+share/appdata/zathura.appdata.xml
share/applications/zathura.desktop
share/dbus-1/
share/dbus-1/interfaces/
share/dbus-1/interfaces/org.pwmt.zathura.xml
+share/doc/pkg-readmes/${FULLPKGNAME}
share/locale/ca/LC_MESSAGES/zathura.mo
share/locale/cs/LC_MESSAGES/zathura.mo
share/locale/de/LC_MESSAGES/zathura.mo
--
Best Regards
Edd Barrett
http://www.theunixzoo.co.uk