Re: Bug#701832: doxygen consistently segfaults on kfreebsd-i386 when building opendnssec documentation
reassign 701832 graphviz
found 701832 2.26.3-12
affects 701832 + opendnssec freefoam libdap witty
tags 701832 + patch
thanks
While running doxygen, I've seen 'dot' sometimes hang trying to read
/proc/self/maps; I think this might be what causes the opendnssec build
to hang, and also affecting packages freefoam, libdap, witty in sid.
This happens usually on kfreebsd-i386 but also very rarely on
kfreebsd-amd64 too. A gdb backtrace of a hung 'dot' process is below.
The relevant bit of code in graphviz lib/gvc/gvconfig.c even says:
> 298 /* this only works on linux, other systems will get GVLIBDIR only */
> 299 libdir = GVLIBDIR;
> 300 f = fopen ("/proc/self/maps", "r");
I'm unsure if this is supposed to work using GNU/kFreeBSD's linprocfs,
but I tried wrapping the problem code with #ifdef linux. I was then
able to build the doxygen docs for opendnssec 250 times on
kfreebsd-amd64 and kfreebsd-i386 without recurrence of this bug yet.
I've no idea if my patch breaks any other functionality (it will fall
back to 'GVLIBDIR only'). But I notice there is another patch
fix-kfreebsd-chroots that already changed this same block of code.
> #0 0x0000000800d73080 in read () at ../sysdeps/unix/syscall-template.S:82
> No locals.
> #1 0x0000000800d19160 in _IO_new_file_underflow (fp=0x6030a0) at fileops.c:606 [0/751]
> count = <optimized out>
> #2 0x0000000800d19bde in _IO_default_uflow (fp=0x4) at genops.c:440
> ch = 5
> #3 0x0000000800d102fa in _IO_getline_info (fp=0x6030a0, buf=0x80063b000 "", n=1023, delim=10, extract_delim=1, eof=0x0) at iogetline.c:74
> c = 5
> len = 0
> ptr = 0x800a9bbc0 ""
> #4 0x0000000800d0f529 in _IO_fgets (buf=buf@entry=0x800a9bbc0 "", n=<optimized out>, n@entry=1024, fp=fp@entry=0x6030a0) at iofgets.c:58
> _buffer = {__routine = 0x6030a0, __arg = 0x800614335, __canceltype = 0, __prev = 0x0}
> _avail = 0
> _IO_acquire_lock_file = 0x6030a0
> count = <optimized out>
> result = <optimized out>
> #5 0x0000000800846944 in gvconfig_libdir (gvc=gvc@entry=0x602e80) at gvconfig.c:303
> line = '\000' <repeats 1023 times>
> libdir = 0x8008792b0 "/usr/lib/graphviz"
> path = <optimized out>
> tmp = <optimized out>
> f = 0x6030a0
> #6 0x0000000800846ab9 in gvconfig (gvc=gvc@entry=0x602e80, rescan=rescan@entry=0 '\000') at gvconfig.c:472
> sz = <optimized out>
> config_st = {st_dev = 13322904, st_ino = 8, st_mode = 24640, __pad_mode = 99, st_nlink = 8, __pad_nlink = 0, st_uid = 13314984, st_gid = 8, st_rdev = 6512704,
> st_atim = {tv_sec = 32, tv_nsec = 4294967295}, st_mtim = {tv_sec = 4197488, tv_nsec = 34368266240}, st_ctim = {tv_sec = 4197488, tv_nsec = 0}, st_size = 34368284856,
> st_blocks = 34366166680, st_blksize = 2534032, st_flags = 0, st_gen = 4294967295, __unused1 = {1, 34368266240}}
> libdir_st = {st_dev = 4197488, st_ino = 0, st_mode = 0, __pad_mode = 0, st_nlink = 0, __pad_nlink = 0, st_uid = 8518816, st_gid = 8, st_rdev = 16725440, st_atim = {
> tv_sec = 2535432, tv_nsec = 34366087712}, st_mtim = {tv_sec = 1, tv_nsec = 0}, st_ctim = {tv_sec = 536, tv_nsec = 34368284856}, st_size = 6303360, st_blocks = 1,
> st_blksize = 4197488, st_flags = 0, st_gen = 6374197, __unused1 = {6303360, 150}}
> f = 0x0
> config_text = 0x0
> libdir = <optimized out>
> #7 0x0000000800847e13 in gvContextPlugins (builtins=<optimized out>, demand_loading=1) at gvc.c:56
> gvc = 0x602e80
Regards,
--
Steven Chamberlain
steven@pyro.eu.org
Index: graphviz-2.26.3/lib/gvc/gvconfig.c
===================================================================
--- graphviz-2.26.3.orig/lib/gvc/gvconfig.c 2013-03-03 17:26:23.000000000 +0000
+++ graphviz-2.26.3/lib/gvc/gvconfig.c 2013-03-03 17:29:41.235960554 +0000
@@ -297,6 +297,7 @@
#else
/* this only works on linux, other systems will get GVLIBDIR only */
libdir = GVLIBDIR;
+#ifdef linux
f = fopen ("/proc/self/maps", "r");
if (f) {
while (!feof (f)) {
@@ -323,6 +324,7 @@
fclose (f);
}
#endif
+#endif
}
if (gvc->common.verbose > 1)
fprintf (stderr, "libdir = \"%s\"\n",
Reply to: