Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Oct 2011 19:32:23 +0400
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        current@freebsd.org, hackers@freebsd.org
Cc:        Lawrence Stewart <lstewart@freebsd.org>
Subject:   alq_open_flags() panics in _mtx_lock_flags()
Message-ID:  <1258376930.20111002193223@serebryakov.spb.ru>

next in thread | raw e-mail | index | archive | help
Hello, FreeBSD.

 I'm trying to create logging queue with alq kernel API. I call
 alq_open_flags() like this in my module:

error =3D alq_open_flags(&sc->sc_alq, sc->sc_vnode_name,
    curthread->td_ucred, ALQ_DEFAULT_CMODE,
    sizeof(struct g_log_entry), ALQ_ORDERED);

 and my system (10-CURRENT) panics with this stack trace (top frames
 are DDB-related, so I omit them):

#5  0xc06101c3 in kdb_trap (type=3D12, code=3D0, tf=3D0xc4e29990)
    at /usr/home/lev/FreeBSD-head/sys/kern/subr_kdb.c:620
#6  0xc08290af in trap_fatal (frame=3D0xc4e29990, eva=3D136)
    at /usr/home/lev/FreeBSD-head/sys/i386/i386/trap.c:958
#7  0xc08292c0 in trap_pfault (frame=3D0xc4e29990, usermode=3D0, eva=3D136)
    at /usr/home/lev/FreeBSD-head/sys/i386/i386/trap.c:880
#8  0xc0829f46 in trap (frame=3D0xc4e29990)
    at /usr/home/lev/FreeBSD-head/sys/i386/i386/trap.c:555
#9  0xc0812e7c in calltrap ()
    at /usr/home/lev/FreeBSD-head/sys/i386/i386/exception.s:168
#10 0xc05cafc0 in _mtx_lock_flags (m=3D0x78, opts=3D0,=20
    file=3D0xc088c140 "/usr/home/lev/FreeBSD-head/sys/kern/vfs_subr.c",=20
    line=3D2169) at /usr/home/lev/FreeBSD-head/sys/kern/kern_mutex.c:194
#11 0xc0672eb2 in vref (vp=3D0x0)
    at /usr/home/lev/FreeBSD-head/sys/kern/vfs_subr.c:2169
#12 0xc066932f in namei (ndp=3D0xc4e29b74)
    at /usr/home/lev/FreeBSD-head/sys/kern/vfs_lookup.c:264
#13 0xc0682900 in vn_open_cred (ndp=3D0xc4e29b74, flagp=3D0xc4e29be8, cmode=
=3D384,=20
    vn_open_flags=3D0, cred=3D0xc50fee80, fp=3D0x0)
    at /usr/home/lev/FreeBSD-head/sys/kern/vfs_vnops.c:137
#14 0xc5c42609 in alq_open_flags (alqp=3D0xc550dc08,=20
    file=3D0xc5108d40 "/usr/ada4.log", cred=3D0xc50fee80, cmode=3D384, size=
=3D28,
    flags=3D16)
    at /usr/home/lev/FreeBSD-head/sys/modules/alq/../../kern/kern_alq.c:451

  It seems, that vref() get NULL instead of valid pointer to struct
 vnode. But I have no idea -- why?! Yes, I have no such file created,
 but man alq(9) says, that it will create file for me. And if I point
 to existed file, it panic anyway.

  What do I do wrong?!

--=20
// Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>




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