classicupgrade fails with: PANIC: No talloc stackframe

Rusty Russell rusty at samba.org
Thu Jul 19 19:28:41 MDT 2012


On Thu, 19 Jul 2012 23:37:12 +1000, Andrew Bartlett <abartlet at samba.org> wrote:
> Thanks, the critical lines are:
> 
> On Thu, 2012-07-19 at 15:18 +0200, Gémes Géza wrote:
> > PANIC: No talloc stackframe
> > ==1925== 
> > ==1925== Process terminating with default action of signal 6 (SIGABRT)
> > ==1925==    at 0x5F5F475: raise (raise.c:64)
> > ==1925==    by 0x5F626EF: abort (abort.c:92)
> > ==1925==    by 0x752ED8A: smb_panic_default (fault.c:149)
> > ==1925==    by 0x752EDC8: smb_panic (fault.c:162)
> > ==1925==    by 0x751FF12: _talloc_tos (talloc_stack.c:202)
> > ==1925==    by 0x15C3F851: handle_realm (loadparm.c:6709)
> > ==1925==    by 0x15C408C3: lp_do_parameter (loadparm.c:7113)
> > ==1925==    by 0x15C40C0F: lp_set_cmdline_helper (loadparm.c:7198)
> > ==1925==    by 0x15C40F32: lp_set_cmdline (loadparm.c:7238)
> > ==1925==    by 0x6EEE4FE: lpcfg_set_cmdline (loadparm.c:2757)
> > ==1925==    by 0x6CCCAA2: py_lp_ctx_set (pyparam.c:220)
> > ==1925==    by 0x4EAA3A: PyEval_EvalFrameEx (in /usr/bin/python2.7)
> > ==1925== 
> 
> In short, we probably need to rework the handle_realm() not to use
> talloc_tos(). 

How about this, instead?  It insulates all the s3 parameter functions
from such issues.

I'm spending the day with my daughter today so won't have a chance to
test this :(  But I'm happy with this or a local handle_realm() fix;
please apply.

(I'm a bit disappointed the testsuite doesn't run this path at all).

Thanks for the report,
Rusty.
---

Subject: loadparm: always provide a talloc_stackframe for s3 functions

handle_realm() calls talloc_tos():

==1925==    by 0x751FF12: _talloc_tos (talloc_stack.c:202)
==1925==    by 0x15C3F851: handle_realm (loadparm.c:6709)
==1925==    by 0x15C408C3: lp_do_parameter (loadparm.c:7113)
==1925==    by 0x15C40C0F: lp_set_cmdline_helper (loadparm.c:7198)
==1925==    by 0x15C40F32: lp_set_cmdline (loadparm.c:7238)
==1925==    by 0x6EEE4FE: lpcfg_set_cmdline (loadparm.c:2757)
==1925==    by 0x6CCCAA2: py_lp_ctx_set (pyparam.c:220)
==1925==    by 0x4EAA3A: PyEval_EvalFrameEx (in /usr/bin/python2.7)

Reported-by: Gémes Géza <geza at kzsdabas.hu>
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 33aef24..a867e88 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2741,7 +2741,11 @@ bool lpcfg_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName,
 	int i;
 
 	if (lp_ctx->s3_fns) {
-		return lp_ctx->s3_fns->set_cmdline(pszParmName, pszParmValue);
+		bool val;
+		TALLOC_CTX *frame = talloc_stackframe();
+		val = lp_ctx->s3_fns->set_cmdline(pszParmName, pszParmValue);
+		talloc_free(frame);
+		return val;
 	}
 
 	parmnum = map_parameter(pszParmName);


More information about the samba-technical mailing list