Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Sep 2010 12:11:10 -0700
From:      "Ricky  Charlet" <RCharlet@adaranet.com>
To:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>
Subject:   newbie trouble with destroy_dev
Message-ID:  <32AB5C9615CC494997D9ABB1DB12783C024C95033B@SJ-EXCH-1.adaranet.com>

index | next in thread | raw e-mail

Howdy,

                My goal is to destroy a character device which is currently open for read. Is that allowable? I'm hoping the userland program doing the reading will simply get a read error back (possibly with no data or truncated data).

                My experience so far is that I crash the box.

                I'm using BSD 8.0.  My program with the driver is a kernel module. Upon using the `kldunload` utility, the d_close() method is called.  I have tried these logic flows:

Test 1
---------------------
 Unhook my packet-filter-hooks
 cv_broadcast;
cv_destory
mMtx_destroy
destroy_dev
free associated buffers

Test 2
--------------------
Unhook my packet-filter-hooks
 cv_broadcast;
cv_destory
mMtx_destroy
destroy_dev_sched_cb
free associated buffers

  Test 3
----------------------
Unhook my packet-filter-hooks
 cv_broadcast;
cv_destory
mMtx_destroy
free associated buffers


                In all cases I get a kernel crash and the system reboots. Note that the userland program has the associated charater device open and is in a for-ever loop reading the fd.

                I'm a newbie and have not yet attached a debugger. I'll go start reading about that and trying it out while I hopefully await replies.

---
Ricky Charlet
Adara Networks<http://www.adaranet.com/welcome.html>;
USA 408-433-4942



home | help

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