Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2013 07:15:59 -0800 (PST)
From:      KT Sin <ktsin@acm.org>
To:        hiren panchasara <hiren.panchasara@gmail.com>, db@freebsd.org
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: pw is broken?
Message-ID:  <1362842159.24304.YahooMailClassic@web31816.mail.mud.yahoo.com>
In-Reply-To: <CALCpEUEYjANtNzNOSUDwCz6C8wB%2BEi7hHj%2BuEC=XS=MNKGWM0w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
saw the commit an hour ago. rebuilt libutil.so.9 and unfortunately it still=
 crashes for me :(

--- On Sat, 3/9/13, hiren panchasara <hiren.panchasara@gmail.com> wrote:

From: hiren panchasara <hiren.panchasara@gmail.com>
Subject: Re: pw is broken?
To: ktsin@acm.org
Cc: "freebsd-current" <freebsd-current@freebsd.org>
Date: Saturday, March 9, 2013, 10:34 PM


=0AOn Mar 8, 2013 9:44 PM, "KT Sin" <ktsin@acm.org> wrote:
=0A>
=0A> pw is crashing with seg fault due to this change?
=0A>
=0A> http://svnweb.freebsd.org/base/head/lib/libutil/gr_util.c?r1=3D245390&=
r2=3D247919=0AI think the correct fix is committed with: http://svnweb.free=
bsd.org/changeset/base/248102=0AHiren
=0A>
=0A> # gdb ./pw
=0A> GNU gdb 6.1.1 [FreeBSD]
=0A> Copyright 2004 Free Software Foundation, Inc.
=0A> GDB is free software, covered by the GNU General Public License, and y=
ou are
=0A> welcome to change it and/or distribute copies of it under certain cond=
itions.
=0A> Type "show copying" to see the conditions.
=0A> There is absolutely no warranty for GDB. =A0Type "show warranty" for d=
etails.
=0A> This GDB was configured as "amd64-marcel-freebsd"...
=0A> (gdb) run groupadd test123 -g 12345
=0A> Starting program: /usr/src/usr.sbin/pw/pw groupadd test123 -g 12345
=0A>
=0A> Program received signal SIGSEGV, Segmentation fault.
=0A> 0x0000000080d84a4f in stpcpy () from /lib/libc.so.7
=0A> (gdb) bt full
=0A> #0 =A00x0000000080d84a4f in stpcpy () from /lib/libc.so.7
=0A> No symbol table info available.
=0A> #1 =A00x0000000080a5c00a in grcopy (gr=3D0x612ce0, newgr=3D0x81409100,=
 name=3D0x0,
=0A> =A0 =A0 ndx=3D0) at /usr/src/lib/libutil/gr_util.c:496
=0A> =A0 =A0 =A0 =A0 dst =3D 0x8 <Error reading address 0x8: Bad address>
=0A> =A0 =A0 =A0 =A0 i =3D 1090277153
=0A> #2 =A00x0000000080a5bdc6 in gr_add (gr=3D0x612ce0, newmember=3D0x0)
=0A> =A0 =A0 at /usr/src/lib/libutil/gr_util.c:451
=0A> =A0 =A0 =A0 =A0 newgr =3D (struct group *) 0x81409100
=0A> =A0 =A0 =A0 =A0 len =3D 0
=0A> =A0 =A0 =A0 =A0 num_mem =3D 0
=0A> #3 =A00x0000000080a5bd4f in gr_dup (gr=3D0x612ce0)
=0A> =A0 =A0 at /usr/src/lib/libutil/gr_util.c:434
=0A> No locals.
=0A> #4 =A00x000000000040bad7 in gr_update (grp=3D0x612ce0, group=3D0x0) at=
 grupd.c:78
=0A> =A0 =A0 =A0 =A0 pfd =3D 0
=0A> =A0 =A0 =A0 =A0 tfd =3D 4244492
=0A> =A0 =A0 =A0 =A0 gr =3D (struct group *) 0x0
=0A> =A0 =A0 =A0 =A0 old_gr =3D (struct group *) 0x0
=0A> #5 =A00x000000000040ba8f in addgrent (grp=3D0x612ce0) at grupd.c:111
=0A> No locals.
=0A> #6 =A00x000000000040a83d in pw_group (cnf=3D0x612bf0, mode=3D0, args=
=3D0x613e78)
=0A> =A0 =A0 at pw_group.c:258
=0A> ---Type <return> to continue, or q <return> to quit---
=0A> =A0 =A0 =A0 =A0 grp =3D (struct group *) 0x612ce0
=0A> =A0 =A0 =A0 =A0 members =3D (char **) 0x81485d00
=0A> =A0 =A0 =A0 =A0 rc =3D 0
=0A> =A0 =A0 =A0 =A0 a_name =3D (struct carg *) 0x8144c0a0
=0A> =A0 =A0 =A0 =A0 a_gid =3D (struct carg *) 0x8144c0c0
=0A> =A0 =A0 =A0 =A0 arg =3D (struct carg *) 0x0
=0A> =A0 =A0 =A0 =A0 grmembers =3D 200
=0A> =A0 =A0 =A0 =A0 fakegroup =3D {gr_name =3D 0x7fffffffdcb9 "test123",
=0A> =A0 gr_passwd =3D 0x40fbc9 "*", gr_gid =3D 12345, gr_mem =3D 0x81485d0=
0}
=0A> #7 =A00x00000000004037fb in main (argc=3D3, argv=3D0x7fffffffd9f0) at =
pw.c:230
=0A> =A0 =A0 =A0 =A0 which =3D 1
=0A> =A0 =A0 =A0 =A0 config =3D 0x0
=0A> =A0 =A0 =A0 =A0 cnf =3D (struct userconf *) 0x612bf0
=0A> =A0 =A0 =A0 =A0 ch =3D -1
=0A> =A0 =A0 =A0 =A0 mode =3D 0
=0A> =A0 =A0 =A0 =A0 opts =3D {{0x40e150 "V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:=
w:h:H:Db:NPy:Y",
=0A> =A0 =A0 0x40e180 "V:C:qn:u:rY",
=0A> =A0 =A0 0x40e18c "V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY",
=0A> =A0 =A0 0x40e1b7 "V:C:qn:u:FPa7", 0x40e1c5 "V:C:q", 0x40e1c5 "V:C:q",
=0A> =A0 =A0 0x40e1c5 "V:C:q"}, {0x40e1cb "V:C:qn:g:h:H:M:opNPY",
=0A> =A0 =A0 0x40e1e0 "V:C:qn:g:Y", 0x40e1eb "V:C:qn:d:g:l:h:H:FM:m:NPY",
=0A> =A0 =A0 0x40e205 "V:C:qn:g:FPa", 0x40e1c5 "V:C:q", 0x0, 0x0}}
=0A> =A0 =A0 =A0 =A0 funcs =3D {0x405270 <pw_user>, 0x409b60 <pw_group>}
=0A> (gdb)
=0A>
=0A> _______________________________________________
=0A> freebsd-current@freebsd.org mailing list
=0A> http://lists.freebsd.org/mailman/listinfo/freebsd-current
=0A> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.=
org"
=0A=0A
From owner-freebsd-current@FreeBSD.ORG  Sat Mar  9 15:20:13 2013
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 8A56A47C;
 Sat,  9 Mar 2013 15:20:13 +0000 (UTC)
 (envelope-from andreast-list@fgznet.ch)
Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47])
 by mx1.freebsd.org (Postfix) with ESMTP id 2D91F881;
 Sat,  9 Mar 2013 15:20:12 +0000 (UTC)
Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch
 [91.190.14.19])
 by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id r29EwonH014637;
 Sat, 9 Mar 2013 15:58:50 +0100 (CET)
 (envelope-from andreast-list@fgznet.ch)
Message-ID: <513B4E2A.3020505@fgznet.ch>
Date: Sat, 09 Mar 2013 15:58:50 +0100
From: Andreas Tobler <andreast-list@fgznet.ch>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8;
 rv:17.0) Gecko/20130216 Thunderbird/17.0.3
MIME-Version: 1.0
To: "Hartmann, O." <ohartman@zedat.fu-berlin.de>
Subject: Re: pw is broken?
References: <1362807830.29167.YahooMailClassic@web31805.mail.mud.yahoo.com>
 <CALCpEUEYjANtNzNOSUDwCz6C8wB+Ei7hHj+uEC=XS=MNKGWM0w@mail.gmail.com>
 <513B4C9A.8070602@zedat.fu-berlin.de>
In-Reply-To: <513B4C9A.8070602@zedat.fu-berlin.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47
Cc: Adrian Chadd <adrian@freebsd.org>,
 freebsd-current <freebsd-current@freebsd.org>
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Mar 2013 15:20:13 -0000

On 09.03.13 15:52, Hartmann, O. wrote:
> Am 03/09/13 15:34, schrieb hiren panchasara:
>> On Mar 8, 2013 9:44 PM, "KT Sin" <ktsin@acm.org> wrote:
>>>
>>> pw is crashing with seg fault due to this change?
>>>
>>>
>> http://svnweb.freebsd.org/base/head/lib/libutil/gr_util.c?r1=245390&r2=247919
>>
>> I think the correct fix is committed with:
>> http://svnweb.freebsd.org/changeset/base/248102
>>
>> Hiren
>>>
>>> # gdb ./pw
>>> GNU gdb 6.1.1 [FreeBSD]
>>> Copyright 2004 Free Software Foundation, Inc.
>>> GDB is free software, covered by the GNU General Public License, and you
>> are
>>> welcome to change it and/or distribute copies of it under certain
>> conditions.
>>> Type "show copying" to see the conditions.
>>> There is absolutely no warranty for GDB.  Type "show warranty" for
>> details.
>>> This GDB was configured as "amd64-marcel-freebsd"...
>>> (gdb) run groupadd test123 -g 12345
>>> Starting program: /usr/src/usr.sbin/pw/pw groupadd test123 -g 12345
>>>
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x0000000080d84a4f in stpcpy () from /lib/libc.so.7
>>> (gdb) bt full
>>> #0  0x0000000080d84a4f in stpcpy () from /lib/libc.so.7
>>> No symbol table info available.
>>> #1  0x0000000080a5c00a in grcopy (gr=0x612ce0, newgr=0x81409100, name=0x0,
>>>     ndx=0) at /usr/src/lib/libutil/gr_util.c:496
>>>         dst = 0x8 <Error reading address 0x8: Bad address>
>>>         i = 1090277153
>>> #2  0x0000000080a5bdc6 in gr_add (gr=0x612ce0, newmember=0x0)
>>>     at /usr/src/lib/libutil/gr_util.c:451
>>>         newgr = (struct group *) 0x81409100
>>>         len = 0
>>>         num_mem = 0
>>> #3  0x0000000080a5bd4f in gr_dup (gr=0x612ce0)
>>>     at /usr/src/lib/libutil/gr_util.c:434
>>> No locals.
>>> #4  0x000000000040bad7 in gr_update (grp=0x612ce0, group=0x0) at
>> grupd.c:78
>>>         pfd = 0
>>>         tfd = 4244492
>>>         gr = (struct group *) 0x0
>>>         old_gr = (struct group *) 0x0
>>> #5  0x000000000040ba8f in addgrent (grp=0x612ce0) at grupd.c:111
>>> No locals.
>>> #6  0x000000000040a83d in pw_group (cnf=0x612bf0, mode=0, args=0x613e78)
>>>     at pw_group.c:258
>>> ---Type <return> to continue, or q <return> to quit---
>>>         grp = (struct group *) 0x612ce0
>>>         members = (char **) 0x81485d00
>>>         rc = 0
>>>         a_name = (struct carg *) 0x8144c0a0
>>>         a_gid = (struct carg *) 0x8144c0c0
>>>         arg = (struct carg *) 0x0
>>>         grmembers = 200
>>>         fakegroup = {gr_name = 0x7fffffffdcb9 "test123",
>>>   gr_passwd = 0x40fbc9 "*", gr_gid = 12345, gr_mem = 0x81485d00}
>>> #7  0x00000000004037fb in main (argc=3, argv=0x7fffffffd9f0) at pw.c:230
>>>         which = 1
>>>         config = 0x0
>>>         cnf = (struct userconf *) 0x612bf0
>>>         ch = -1
>>>         mode = 0
>>>         opts = {{0x40e150
>> "V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y",
>>>     0x40e180 "V:C:qn:u:rY",
>>>     0x40e18c "V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY",
>>>     0x40e1b7 "V:C:qn:u:FPa7", 0x40e1c5 "V:C:q", 0x40e1c5 "V:C:q",
>>>     0x40e1c5 "V:C:q"}, {0x40e1cb "V:C:qn:g:h:H:M:opNPY",
>>>     0x40e1e0 "V:C:qn:g:Y", 0x40e1eb "V:C:qn:d:g:l:h:H:FM:m:NPY",
>>>     0x40e205 "V:C:qn:g:FPa", 0x40e1c5 "V:C:q", 0x0, 0x0}}
>>>         funcs = {0x405270 <pw_user>, 0x409b60 <pw_group>}
>>> (gdb)
> 
> But neither r248102 nor r248103 compile!
> 
> /usr/src/sys/net80211/ieee80211_output.c:600:23: error: unused variable
> 'ic' [-Werror,-Wunused-variable]
>         struct ieee80211com *ic = ni->ni_ic;)
> (


Try this the below.

Andreas


Index: sys/net80211/ieee80211_output.c
===================================================================
--- sys/net80211/ieee80211_output.c	(revision 248096)
+++ sys/net80211/ieee80211_output.c	(working copy)
@@ -597,10 +597,9 @@
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211_tx_ampdu *tap;
 	struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
-	struct ieee80211com *ic = ni->ni_ic;
 	ieee80211_seq seqno;

-	IEEE80211_TX_LOCK_ASSERT(ic);
+	IEEE80211_TX_LOCK_ASSERT(ni->ni_ic);

 	wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type;
 	if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) {




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1362842159.24304.YahooMailClassic>