Thanks, but the question was more 'why does the OSv socketpair() only support SOCK_STREAM, and not SOCK_DGRAM?'. I guess there has to be a reason why that decision was made.
As another datapoint, I removed the assert in OSv and things 'worked' (though I can't tell if that was luck or because that code wasn't really exercised). Rick On Wed, 2020-07-22 at 18:24 -0700, Dor Laor wrote: > Best is to put a breakpoint and start single stepping and read > those variable values > > On Wed, Jul 22, 2020 at 5:57 PM Rick Payne <[email protected]> > wrote: > > Trying to characterise some performance stuff, I thought I'd run > > socat > > under OSv however it panics: > > > > $ sudo scripts/run.py -n -e 'socat tcp4-listen:6971 > > open:/dev/null'OSv > > v0.55.0 > > eth0: 192.168.122.76 > > Booted up in 3245.70 ms > > Cmdline: socat tcp4-listen:6971 open:/dev/null > > Assertion failed: type == SOCK_STREAM (libc/af_local.cc: > > socketpair_af_local: 101) > > > > [backtrace] > > 0x00000000402228ae <abort(char const*, ...)+280> > > 0x0000000040222917 <__assert_fail+64> > > 0x00000000406fb1d0 <socketpair_af_local+61> > > 0x0000000040246c37 <socketpair+95> > > 0x0000100000034587 <???+214407> > > 0x657473696c2d346f <???+1814901871> > > > > The particular function in socat which triggers this is: > > > > static int diag_sock_pair(void) { > > int handlersocks[2]; > > > > if (socketpair(AF_UNIX, SOCK_DGRAM, 0, handlersocks) < 0) { > > diag_sock_send = -1; > > diag_sock_recv = -1; > > return -1; > > } > > diag_sock_send = handlersocks[1]; > > diag_sock_recv = handlersocks[0]; > > return 0; > > } > > > > And in OSv: > > > > #5 0x00000000406fb1d1 in socketpair_af_local (type=2, proto=0, > > sv=0x200000700b20) at libc/af_local.cc:101 > > 101 assert(type == SOCK_STREAM); > > > > Not sure why this restriction exists, and I've changed my local > > socat > > to use SOCK_STREAM - but just thought we should note a difference > > between linux and OSv here... > > > > Rick > > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/3b85ba561868f548df6423f3b00a2d67582fffeb.camel%40rossfell.co.uk.
