Comment 6 for bug 506342

Revision history for this message
Ali Utku Selen (auselen) wrote :

I think crash happens because code snippet below (from apt-pkg/deb/dpkgpm.cc:656) does not check if history_out is valid.

   string history_name = flCombine(_config->FindDir("Dir::Log"),
                                   _config->Find("Dir::Log::History"));
   if (!history_name.empty())
   {
      FILE *history_out = fopen(history_name.c_str(),"a");
      fprintf(history_out, "End-Date: %s\n", timestr);
      fclose(history_out);
   }

Problem gets triggered for me because my Dir::Log directory does not exists, due to the fact I've mounted my /var/log to a tmpfs.

$apt-config dump
...
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
...

I can confirm issue has disappeared after I've created directory manually.