I think, this has something to do with 'bool pkgDPkgPM::OpenLog()' in 'apt-pkg/deb/dpkgpm.cc'. The result of 'term_out = fopen(logfile_name.c_str(),"a");' is not checked. If the logfile is unaccessible the result will be zero and the subsequent 'fprintf(term_out, ...);' will segfault. BTW: maybe 'fprintf(term_out, outstr);' should be 'fprintf(term_out, "%s", outstr);'