tags 568187 + patch fixed-upstream pending thanks On Thu, Feb 04, 2010 at 12:46:57AM +0100, Marc Bantle wrote: > Roger Leigh schrieb: > > Could you possibly let me know what file was in > > /var/lib/schroot/session/, and if you have it, the contents? > > > Find file attached ( > > Can you reproduce the problem again? > Yes, every time when the given file is in /var/lib/schroot/session/ > > If so, could you take me through > > the steps to cause a file to be left in the session directory. > Unfortunately not, that happend accidentally. I didn't > set the 'type' parameter on previous configurations. Maybe > that caused it.
Thanks for the file and debugging info. I've been able to reproduce the problem and correct it using the attached patch. The loader code creates a "template" chroot of the desired type, and then clones a session chroot from this in order to restore the configuration. plain chroot types, however, don't support session cloning and return a NULL chroot which leads to the segfault when we try to use it. The patch adds an additional check to ensure we only do this when working with a clonable chroot type. This should be in a new release shortly. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
diff --git a/sbuild/sbuild-chroot-config.cc b/sbuild/sbuild-chroot-config.cc
index 4c537ec..f153632 100644
--- a/sbuild/sbuild-chroot-config.cc
+++ b/sbuild/sbuild-chroot-config.cc
@@ -20,6 +20,7 @@
#include "sbuild-chroot.h"
#include "sbuild-chroot-facet-source-clonable.h"
+#include "sbuild-chroot-facet-session-clonable.h"
#include "sbuild-chroot-config.h"
#include "sbuild-lock.h"
@@ -515,9 +516,19 @@ chroot_config::load_keyfile (keyfile& kconfig,
// get the correct facets in place. In the future, it would be
// great if sessions could serialise their facet usage to allow
// automatic reconstruction.
- if (active)
+ chroot_facet_session_clonable::const_ptr clonable
+ (chroot->get_facet<chroot_facet_session_clonable>());
+
+ log_debug(DEBUG_INFO) << "Created template chroot (type=" << type
+ << " name/session-id=" << *group
+ << " active=" << active
+ << " source-clonable=" << static_cast<bool>(clonable)
+ << ")" << endl;
+
+ if (active && clonable)
{
chroot = chroot->clone_session("dummy-session-name", "", false);
+ assert(chroot);
assert(chroot->get_active());
}
else
signature.asc
Description: Digital signature

