[Click] Mac OS X assert failed when trying to use KernelTun

Eddie Kohler kohler at cs.ucla.edu
Wed Nov 25 05:21:06 EST 2009


Pekka,

Thans very much for this note!  There was indeed a bug in the select handling 
-- we essentially assumed that every file descriptor was present in some array 
for both reading and writing.  This should be fixed now.  Let us know if you 
have any further issues.

Eddie


Pekka Nikander wrote:
> I'm a relative newbie to Click, and trying to use KernelTun on Mac OS X, with the latest GIT version.  Unfortunately it looks like that there is a bug, apparently related to the interactions between kevents and select/poll.  
> 
> The OS X tun/tap devices don't currently support kevents, and therefore click tries to back off to use select/poll.  However, once it gets to the actual poll in master.cc, something has gone wrong and I get a an assertion failure on line 850 in master.cc:
> 
> 	Element *read_elt = (p->revents & ~POLLOUT ? _read_elements[fd] : 0);
> 
> This results in an assertion failure, with this trivial script:
> 
> click -e "KernelTun(192.168.15.1/24) -> Discard"
> Assertion failed: (i>=0 && i<_n), function operator[], file ../include/click/vector.hh, line 184.
> Abort trap
> 
> My gut feeling is that the bug may line somewhere in master.cc Master:add_select, in the code that tries to make sure that one can fall back to select/poll in the case of kqueue error.  But I may be wrong.
> 
> In any case, when tracing the execution in opening the tun/tap device, the kevent system call at line 602 of master.cc fails, causing the _kqueue socket to be closed and made unused.   However, much before that I can see with ifconfig that the tun/tap interface is indeed open and correctly ifconfig'ed.
> 
> Anyone an idea where to continue debugging?  Or would it be easier to add KEVENT support to the Mac tun/tap kexts?
> 
> --Pekka Nikander
> 
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click



More information about the click mailing list