From nobody Sat Apr 06 21:00:20 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VBnn356z1z5HKrX for ; Sat, 6 Apr 2024 21:00:23 +0000 (UTC) (envelope-from rockyhotas@tilde.team) Received: from tilde.team (tilde.team [IPv6:2607:5300:60:4f58::248]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VBnn34d9Wz4bN1 for ; Sat, 6 Apr 2024 21:00:23 +0000 (UTC) (envelope-from rockyhotas@tilde.team) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.team; s=mail; t=1712437222; bh=Jot0WVCXwJ5+qW21SFWudH+7QCjhehUkOpBcShLZFho=; h=Date:From:To:Cc:Subject:Reply-To:In-Reply-To:From; b=n01udT4+LwUomfh24Y3NyrQJq/KPHk5EXKXfl/ym44/wEyiIsYMyT7L4l5leIS2Ay RBgjFhNNkdcR1U/uwQCghcNCgUl8TWzINz3MgZn3cN6OE28E75AQGLG7y8yMXKdXZy g6DBrxl1fje81E8guDQmmTLIyh86zP5F/FZZFBBc= Received: from localhost (mob-5-91-202-243.net.vodafone.it [5.91.202.243]) by tilde.team (Postfix) with ESMTPSA id 07AAC4C1D30; Sat, 6 Apr 2024 21:00:21 +0000 (UTC) Date: Sat, 6 Apr 2024 23:00:20 +0200 From: Rocky Hotas To: freebsd-hackers@freebsd.org Cc: Warner Losh Subject: Re: Re: Kernel module: return a number from a device Message-ID: Reply-To: Rocky Hotas List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16276, ipnet:2607:5300::/32, country:FR] X-Rspamd-Queue-Id: 4VBnn34d9Wz4bN1 On apr 06 14:39, Warner Losh wrote: > When this happens, hit ^t (control t). That will give a traceback of the > call stack which may help you track down where it is hanging (most likely > something is sleeping waiting for an event). Thanks! It seems that cat itself is hanging (so, uiomove can still be the culprit...): $ cat rolld Opened device "rolld" successfully. load: 0.44 cmd: cat 13392 [running] 7.67r 1.25u 6.39s 38% 1936k I also tried to modify rolld_read using only char variables: static int rolld_read(struct cdev *dev __unused, struct uio *uio, int ioflag __unused) { char random_out; char random_item; int error; random_item = (char) arc4random(); random_out = random_item % d_size; if ((error = uiomove(&random_out, 1, uio)) != 0) uprintf("uiomove failed!\n"); return (error); } But nothing changed with respect to the first version. Rocky