Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Apr 2024 23:00:20 +0200
From:      Rocky Hotas <rockyhotas@tilde.team>
To:        freebsd-hackers@freebsd.org
Cc:        Warner Losh <imp@bsdimp.com>
Subject:   Re: Re: Kernel module: return a number from a device
Message-ID:  <qarvyeobx2iumkc3ae6noaiukffpfgwihap32vi4yaqnkqigbi@3nxb4nmvub32>
In-Reply-To: <CANCZdfqAUWqp_s8ULhi9A97jrMCxA1CAXJKmUJ307=PSpekKug@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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