kern/99068: Linux emulator crashed by java, when calling ioctl(fd, SIOCGIFINDEX, ...)

Federico Ignacio esepecesito at gmail.com
Sat Jun 17 01:20:23 UTC 2006


>Number:         99068
>Category:       kern
>Synopsis:       Linux emulator crashed by java, when calling ioctl(fd,SIOCGIFINDEX,...)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 17 01:20:21 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Federico Ignacio
>Release:        6.1
>Organization:
Nextel
>Environment:
FreeBSD freebsd.esepecesito.com.ar 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:42:56 UTC 2006     root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
>Description:
While trying to install Oracle 10g under Linux compatibility, the installer freezes.
Really the problem seems to reside in the Java VM, or the linux emulation.
In the system console and /var/log/messages I get:
Jun 16 21:33:53 freebsd kernel: linux: pid 79295 (java): ioctl fd=21, cmd=0x8933 ('�',51) is not implemented
I was surfing internet, and seems there are more java applications with the same problem.
>How-To-Repeat:
Install plain FreeBSD 6.1 with additional packages: unzip, linux_base and linux_devel. Of course set linux compatibility on.
Install XFree86-libs-4.3.0-35.EL from "RedHat Enterprise Linux 3" (this is needed to get /usr/X11R6/lib/LibXp.so.6 initially missing)
Download oracle 10g for Linux 32bit.
Unpack with unzip, and run from user "oracle" "runInstaller" just pres "next" couple of times, and the screen freezes.
>Fix:
For what I can see, it seems that it fails calling:
    ioctl(fd,SIOCGIFINDEX,&if). 

I mean, 0x8933 is SIOCGIFINDEX in Linux (that's something i found -not 100% sure-), but get's incorrectly mapped in FreeBSD.

SIOCGIFINDEX definition (after tracing trough .h files) is an OR from different things, including the size of a "struct ifreq" I guess this strcut size is different in Linux and BSD.

***
from sys/sockio.h
    #define SIOCGIFINDEX    _IOWR('i', 32, struct ifreq)    /* get IF index */
from sys/ioccom.h
    #define _IOC(inout,group,num,len) \
        ((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)))

    #define IOC_INOUT       (IOC_IN|IOC_OUT)
    #define _IOWR(g,n,t)    _IOC(IOC_INOUT, (g), (n), sizeof(t))
***

The solution may be implement a workaround in the /usr/src/sys/net/if.c ? although it would be really dirty. Or maybe making "ifreq" the same size that in Linux. There must be a better way...
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list