From nobody Tue Apr 9 15:46:35 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 4VDVgp6BZ3z5HCw8 for ; Tue, 9 Apr 2024 15:46:46 +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) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VDVgp1CFXz4PtN for ; Tue, 9 Apr 2024 15:46:46 +0000 (UTC) (envelope-from rockyhotas@tilde.team) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tilde.team header.s=mail header.b="S8KKW/2v"; dmarc=pass (policy=reject) header.from=tilde.team; spf=pass (mx1.freebsd.org: domain of rockyhotas@tilde.team designates 2607:5300:60:4f58::248 as permitted sender) smtp.mailfrom=rockyhotas@tilde.team DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.team; s=mail; t=1712677597; bh=tKcMCNG4w00qLit1DCQixUUyxynKiQmrmQkVotw5eI0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=S8KKW/2vXiplEXtdZwFbTnin8NmRv7VjZikfeqtfTQo/1N8yG6/wu4liAQOabKyLx zob11VMYWagedtKHIGADEU6Vk+aBx8sKpMF1ldzov+T589XQvhJ/QXqx3AjcFDSFYG 9LNDRVZsY/i4h5IHtrK5SgOxl54tYhiu6zS8iIac= Received: from localhost (mob-5-91-202-29.net.vodafone.it [5.91.202.29]) by tilde.team (Postfix) with ESMTPSA id D5D334C0383; Tue, 9 Apr 2024 15:46:36 +0000 (UTC) Date: Tue, 9 Apr 2024 17:46:35 +0200 From: Rocky Hotas To: freebsd-hackers@freebsd.org Cc: Warner Losh Subject: Re: Re: Re: Kernel module: return a number from a device Message-ID: Reply-To: Rocky Hotas References: 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-Spamd-Result: default: False [-2.44 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[tilde.team,reject]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[tilde.team:s=mail]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; NEURAL_HAM_SHORT(-0.04)[-0.041]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16276, ipnet:2607:5300::/32, country:FR]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[rockyhotas@tilde.team]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; DKIM_TRACE(0.00)[tilde.team:+]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4VDVgp1CFXz4PtN On apr 06 22:21, Warner Losh wrote: > > running means there's a tight loop somewhere... uiomove doesn't do that. It > is a bunch of ifs that go to a copyout. Arc4random shouldn't either. I'd > add printf to see where. Using some uprintf along the code of rolld_read, I confirm that there's a loop involving cat. [...] > This should produce an infinite number of chars... maybe it is and d_size > is 1 and they are all NULs. Try cat -v. Yes: there was an infinite number of chars, but they were non-printable, so invisibile, because they are the raw values 0, 1, 2, 3, 4 or 5 resulting from `random_item % d_size'. Only `cat -v' could show them. The infinite `cat' output is provoked by the `1' value provided as second parameter of `uiomove(&random_out, 1, uio)' without any other comparison involving uio_offset, so never signaling the end of "file", as mentioned by Dag-Erling. Thank you! Rocky