From owner-freebsd-bugs Thu Aug 30 12:31:14 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2BBE337B403 for ; Thu, 30 Aug 2001 12:30:58 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7UJU1a36518; Thu, 30 Aug 2001 12:30:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4B27F37B408 for ; Thu, 30 Aug 2001 12:21:14 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7UJJou35676; Thu, 30 Aug 2001 12:19:50 -0700 (PDT) (envelope-from nobody) Message-Id: <200108301919.f7UJJou35676@freefall.freebsd.org> Date: Thu, 30 Aug 2001 12:19:50 -0700 (PDT) From: Rob Phillips To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/30223: Using /usr/share/examples/kld/cdev, testcdev fails when compiled w/ -pthread Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30223 >Category: kern >Synopsis: Using /usr/share/examples/kld/cdev, testcdev fails when compiled w/ -pthread >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 30 12:30:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Rob Phillips >Release: 4.3-STABLE >Organization: Netrake Corporation >Environment: FreeBSD nrclient-136 4.3-RELEASE FreeBSD 4.3-RELEASE #0: sat Apr 21 10:54:49 GMT 2001 jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC i386 >Description: I'm working on writing a KLD device driver that interacts with some pthread-ed code, and I'm running into problems. To make sure it wasn't my code, I took the example code from /usr/share/examples/kld/cdev and compiled it as-is. This worked fine. However, when I added the line: COPTS= -pthread to the Makefile for the testcdev code, it stops working. The device driver records a seeminingly infinite loop of write() calls, rather than the single write call you normally get. It also records an unknown (to me) ioctl that isn't there when you don't use threads. Is this an error with the threads, the device driver, or something else? >How-To-Repeat: Change /usr/share/examples/kld/cdev/test/Makefile to include: COPTS= -pthread It is not necessary to do any changes to the C file. Recompile and then run the testcdev program (after loading the cdev driver). >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message