Re: kqueue send over unix socket?

From: Aki Tuomi <aki.tuomi_at_open-xchange.com>
Date: Tue, 12 Mar 2019 23:52:35 +0200 (EET)
Hi!

I am trying exactly that.

dtrace output gives following

# dtrace -s sendmsg.d -p 61387
dtrace: script 'sendmsg.d' matched 30667 probes
CPU     ID                    FUNCTION:NAME
  0  16637                 uipc_send:return 
              kernel`sosend_generic+0x556
              kernel`kern_sendit+0x296
              kernel`sendit+0x19e
              kernel`sys_sendmsg+0x61
              kernel`amd64_syscall+0xa38
              kernel`0xffffffff80f5891d

  0  35794            sosend_generic:return 
              kernel`kern_sendit+0x296
              kernel`sendit+0x19e
              kernel`sys_sendmsg+0x61
              kernel`amd64_syscall+0xa38
              kernel`0xffffffff80f5891d

  0  32432               kern_sendit:return 
              kernel`sendit+0x19e
              kernel`sys_sendmsg+0x61
              kernel`amd64_syscall+0xa38
              kernel`0xffffffff80f5891d

  0  55533                      free:return 
              kernel`sendit+0x1b0
              kernel`sys_sendmsg+0x61
              kernel`amd64_syscall+0xa38
              kernel`0xffffffff80f5891d

  0  16604                    sendit:return 
              kernel`sys_sendmsg+0x61
              kernel`amd64_syscall+0xa38
              kernel`0xffffffff80f5891d

  0  30776               sys_sendmsg:return 
              kernel`amd64_syscall+0xa38
              kernel`0xffffffff80f5891d


> On 12 March 2019 23:37 Alan Somers <asomers_at_freebsd.org> wrote:
> 
>  
> Is he trying to send the kqueue file descriptor itself using sendmsg
> with SCM_RIGHTS?  It sounds like kqueues cannot be sent over unix
> sockets; not every file type necessarily can.  But if you want to know
> the nitty-gritty details, just run this:
> dtrace -i 'fbt:::return /arg1 == 45/ {stack();}' -c "my_program
> my_options" and that will usually tell you the exact function that set
> the error.
> 
> If the output is too large, then you can filter it by writing a D
> program like this:
> 
> #sendmsg.d
> fbt:kernel:sys_sendmsg:entry
> {
>         this->trigger = 1;
> }
> fbt:::return
> / this->trigger == 1 && arg1 == 45 /
> {
>         stack();
> }
> fbt:kernel:sys_sendmsg:return
> {
>         this->trigger = 0;
> }
> 
> dtrace -s sendmsg.d -c "my_program my_options"
> 
> Hope that helps.
> -Alan
> 
> On Tue, Mar 12, 2019 at 3:22 PM Larry Rosenman <ler_at_lerctr.org> wrote:
> >
> > I'm working with Aki Tuomi of Dovecot and he asks:
> >
> > I tried to ask if you could ask from some Kernel hacker why I cannot
> > send kqueue() fd over unix socket, I get "Operation not supported".
> >
> > Can anyone help me?
> >
> >
> >
> > --
> > Larry Rosenman                     http://www.lerctr.org/~ler
> > Phone: +1 214-642-9640                 E-Mail: ler_at_lerctr.org
> > US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106
> > _______________________________________________
> > freebsd-current_at_freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-current
> > To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Tue Mar 12 2019 - 20:52:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:20 UTC