From owner-freebsd-stable@FreeBSD.ORG Fri Jul 16 09:51:41 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E391065672 for ; Fri, 16 Jul 2010 09:51:41 +0000 (UTC) (envelope-from reko.turja@liukuma.net) Received: from www.liukuma.net (www.liukuma.net [IPv6:2001:470:28:38a::1]) by mx1.freebsd.org (Postfix) with ESMTP id 065158FC14 for ; Fri, 16 Jul 2010 09:51:41 +0000 (UTC) Received: from www.liukuma.net (localhost [127.0.0.1]) by www.liukuma.net (Postfix) with ESMTP id 353E11CC69; Fri, 16 Jul 2010 12:51:40 +0300 (EEST) X-DKIM: Sendmail DKIM Filter v2.8.3 www.liukuma.net 353E11CC69 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=liukuma.net; s=liukudkim; t=1279273900; bh=HTFIYSQYiB5qNspXdWdg5KAblS1sqdUmfstBH6QL/wY=; h=Message-ID:From:To:Cc:References:In-Reply-To:Subject:Date: MIME-Version:Content-Type:Content-Transfer-Encoding; b=sSu3ZCouRpWJBn8O0OYM6g8szDI4P964npd8c4KmFQvbog2AyB9jOOMEOjAm78DuV t3mo9Q2AGfJAz0x8EppDstysu4cLReXQqQI3QgVFSpZU86loKZ632PkxFvf6aMD1T2 VgO45HONd3SsWqC7K/DHO3E086skWgEGqouEMOyQ= X-Virus-Scanned: amavisd-new at liukuma.net Received: from www.liukuma.net ([127.0.0.1]) by www.liukuma.net (www.liukuma.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RbDhlTaZSg9J; Fri, 16 Jul 2010 12:51:36 +0300 (EEST) Received: from rivendell (a91-155-174-194.elisa-laajakaista.fi [91.155.174.194]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: ignatz@www.liukuma.net) by www.liukuma.net (Postfix) with ESMTPSA id 972851CC67; Fri, 16 Jul 2010 12:51:36 +0300 (EEST) X-DKIM: Sendmail DKIM Filter v2.8.3 www.liukuma.net 972851CC67 Message-ID: <94382A43AE5842FD9571AE05688F09D8@rivendell> From: "Reko Turja" To: "Jeremy Chadwick" References: <4C3CC831.7040005@kaarposoft.dk> <20100713210729.GA11943@icarus.home.lan> <0228E401B70A4023A6F86A2ADAE59EF9@rivendell> <008D0251AE4F4A2DBAA1369410565B61@rivendell> <20100715162251.GA73929@icarus.home.lan> <20100716083617.GA97981@icarus.home.lan> <3FE6787E5CAC4C108C031CA6C8044FE4@rivendell> <20100716092209.GA99001@icarus.home.lan> In-Reply-To: <20100716092209.GA99001@icarus.home.lan> Date: Fri, 16 Jul 2010 12:51:38 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 Cc: "Mikhail T." , freebsd-stable@freebsd.org, Henrik /KaarPoSoft Subject: Re: openldap client GSSAPI authentication segfaults in fbsd8stablei386 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2010 09:51:41 -0000 >> void >> 232 _gss_mg_error(struct _gss_mech_switch *m, OM_uint32 maj, >> OM_uint32 min) >> 233 { >> 234 OM_uint32 major_status, minor_status; >> 235 OM_uint32 message_content; >> 236 struct mg_thread_ctx *mg; >> 237 >> 238 mg =3D &last_error_context; >> 239 >> 240 gss_release_buffer(&minor_status, &mg->maj_error); >> 241 gss_release_buffer(&minor_status, &mg->min_error); >> 242 >> 243 mg->mech =3D &m->gm_mech_oid; >> 244 mg->maj_stat =3D maj; >> >> when I give following comands, gdb tells me: >> >> (gdb) p last_error_context >> Cannot find thread-local variables on this target >> (gdb) p &last_error_context >> Cannot find thread-local variables on this target >> (gdb) p mg >> No symbol "mg" in current context. >> (gdb) > > I'm not sure if you're familiar with C or not. > > This is because gdb's context is at the wrong frame. In the=20 > backtrace > you provided originally, you'd need to do: > > (gdb) frame 2 > > To look at the variables associated with gss_display_status.c. > > last_error_context could be an exported variable (you'd need to look > through the source to find out where it's declared), so you might=20 > have > to print it with its source filename referenced. The print command=20 > I > gave you before (p/x filename.c::variable) didn't work, and that's a > surprise since the gdb documentation I read says it should. > > Also be aware that mg is a struct, so "p mg" won't tell you much,=20 > other > than whether or not it's null. You're probably more interested in > members of the struct, such as mg->maj_error and mg->min_error, and > other struct members. I gave f 2 before entering the commands above, and unless I'm much=20 mistaken, 'p mg' should at least give the pointer to the start of the=20 struct in question, so 'No symbol "mg" in current context' is mildly=20 interesting reply from GDB :) If I understand the code in question=20 right the last_error_context's address should be copied to mg for=20 accessing the error structure defined elsewhere in the scope of the=20 while. the definition is in same file and is as follows: 176 #if defined(__sparc64__) || defined(__arm__) ||=20 defined(__mips__) 177 178 /* 179 * These platforms don't support TLS on FreeBSD - threads will=20 just 180 * have to step on each other's error values for now. 181 */ 182 #define __thread 183 184 #endif 185 186 struct mg_thread_ctx { 187 gss_OID mech; 188 OM_uint32 maj_stat; 189 OM_uint32 min_stat; 190 gss_buffer_desc maj_error; 191 gss_buffer_desc min_error; 192 }; 193 static __thread struct mg_thread_ctx last_error_context -Reko=20