From john@brann.org  Wed May  1 17:35:13 2002
Return-Path: <john@brann.org>
Received: from mail2.panix.com (mail2.panix.com [166.84.1.73])
	by hub.freebsd.org (Postfix) with ESMTP id 674B537B405
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 May 2002 17:35:12 -0700 (PDT)
Received: from jbdesk.brann.org (159-87.nyc.dsl.access.net [166.84.159.87])
	by mail2.panix.com (Postfix) with ESMTP id 21E328F82
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 May 2002 20:35:11 -0400 (EDT)
Received: from jbdesk.brann.org (localhost [127.0.0.1])
	by jbdesk.brann.org (8.12.2/8.12.2) with ESMTP id g420ZBwe091095
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 1 May 2002 20:35:11 -0400 (EDT)
	(envelope-from john@jbdesk.brann.org)
Received: (from john@localhost)
	by jbdesk.brann.org (8.12.2/8.12.2/Submit) id g420ZA1d091094;
	Wed, 1 May 2002 20:35:10 -0400 (EDT)
Message-Id: <200205020035.g420ZA1d091094@jbdesk.brann.org>
Date: Wed, 1 May 2002 20:35:10 -0400 (EDT)
From: John Brann <john@brann.org>
Reply-To: John Brann <john@brann.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Linux emulator 'Invalid Argument' error in 'linux_fcntl64()'
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         37656
>Category:       kern
>Synopsis:       Linux emulator 'Invalid Argument' error in 'linux_fcntl64()'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    robert
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 01 17:40:01 PDT 2002
>Closed-Date:    Sun Feb 29 14:13:51 PST 2004
>Last-Modified:  Sun Feb 29 14:13:51 PST 2004
>Originator:     John Brann
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
None
>Environment:
System: FreeBSD jbdesk.brann.org 4.5-STABLE FreeBSD 4.5-STABLE #4: Thu Mar 28 09:45:16 EST 2002 root@jbdesk.brann.org:/usr/obj/usr/src/sys/JBDESK i386

System is stable cvsupped on March 27th.  Kernel and all modules in sync.
linux_base-7.1_2 is installed (product requires glibc 2.1.3 or 2.2).

>Description:
	Attempting to run Tibco's JMS daemon (tibjmsd) for linux - program
	fails to start.  stderr output reads:

	---------Start stderr output-----------

TIBCO Enterprise for JMS Server.
Copyright 2002 by TIBCO Software Inc.
All rights reserved.

Version 2.0.0 V16 3/4/2002

EVALUATION SOFTWARE NOTICE:
This evaluation software is a subject to the End User License Agreement
accepted during the installation. It must be used for evaluation purposes
only. This software is limited to 256 concurrent connections from at most
8 hosts and will run for at most 12 hours.

2002-05-01 20:20:21 Process started from '/usr/local/tibco/jms/bin/tibjmsd'.
2002-05-01 20:20:21 Reading configuration from 'tibjmsd.conf'.
2002-05-01 20:20:21 Server name: 'E4JMS-SERVER'.
2002-05-01 20:20:21 Storage Location: '.'.
2002-05-01 20:20:21 Routing is disabled.
2002-05-01 20:20:21 Authorization is disabled.
2002-05-01 20:20:21 Rendezvous Bridge is disabled.
2002-05-01 20:20:21 Accepting connections on tcp://jbdesk.brann.org:7222.
2002-05-01 20:20:21 ERROR: Unable to open metadata file 'meta.db', file may be locked.
2002-05-01 20:20:21 FATAL: Exception in startup, exiting.

	---------End stderr output-----------

	Running under truss shows the following significant line:

linux_fcntl64(0x7,0xd,0xbfbff2e0)                ERR#22 'Invalid argument'

	this is line 448 of the full truss output, attached below:

---------Start Full truss output---------------


linux_newuname(0xbfbff070)			 = 0 (0x0)
linux_brk(0x0)					 = 135823360 (0x8188000)
linux_mmap(0xbfbfeda0)				 = 672710656 (0x2818c000)
linux_open("/etc/ld.so.preload",0x0,027757767070) ERR#2 'No such file or directory'
linux_open("/usr/local/lib/libpthread.so.0",0x0,00) ERR#2 'No such file or directory'
linux_stat64(0xbfbfe700,0xbfbfe760,0xbfbfe700)	 = 0 (0x0)
linux_open("/usr/local/lib/rvplayer5.0/libpthread.so.0",0x0,00) ERR#2 'No such file or directory'
linux_stat64(0xbfbfe700,0xbfbfe760,0xbfbfe700)	 ERR#2 'No such file or directory'
linux_open("./libpthread.so.0",0x0,00)		 ERR#2 'No such file or directory'
linux_open("/etc/ld.so.cache",0x0,027757763730)	 = 3 (0x3)
linux_fstat64(0x3,0xbfbfe710,0xbfbfe7d8)	 = 0 (0x0)
linux_mmap(0xbfbfe6e0)				 = 672714752 (0x2818d000)
close(3)					 = 0 (0x0)
linux_open("/lib/libpthread.so.0",0x0,027757763770) = 3 (0x3)
read(0x3,0xbfbfe844,0x400)			 = 1024 (0x400)
linux_fstat64(0x3,0xbfbfe750,0x2818c0a0)	 = 0 (0x0)
linux_mmap(0xbfbfe630)				 = 672722944 (0x2818f000)
mprotect(0x2819e000,0x74bc,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe630)				 = 672784384 (0x2819e000)
close(3)					 = 0 (0x0)
linux_open("/usr/local/lib/libc.so.6",0x0,0160000) ERR#2 'No such file or directory'
linux_open("./libc.so.6",0x0,0160000)		 ERR#2 'No such file or directory'
linux_open("/lib/libc.so.6",0x0,00)		 = 3 (0x3)
read(0x3,0xbfbfe834,0x400)			 = 1024 (0x400)
linux_fstat64(0x3,0xbfbfe740,0x2818c290)	 = 0 (0x0)
linux_mmap(0xbfbfe620)				 = 672817152 (0x281a6000)
mprotect(0x282c7000,0x8948,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe620)				 = 674000896 (0x282c7000)
linux_mmap(0xbfbfe620)				 = 674021376 (0x282cc000)
close(3)					 = 0 (0x0)
munmap(0x2818d000,0x1a53)			 = 0 (0x0)
linux_getpid()					 = 90984 (0x16368)
linux_rt_sigaction(0x20,0xbfbff0a0,0x0,0x8)	 = 0 (0x0)
linux_rt_sigaction(0x21,0xbfbff0a0,0x0,0x8)	 = 0 (0x0)
linux_rt_sigaction(0x22,0xbfbff0a0,0x0,0x8)	 = 0 (0x0)
linux_rt_sigprocmask(0x0,0xbfbff370,0x0,0x8)	 = 0 (0x0)
linux_sysctl(0xbfbff0f0)			 = 0 (0x0)
linux_getpid()					 = 90984 (0x16368)
write(2,0xbfbfcd80,122)				 = 122 (0x7a)
linux_brk(0x0)					 = 135823360 (0x8188000)
linux_brk(0x8188030)				 = 135823408 (0x8188030)
linux_brk(0x8189000)				 = 135827456 (0x8189000)
write(2,0xbfbfcd70,292)				 = 292 (0x124)
close(0)					 = 0 (0x0)
linux_rt_sigaction(0xd,0xbfbff220,0x0,0x8)	 = 0 (0x0)
linux_socketcall(0x8,0xbfbff3d0)		 = 0 (0x0)
linux_fcntl64(0x0,0x2,0x1)			 = 0 (0x0)
linux_fcntl64(0x3,0x2,0x1)			 = 0 (0x0)
linux_fcntl64(0x0,0x3,0x0)			 = 2 (0x2)
linux_fcntl64(0x0,0x4,0x802)			 = 0 (0x0)
linux_brk(0x818a000)				 = 135831552 (0x818a000)
linux_fcntl64(0x0,0x3,0x0)			 = 2050 (0x802)
linux_getrlimit(0x3,0xbfbff248)			 = 0 (0x0)
linux_setrlimit(0x3,0xbfbff248)			 = 0 (0x0)
linux_brk(0x818c000)				 = 135839744 (0x818c000)
linux_pipe(0xbfbff240)				 = 0 (0x0)
linux_clone(0xf00,0x818b020)			 = 90985 (0x16369)
write(5,0xbfbff250,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff324,0x8)	 = 0 (0x0)
write(5,0xbfbff310,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff260,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
linux_rt_sigsuspend(0xbfbff260,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbfef6c)			 ERR#4 'Interrupted system call'
linux_rt_sigprocmask(0x2,0x0,0xbfbff324,0x8)	 = 0 (0x0)
write(5,0xbfbff310,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff260,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
linux_rt_sigsuspend(0xbfbff260,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbfef6c)			 ERR#4 'Interrupted system call'
linux_kill(0x1636a,0x20)			 = 0 (0x0)
linux_brk(0x8195000)				 = 135876608 (0x8195000)
linux_mmap(0xbfbff340)				 = 674037760 (0x282d0000)
linux_brk(0x8196000)				 = 135880704 (0x8196000)
linux_brk(0x8197000)				 = 135884800 (0x8197000)
linux_brk(0x8198000)				 = 135888896 (0x8198000)
linux_brk(0x8199000)				 = 135892992 (0x8199000)
linux_brk(0x819a000)				 = 135897088 (0x819a000)
linux_brk(0x819b000)				 = 135901184 (0x819b000)
linux_brk(0x819c000)				 = 135905280 (0x819c000)
linux_brk(0x819d000)				 = 135909376 (0x819d000)
linux_brk(0x819e000)				 = 135913472 (0x819e000)
linux_brk(0x819f000)				 = 135917568 (0x819f000)
linux_brk(0x81a0000)				 = 135921664 (0x81a0000)
linux_brk(0x81a1000)				 = 135925760 (0x81a1000)
linux_brk(0x81a2000)				 = 135929856 (0x81a2000)
linux_brk(0x81a3000)				 = 135933952 (0x81a3000)
linux_brk(0x81a4000)				 = 135938048 (0x81a4000)
linux_brk(0x81a5000)				 = 135942144 (0x81a5000)
linux_brk(0x81a6000)				 = 135946240 (0x81a6000)
linux_brk(0x81a7000)				 = 135950336 (0x81a7000)
linux_brk(0x81a8000)				 = 135954432 (0x81a8000)
linux_brk(0x81a9000)				 = 135958528 (0x81a9000)
linux_brk(0x81aa000)				 = 135962624 (0x81aa000)
linux_brk(0x81ab000)				 = 135966720 (0x81ab000)
linux_brk(0x81ac000)				 = 135970816 (0x81ac000)
linux_brk(0x81ad000)				 = 135974912 (0x81ad000)
linux_brk(0x81ae000)				 = 135979008 (0x81ae000)
linux_brk(0x81af000)				 = 135983104 (0x81af000)
linux_brk(0x81b0000)				 = 135987200 (0x81b0000)
linux_brk(0x81b1000)				 = 135991296 (0x81b1000)
linux_brk(0x81b2000)				 = 135995392 (0x81b2000)
linux_brk(0x81b3000)				 = 135999488 (0x81b3000)
linux_brk(0x81b4000)				 = 136003584 (0x81b4000)
linux_brk(0x81b5000)				 = 136007680 (0x81b5000)
linux_brk(0x81b6000)				 = 136011776 (0x81b6000)
linux_brk(0x81b7000)				 = 136015872 (0x81b7000)
linux_brk(0x81b8000)				 = 136019968 (0x81b8000)
linux_brk(0x81b9000)				 = 136024064 (0x81b9000)
linux_brk(0x81ba000)				 = 136028160 (0x81ba000)
linux_brk(0x81bb000)				 = 136032256 (0x81bb000)
linux_brk(0x81bc000)				 = 136036352 (0x81bc000)
linux_brk(0x81bd000)				 = 136040448 (0x81bd000)
linux_brk(0x81be000)				 = 136044544 (0x81be000)
linux_brk(0x81bf000)				 = 136048640 (0x81bf000)
linux_brk(0x81c0000)				 = 136052736 (0x81c0000)
linux_brk(0x81c1000)				 = 136056832 (0x81c1000)
linux_brk(0x81c2000)				 = 136060928 (0x81c2000)
linux_brk(0x81c3000)				 = 136065024 (0x81c3000)
linux_brk(0x81c4000)				 = 136069120 (0x81c4000)
linux_brk(0x81c5000)				 = 136073216 (0x81c5000)
linux_brk(0x81c6000)				 = 136077312 (0x81c6000)
linux_brk(0x81c7000)				 = 136081408 (0x81c7000)
linux_brk(0x81c8000)				 = 136085504 (0x81c8000)
linux_brk(0x81c9000)				 = 136089600 (0x81c9000)
linux_brk(0x81ca000)				 = 136093696 (0x81ca000)
linux_brk(0x81cb000)				 = 136097792 (0x81cb000)
linux_brk(0x81cc000)				 = 136101888 (0x81cc000)
linux_brk(0x81cd000)				 = 136105984 (0x81cd000)
linux_brk(0x81ce000)				 = 136110080 (0x81ce000)
linux_brk(0x81cf000)				 = 136114176 (0x81cf000)
linux_brk(0x81d0000)				 = 136118272 (0x81d0000)
linux_brk(0x81d1000)				 = 136122368 (0x81d1000)
linux_brk(0x81d2000)				 = 136126464 (0x81d2000)
linux_brk(0x81d3000)				 = 136130560 (0x81d3000)
linux_brk(0x81d4000)				 = 136134656 (0x81d4000)
linux_brk(0x81dd000)				 = 136171520 (0x81dd000)
linux_mmap(0xbfbff350)				 = 674205696 (0x282f9000)
linux_brk(0x81e4000)				 = 136200192 (0x81e4000)
linux_newuname(0xbfbff240)			 = 0 (0x0)
gettimeofday(0xbfbfd278,0x0)			 = 0 (0x0)
linux_getpid()					 = 90984 (0x16368)
linux_open("/etc/resolv.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbfd0c0,0xbfbfcff0)	 = 0 (0x0)
linux_mmap(0xbfbfd090)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 37 (0x25)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_socketcall(0x1,0xbfbff1f0)		 = 6 (0x6)
linux_socketcall(0x3,0xbfbff1c0)		 ERR#2 'No such file or directory'
close(6)					 = 0 (0x0)
linux_open("/etc/nsswitch.conf",0x0,0666)	 = 6 (0x6)
linux_fstat64(0x6,0xbfbff160,0xbfbff090)	 = 0 (0x0)
linux_mmap(0xbfbff130)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 1744 (0x6d0)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("/usr/local/lib/libnss_files.so.2",0x0,01146) ERR#2 'No such file or directory'
linux_open("./libnss_files.so.2",0x0,01146)	 ERR#2 'No such file or directory'
linux_open("/etc/ld.so.cache",0x0,027757765250)	 = 6 (0x6)
linux_fstat64(0x6,0xbfbfe9e0,0xbfbfe930)	 = 0 (0x0)
linux_mmap(0xbfbfe9b0)				 = 672714752 (0x2818d000)
close(6)					 = 0 (0x0)
linux_open("/lib/libnss_files.so.2",0x0,027757765310) = 6 (0x6)
read(0x6,0xbfbfeb14,0x400)			 = 1024 (0x400)
linux_fstat64(0x6,0xbfbfea20,0xbfbfe910)	 = 0 (0x0)
linux_mmap(0xbfbfe900)				 = 675487744 (0x28432000)
mprotect(0x2843c000,0x5a0,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe900)				 = 675528704 (0x2843c000)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x1a53)			 = 0 (0x0)
linux_open("/etc/host.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff080,0xbfbfefb0)	 = 0 (0x0)
linux_mmap(0xbfbff050)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 17 (0x11)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("/etc/hosts",0x0,0666)		 = 6 (0x6)
linux_fcntl64(0x6,0x1,0x0)			 = 0 (0x0)
linux_fcntl64(0x6,0x2,0x1)			 = 0 (0x0)
linux_fstat64(0x6,0xbfbff060,0xbfbfef90)	 = 0 (0x0)
linux_mmap(0xbfbff030)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 1038 (0x40e)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("/usr/local/lib/libnss_nisplus.so.2",0x0,01007433070) ERR#2 'No such file or directory'
linux_open("./libnss_nisplus.so.2",0x0,01007433070) ERR#2 'No such file or directory'
linux_open("/etc/ld.so.cache",0x0,027757765310)	 = 6 (0x6)
linux_fstat64(0x6,0xbfbfea00,0xbfbfe950)	 = 0 (0x0)
linux_mmap(0xbfbfe9d0)				 = 672714752 (0x2818d000)
close(6)					 = 0 (0x0)
linux_open("/lib/libnss_nisplus.so.2",0x0,027757765350) = 6 (0x6)
read(0x6,0xbfbfeb34,0x400)			 = 1024 (0x400)
linux_fstat64(0x6,0xbfbfea40,0xbfbfe930)	 = 0 (0x0)
linux_mmap(0xbfbfe920)				 = 675532800 (0x2843d000)
mprotect(0x28447000,0x1b80,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe920)				 = 675573760 (0x28447000)
close(6)					 = 0 (0x0)
linux_open("/usr/local/lib/libnsl.so.1",0x0,00)	 ERR#2 'No such file or directory'
linux_open("./libnsl.so.1",0x0,00)		 ERR#2 'No such file or directory'
linux_open("/lib/libnsl.so.1",0x0,00)		 = 6 (0x6)
read(0x6,0xbfbfe914,0x400)			 = 1024 (0x400)
linux_fstat64(0x6,0xbfbfe820,0xbfbfe710)	 = 0 (0x0)
linux_mmap(0xbfbfe700)				 = 675581952 (0x28449000)
mprotect(0x2845d000,0x2d3c,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe700)				 = 675663872 (0x2845d000)
linux_mmap(0xbfbfe700)				 = 675667968 (0x2845e000)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x1a53)			 = 0 (0x0)
linux_newuname(0xbfbff100)			 = 0 (0x0)
linux_open("/var/nis/NIS_COLD_START",0x0,0666)	 ERR#2 'No such file or directory'
linux_open("/var/nis/NIS_COLD_START",0x0,0666)	 ERR#2 'No such file or directory'
linux_open("/usr/local/lib/libnss_nis.so.2",0x0,01) ERR#2 'No such file or directory'
linux_open("./libnss_nis.so.2",0x0,01)		 ERR#2 'No such file or directory'
linux_open("/etc/ld.so.cache",0x0,027757765330)	 = 6 (0x6)
linux_fstat64(0x6,0xbfbfea10,0xbfbfe960)	 = 0 (0x0)
linux_mmap(0xbfbfe9e0)				 = 672714752 (0x2818d000)
close(6)					 = 0 (0x0)
linux_open("/lib/libnss_nis.so.2",0x0,027757765370) = 6 (0x6)
read(0x6,0xbfbfeb44,0x400)			 = 1024 (0x400)
linux_fstat64(0x6,0xbfbfea50,0xbfbfe940)	 = 0 (0x0)
linux_mmap(0xbfbfe930)				 = 675676160 (0x28460000)
mprotect(0x2846a000,0x864,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe930)				 = 675717120 (0x2846a000)
close(6)					 = 0 (0x0)
linux_brk(0x81e5000)				 = 136204288 (0x81e5000)
munmap(0x2818d000,0x1a53)			 = 0 (0x0)
linux_newuname(0xbfbff0b0)			 = 0 (0x0)
linux_open("/usr/local/lib/libnss_dns.so.2",0x0,025) ERR#2 'No such file or directory'
linux_open("./libnss_dns.so.2",0x0,025)		 ERR#2 'No such file or directory'
linux_open("/etc/ld.so.cache",0x0,027757765330)	 = 6 (0x6)
linux_fstat64(0x6,0xbfbfea10,0xbfbfe960)	 = 0 (0x0)
linux_mmap(0xbfbfe9e0)				 = 672714752 (0x2818d000)
close(6)					 = 0 (0x0)
linux_open("/lib/libnss_dns.so.2",0x0,027757765370) = 6 (0x6)
read(0x6,0xbfbfeb44,0x400)			 = 1024 (0x400)
linux_fstat64(0x6,0xbfbfea50,0xbfbfe940)	 = 0 (0x0)
linux_mmap(0xbfbfe930)				 = 675721216 (0x2846b000)
mprotect(0x2846f000,0x23c,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe930)				 = 675737600 (0x2846f000)
close(6)					 = 0 (0x0)
linux_open("/usr/local/lib/libresolv.so.2",0x0,00) ERR#2 'No such file or directory'
linux_open("./libresolv.so.2",0x0,00)		 ERR#2 'No such file or directory'
linux_open("/lib/libresolv.so.2",0x0,05006134600) = 6 (0x6)
read(0x6,0xbfbfe924,0x400)			 = 1024 (0x400)
linux_fstat64(0x6,0xbfbfe830,0xbfbfe720)	 = 0 (0x0)
linux_mmap(0xbfbfe710)				 = 675741696 (0x28470000)
mprotect(0x2847e000,0x3820,0x0)			 = 0 (0x0)
linux_mmap(0xbfbfe710)				 = 675799040 (0x2847e000)
linux_mmap(0xbfbfe710)				 = 675807232 (0x28480000)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x1a53)			 = 0 (0x0)
linux_socketcall(0x1,0xbfbfdc30)		 = 6 (0x6)
linux_socketcall(0x3,0xbfbfdc00)		 = 0 (0x0)
linux_socketcall(0x9,0xbfbfdbf0)		 = 34 (0x22)
gettimeofday(0xbfbfdcc8,0x0)			 = 0 (0x0)
poll(0xbfbfdcc0,0x1,0x1388)			 = 1 (0x1)
linux_socketcall(0xc,0xbfbfdbe0)		 = 133 (0x85)
close(6)					 = 0 (0x0)
linux_open("tibjmsd.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("tibjmsd.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("tibjmsd.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff1e0,0xbfbff110)	 = 0 (0x0)
linux_mmap(0xbfbff1b0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
linux_open("/etc/localtime",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff010,0xbfbfef40)	 = 0 (0x0)
linux_mmap(0xbfbfefe0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 1267 (0x4f3)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,56)				 = 56 (0x38)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,42)				 = 42 (0x2a)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_ioctl(0x0,0x5401,0xbfbfecb0)		 ERR#45 'Operation not supported'
linux_getuid()					 = 1000 (0x3e8)
linux_brk(0x81e6000)				 = 136208384 (0x81e6000)
linux_socketcall(0x1,0xbfbff240)		 = 6 (0x6)
linux_socketcall(0x3,0xbfbff210)		 ERR#2 'No such file or directory'
close(6)					 = 0 (0x0)
linux_open("/etc/passwd",0x0,0666)		 = 6 (0x6)
linux_fcntl64(0x6,0x1,0x0)			 = 0 (0x0)
linux_fcntl64(0x6,0x2,0x1)			 = 0 (0x0)
linux_fstat64(0x6,0xbfbff180,0xbfbff0b0)	 = 0 (0x0)
linux_mmap(0xbfbff150)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 1263 (0x4ef)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_rt_sigprocmask(0x2,0x0,0xbfbff2d4,0x8)	 = 0 (0x0)
write(5,0xbfbff2c0,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff210,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
linux_rt_sigsuspend(0xbfbff210,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbfef1c)			 ERR#4 'Interrupted system call'
linux_brk(0x81e7000)				 = 136212480 (0x81e7000)
linux_brk(0x81e8000)				 = 136216576 (0x81e8000)
gettimeofday(0xbfbff388,0x0)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
gettimeofday(0xbfbff388,0x0)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
gettimeofday(0xbfbff388,0x0)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,28)				 = 28 (0x1c)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,22)				 = 22 (0x16)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,20)				 = 20 (0x14)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,26)				 = 26 (0x1a)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_time(0xbfbff34c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcc40,20)				 = 20 (0x14)
write(2,0xbfbfccb0,30)				 = 30 (0x1e)
write(2,0xbfbfcc90,1)				 = 1 (0x1)
linux_brk(0x81e9000)				 = 136220672 (0x81e9000)
linux_open("users.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("users.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff1c0,0xbfbff0f0)	 = 0 (0x0)
linux_mmap(0xbfbff190)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 23 (0x17)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_getpid()					 = 90984 (0x16368)
linux_open("groups.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("groups.conf",0x0,0666)		 = 6 (0x6)
linux_brk(0x81ea000)				 = 136224768 (0x81ea000)
linux_fstat64(0x6,0xbfbff0c0,0xbfbfeff0)	 = 0 (0x0)
linux_mmap(0xbfbff090)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 33 (0x21)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("topics.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("topics.conf",0x0,0666)		 = 6 (0x6)
linux_brk(0x81eb000)				 = 136228864 (0x81eb000)
linux_fstat64(0x6,0xbfbff1e0,0xbfbff110)	 = 0 (0x0)
linux_mmap(0xbfbff1b0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("queues.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("queues.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff1e0,0xbfbff110)	 = 0 (0x0)
linux_mmap(0xbfbff1b0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("acl.conf",0x0,0666)			 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("acl.conf",0x0,0666)			 = 6 (0x6)
linux_fstat64(0x6,0xbfbff1e0,0xbfbff110)	 = 0 (0x0)
linux_mmap(0xbfbff1b0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("routes.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("routes.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff200,0xbfbff130)	 = 0 (0x0)
linux_mmap(0xbfbff1d0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_open("factories.conf",0x0,0666)		 = 6 (0x6)
close(6)					 = 0 (0x0)
linux_open("factories.conf",0x0,0666)		 = 6 (0x6)
linux_fstat64(0x6,0xbfbff200,0xbfbff130)	 = 0 (0x0)
linux_mmap(0xbfbff1d0)				 = 672714752 (0x2818d000)
read(0x6,0x2818d000,0x2000)			 = 0 (0x0)
close(6)					 = 0 (0x0)
munmap(0x2818d000,0x2000)			 = 0 (0x0)
linux_time(0x0)					 = 1020298821 (0x3cd08645)
gettimeofday(0xbfbff388,0x0)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
linux_kill(0x1636b,0x20)			 = 0 (0x0)
linux_rt_sigprocmask(0x2,0x0,0xbfbff2d4,0x8)	 = 0 (0x0)
write(5,0xbfbff2c0,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff210,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
linux_rt_sigsuspend(0xbfbff210,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbfef1c)			 ERR#4 'Interrupted system call'
linux_rt_sigprocmask(0x2,0x0,0xbfbff304,0x8)	 = 0 (0x0)
write(5,0xbfbff2f0,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff240,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
linux_rt_sigsuspend(0xbfbff240,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbfef4c)			 ERR#4 'Interrupted system call'
linux_rt_sigprocmask(0x2,0x0,0xbfbff304,0x8)	 = 0 (0x0)
write(5,0xbfbff2f0,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff240,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
linux_rt_sigsuspend(0xbfbff240,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbfef4c)			 ERR#4 'Interrupted system call'
linux_time(0x0)					 = 1020298821 (0x3cd08645)
linux_socketcall(0x1,0xbfbff210)		 = 6 (0x6)
linux_socketcall(0xe,0xbfbff200)		 = 0 (0x0)
linux_socketcall(0x2,0xbfbff210)		 = 0 (0x0)
linux_socketcall(0x4,0xbfbff210)		 = 0 (0x0)
linux_fcntl64(0x6,0x3,0x0)			 = 2 (0x2)
linux_socketcall(0x9,0xbfbff140)		 = 1 (0x1)
linux_time(0xbfbff21c)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcb10,20)				 = 20 (0x14)
write(2,0xbfbfcb80,53)				 = 53 (0x35)
write(2,0xbfbfcb60,1)				 = 1 (0x1)
linux_open("sync-msgs.db",0x0,0666)		 ERR#2 'No such file or directory'
linux_open("meta.db",0x8042,0666)		 = 7 (0x7)
linux_fcntl64(0x7,0xd,0xbfbff2e0)		 ERR#22 'Invalid argument'
close(7)					 = 0 (0x0)
linux_time(0xbfbff2dc)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfcbd0,20)				 = 20 (0x14)
write(2,0xbfbfcc20,7)				 = 7 (0x7)
write(2,0xbfbfcc40,59)				 = 59 (0x3b)
write(2,0xbfbfcc20,1)				 = 1 (0x1)
linux_time(0xbfbff3bc)				 = 1020298821 (0x3cd08645)
write(2,0xbfbfccb0,20)				 = 20 (0x14)
write(2,0xbfbfcd00,7)				 = 7 (0x7)
write(2,0xbfbfcd20,30)				 = 30 (0x1e)
write(2,0xbfbfcd00,1)				 = 1 (0x1)
write(5,0xbfbff3e0,148)				 = 148 (0x94)
linux_rt_sigprocmask(0x2,0x0,0xbfbff330,0x8)	 = 0 (0x0)
SIGNAL 32
SIGNAL 32
SIGNAL 32
SIGNAL 20
linux_rt_sigsuspend(0xbfbff330,0x8)		 ERR#4 'Interrupted system call'
linux_sigreturn(0xbfbff03c)			 ERR#4 'Interrupted system call'
linux_wait4(0x16369,0x0,0x80000000,0x0)		 = 90985 (0x16369)
exit(0x1)					process exit, rval = 256

---------End Full truss output---------------

>How-To-Repeat:
	
	Download 'TIBCO Enterprise for JMS Server.' for linux product 
	from www.tibco.com (requires registration).

	unpack tarball.  '/compat/linux/bin/sh tibinstall.sh' - follow
	instructions.

	After install, run tibjmsd.  Observe output.
>Fix:

	Unknown


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: robert 
State-Changed-When: Tue Jul 9 08:45:28 PDT 2002 
State-Changed-Why:  
I will try to solve this one. 


Responsible-Changed-From-To: freebsd-bugs->robert 
Responsible-Changed-By: robert 
Responsible-Changed-When: Tue Jul 9 08:45:28 PDT 2002 
Responsible-Changed-Why:  
I will try to solve this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37656 

From: Ian Dowse <iedowse@maths.tcd.ie>
To: John Brann <john@brann.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/37656: Linux emulator 'Invalid Argument' error in 'linux_fcntl64()'
Date: Sun, 08 Dec 2002 15:48:11 +0000

 Hi, could you try the following patch. This is against a recent
 -STABLE, but I think it should apply to source as old as 4.5-RELEASE.
 
 Ian
 
 Index: sys/i386/linux/linux.h
 ===================================================================
 RCS file: /home/iedowse/CVS/src/sys/i386/linux/linux.h,v
 retrieving revision 1.41.2.3
 diff -u -r1.41.2.3 linux.h
 --- sys/i386/linux/linux.h	5 Nov 2001 19:08:23 -0000	1.41.2.3
 +++ sys/i386/linux/linux.h	8 Dec 2002 15:20:10 -0000
 @@ -495,6 +495,10 @@
  #define	LINUX_F_SETOWN		8
  #define	LINUX_F_GETOWN		9
  
 +#define	LINUX_F_GETLK64		12
 +#define	LINUX_F_SETLK64		13
 +#define	LINUX_F_SETLKW64	14
 +
  #define	LINUX_F_RDLCK		0
  #define	LINUX_F_WRLCK		1
  #define	LINUX_F_UNLCK		2
 Index: sys/compat/linux/linux_file.c
 ===================================================================
 RCS file: /home/iedowse/CVS/src/sys/compat/linux/linux_file.c,v
 retrieving revision 1.41.2.5
 diff -u -r1.41.2.5 linux_file.c
 --- sys/compat/linux/linux_file.c	5 Nov 2001 19:08:22 -0000	1.41.2.5
 +++ sys/compat/linux/linux_file.c	8 Dec 2002 15:17:24 -0000
 @@ -851,10 +851,16 @@
  fcntl_common(struct proc *p, struct linux_fcntl64_args *args)
  {
  	struct fcntl_args fcntl_args;
 +	struct l_flock linux_flock;
 +	struct flock *bsd_flock;
  	struct filedesc *fdp;
  	struct file *fp;
 +	caddr_t sg;
  	int error, result;
  
 +	sg = stackgap_init();
 +	bsd_flock = (struct flock *)stackgap_alloc(&sg, sizeof(*bsd_flock));
 +
  	fcntl_args.fd = args->fd;
  
  	switch (args->cmd) {
 @@ -906,50 +912,6 @@
  		fcntl_args.cmd = F_SETFL;
  		return (fcntl(p, &fcntl_args));
  
 -	case LINUX_F_GETOWN:
 -		fcntl_args.cmd = F_GETOWN;
 -		return (fcntl(p, &fcntl_args));
 -
 -	case LINUX_F_SETOWN:
 -		/*
 -		 * XXX some Linux applications depend on F_SETOWN having no
 -		 * significant effect for pipes (SIGIO is not delivered for
 -		 * pipes under Linux-2.2.35 at least).
 -		 */
 -		fdp = p->p_fd;
 -		if ((u_int)args->fd >= fdp->fd_nfiles ||
 -		    (fp = fdp->fd_ofiles[args->fd]) == NULL)
 -			return (EBADF);
 -		if (fp->f_type == DTYPE_PIPE)
 -			return (EINVAL);
 -
 -		fcntl_args.cmd = F_SETOWN;
 -		fcntl_args.arg = args->arg;
 -		return (fcntl(p, &fcntl_args));
 -	}
 -
 -	return (EINVAL);
 -}
 -
 -int
 -linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
 -{
 -	struct linux_fcntl64_args args64;
 -	struct fcntl_args fcntl_args;
 -	struct l_flock linux_flock;
 -	struct flock *bsd_flock;
 -	int error;
 -	caddr_t sg;
 -
 -	sg = stackgap_init();
 -	bsd_flock = (struct flock *)stackgap_alloc(&sg, sizeof(bsd_flock));
 -
 -#ifdef DEBUG
 -	if (ldebug(fcntl))
 -		printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd);
 -#endif
 -
 -	switch (args->cmd) {
  	case LINUX_F_GETLK:
  		error = copyin((caddr_t)args->arg, &linux_flock,
  		    sizeof(linux_flock));
 @@ -987,8 +949,42 @@
  		fcntl_args.cmd = F_SETLKW;
  		fcntl_args.arg = (long)bsd_flock;
  		return (fcntl(p, &fcntl_args));
 +
 +	case LINUX_F_GETOWN:
 +		fcntl_args.cmd = F_GETOWN;
 +		return (fcntl(p, &fcntl_args));
 +
 +	case LINUX_F_SETOWN:
 +		/*
 +		 * XXX some Linux applications depend on F_SETOWN having no
 +		 * significant effect for pipes (SIGIO is not delivered for
 +		 * pipes under Linux-2.2.35 at least).
 +		 */
 +		fdp = p->p_fd;
 +		if ((u_int)args->fd >= fdp->fd_nfiles ||
 +		    (fp = fdp->fd_ofiles[args->fd]) == NULL)
 +			return (EBADF);
 +		if (fp->f_type == DTYPE_PIPE)
 +			return (EINVAL);
 +
 +		fcntl_args.cmd = F_SETOWN;
 +		fcntl_args.arg = args->arg;
 +		return (fcntl(p, &fcntl_args));
  	}
  
 +	return (EINVAL);
 +}
 +
 +int
 +linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
 +{
 +	struct linux_fcntl64_args args64;
 +
 +#ifdef DEBUG
 +	if (ldebug(fcntl))
 +		printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd);
 +#endif
 +
  	args64.fd = args->fd;
  	args64.cmd = args->cmd;
  	args64.arg = args->arg;
 @@ -1006,7 +1002,7 @@
  	caddr_t sg;
  
  	sg = stackgap_init();
 -	bsd_flock = (struct flock *)stackgap_alloc(&sg, sizeof(bsd_flock));
 +	bsd_flock = (struct flock *)stackgap_alloc(&sg, sizeof(*bsd_flock));
  
  #ifdef DEBUG
  	if (ldebug(fcntl64))
 @@ -1014,7 +1010,7 @@
  #endif
  
  	switch (args->cmd) {
 -	case LINUX_F_GETLK:
 +	case LINUX_F_GETLK64:
  		error = copyin((caddr_t)args->arg, &linux_flock,
  		    sizeof(linux_flock));
  		if (error)
 @@ -1030,7 +1026,7 @@
  		return (copyout(&linux_flock, (caddr_t)args->arg,
  		    sizeof(linux_flock)));
  
 -	case LINUX_F_SETLK:
 +	case LINUX_F_SETLK64:
  		error = copyin((caddr_t)args->arg, &linux_flock,
  		    sizeof(linux_flock));
  		if (error)
 @@ -1041,7 +1037,7 @@
  		fcntl_args.arg = (long)bsd_flock;
  		return (fcntl(p, &fcntl_args));
  
 -	case LINUX_F_SETLKW:
 +	case LINUX_F_SETLKW64:
  		error = copyin((caddr_t)args->arg, &linux_flock,
  		    sizeof(linux_flock));
  		if (error)
 
State-Changed-From-To: analyzed->closed 
State-Changed-By: iedowse 
State-Changed-When: Sun Feb 29 14:09:14 PST 2004 
State-Changed-Why:  

This was fixed and MFC'd by linux_file.c revisions 1.72 and 1.41.2.6 
respectively. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37656 
>Unformatted:
