[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: `dot -c`: not coping with chroot environment?



Unfortunately, the provided "proc/self/maps" is only close to linux one,
it does not cope with chroots.

The comment in graphviz source already says it works only on linux ;-)

Please, could you verify whether this change works:

--- a/lib/gvc/gvconfig.c
+++ b/lib/gvc/gvconfig.c
@@ -316,7 +316,8 @@
                            continue;
                        strcpy(line, path);  /* use line buffer for result */
                        strcat(line, "/graphviz");  /* plugins are in "graphviz" subdirectory */
-                       libdir = line;
+                       if (access(line, R_OK))
+                           libdir = line;
                        break;
                    }
                }




On Tue, 17 May 2011, Christoph Egger wrote:


context: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575797

Christoph Egger <christoph@christoph-egger.org> writes:
excerpt from ktrace/kdump -- is that confusion regarding the chrooted
environment (kfreebsd guys in Cc for that question) -- a ls / doesn's
show any trace of the chroot prefix so it probably *should* not be there

 25073 libgvc5-config-upda NAMI  "/proc/self/maps"
 25073 libgvc5-config-upda RET   open 3
 25073 libgvc5-config-upda CALL  fstat(0x3,0xbfbfe750)
 25073 libgvc5-config-upda STRU  struct stat {dev=151060236, ino=2225073, mode=-r--r--r-- , nlink=1, uid=0, gid=0, rdev=4294967295, atime=1305606374.522843234, stime=1305606374.522843234, ctime=1305606374.522843234, birthtime=-1, size=0, blksize=4096, blocks=0, flags=0x0 }
 25073 libgvc5-config-upda RET   fstat 0
 25073 libgvc5-config-upda CALL  mmap(0,0x1000,PROT_READ|PROT_WRITE,MAP_ANON|MAP_TYPE|MAP_PRIVATE,0xffffffff,0,0)
 25073 libgvc5-config-upda RET   mmap 673751040/0x2828a000
 25073 libgvc5-config-upda CALL  read(0x3,0x2828a000,0x1000)
 25073 libgvc5-config-upda GIO   fd 3 read 2746 bytes
       "08048000-08049000 r-xp 00002000 00:00 406079     /srv/schroot/unstable/usr/sbin/libgvc5-config-update
	08049000-0806b000 rw-p 00022000 00:00 0
	28049000-28064000 r-xp 0001d000 00:00 400659     /srv/schroot/unstable/lib/ld-2.13.so
	28064000-28065000 r--p 0001d000 00:00 400659     /srv/schroot/unstable/lib/ld-2.13.so
	28065000-28068000 rw-p 00003000 00:00 0
	28068000-2806b000 r--p 00003000 00:00 406738     /srv/schroot/unstable/etc/ld.so.cache
	2806b000-280cd000 r-xp 0006e000 00:00 406078     /srv/schroot/unstable/usr/lib/libgvc.so.5.0.0
	280cd000-280da000 rw-p 0006e000 00:00 406078     /srv/schroot/unstable/usr/lib/libgvc.so.5.0.0
	280da000-280e6000 r-xp 0000d000 00:00 405098     /srv/schroot/unstable/usr/lib/libgraph.so.4.0.0
	280e6000-280e7000 rw-p 0000d000 00:00 405098     /srv/schroot/unstable/usr/lib/libgraph.so.4.0.0
	280e7000-2820b000 r-xp 00129000 00:00 400677     /srv/schroot/unstable/lib/libc-2.13.so
	2820b000-2820d000 r--p 00129000 00:00 400677     /srv/schroot/unstable/lib/libc-2.13.so
	2820d000-2820e000 rw-p 00129000 00:00 400677     /srv/schroot/unstable/lib/libc-2.13.so
	2820e000-28212000 rw-p 00004000 00:00 0
	28212000-28215000 r-xp 00003000 00:00 406072     /srv/schroot/unstable/usr/lib/libxdot.so.4.0.0
	28215000-28216000 rw-p 00003000 00:00 406072     /srv/schroot/unstable/usr/lib/libxdot.so.4.0.0
	28216000-2821b000 r-xp 00005000 00:00 405063     /srv/schroot/unstable/usr/lib/libcdt.so.4.0.0
	2821b000-2821c000 rw-p 00005000 00:00 405063     /srv/schroot/unstable/usr/lib/libcdt.so.4.0.0
	2821c000-28223000 r-xp 00008000 00:00 406066     /srv/schroot/unstable/usr/lib/libpathplan.so.4.0.0
	28223000-28224000 rw-p 00008000 00:00 406066     /srv/schroot/unstable/usr/lib/libpathplan.so.4.0.0
	28224000-28226000 r-xp 00003000 00:00 400680     /srv/schroot/unstable/lib/libdl-2.13.so
	28226000-28227000 r--p 00003000 00:00 400680     /srv/schroot/unstable/lib/libdl-2.13.so
	28227000-28228000 rw-p 00003000 00:00 400680     /srv/schroot/unstable/lib/libdl-2.13.so
	28228000-2824c000 r-xp 00026000 00:00 401410     /srv/schroot/unstable/usr/lib/libexpat.so.1.5.2
	2824c000-2824e000 rw-p 00026000 00:00 401410     /srv/schroot/unstable/usr/lib/libexpat.so.1.5.2
	2824e000-28261000 r-xp 00014000 00:00 404381     /srv/schroot/unstable/usr/lib/libz.so.1.2.3.4
	28261000-28262000 rw-p 00014000 00:00 404381     /srv/schroot/unstable/usr/lib/libz.so.1.2.3.4
	28262000-28263000 rw-p 00001000 00:00 0
	28263000-28287000 r-xp 00025000 00:00 400681     /srv/schroot/unstable/lib/libm-2.13.so
	28287000-28288000 r--p 00025000 00:00 400681     /srv/schroot/unstable/lib/libm-2.13.so
	28288000-28289000 rw-p 00025000 00:00 400681     /srv/schroot/unstable/lib/libm-2.13.so
	28289000-2828b000 rw-p 00002000 00:00 0
	bfbe0000-bfc00000 rwxp 00020000 00:00 0
       "
 25073 libgvc5-config-upda RET   read 2746/0xaba
 25073 libgvc5-config-upda CALL  close(0x3)
 25073 libgvc5-config-upda RET   close 0
 25073 libgvc5-config-upda CALL  munmap(0x2828a000,0x1000)
 25073 libgvc5-config-upda RET   munmap 0
 25073 libgvc5-config-upda CALL  stat(0x280d9160,0xbfbfe950)
 25073 libgvc5-config-upda NAMI  "/srv/schroot/unstable/usr/lib/graphviz"
 25073 libgvc5-config-upda RET   stat -1 errno 2 No such file or directory
 25073 libgvc5-config-upda CALL  stat(0x280d9160,0xbfbfe810)
 25073 libgvc5-config-upda NAMI  "/srv/schroot/unstable/usr/lib/graphviz"
 25073 libgvc5-config-upda RET   stat -1 errno 2 No such file or directory
 25073 libgvc5-config-upda CALL  exit(0)


Reply to: