Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 1996 15:03:53 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        amora@obelix.cica.es (Jesus A. Mora Marin)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: troubles with IBCS emulation
Message-ID:  <199604292203.PAA05259@phaeton.artisoft.com>
In-Reply-To: <199604291247.OAA21154@obelix.cica.es> from "Jesus A. Mora Marin" at Apr 29, 96 02:47:18 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I have got the shared libs `libc_s' and `libnsl_s' from SCO Unix 386
> 3.2.`something else' and copied them into a new directory `/shlib'. I tested
> the new kernel with Korn Shell obtained from a more recent version of SCO Unix
> and it ran smoothly. So I added a new ad-hoc account `informix' and installed
> Informix 4.1 (Standard Engine, ISQL and RDS) on its home directory. But when
> I try to execute any sentence inside the SQL I get an "engine terminated
> unexpectedly" or something alike. On console, the following message arises:
> "jammsys/kernel: pid <pid>: sqlexec: uid <informix' uid>: exited on signal 10"
> 
> ktracing the sqlexec process this dump results:
> 
>       <pid> sqlexec     RET     read 53/0x34
>                         CALL    old.lstat(0xefbfdc2a, 0, 0x1, 0, 0)
>                         RET     old.lstat 0
>                         PSIG    SIGBUS SIG_DFL
>                         NAMI    "sqlexec.core"
> 
> The question is whether I have missed some crucial point or not. I am very
> interested in this matter, so any suggestion, comment or hint will be
> welcome and greatly appreciated. Thanks a lot.

This indicates that the lstat system call is trying to copy out to a bad
address in user space.  This is to be expected, since lstat's arguments
are:

	int
	lstat(const char *path, struct stat *sb)

And Informix is apparently passing a '0' as the stat target.

There are a couple of possibilities:

1)	This is a cascade error, and whatever came up with the 0
	is where the real error lives.

2)	SCO has a "magic" lstat, and is using a NULL to say "don't
	copy crap out" and Informix is using this to make a call
	like "access(2)".

3)	This is a genuine error in Informix, but since SCO maps
	page 0, a "copy out" to page zero doesn't fail, and
	Informix doesn't actually use the results of the lstat,
	(or does, without knowledge that it's dereferencing a
	NULL pointer to get the data).


Case #1 requires you trace the origin of the NULL in the code.

Case #2 can be handled by hacking the downcall interface in the
IBCS2 module to call access if the stat buffer isn't there.

Case #3 would require changing the page mapping, and is better
served by reporting the rror to Informix so it can be fixed,
instead.


Generally, since lstat(0 is useed to read targets for symbolic
links, dumping the string at 0xefbfdc2a when the error occurs to
get the name of the file, and making it a real file instead of a
link, may cause the lstat to not be called (ie: this could be #3,
but it only shows up when you install Informix wierd).


If it can be made to work under Linux, it can be made to work
under BSD.



> PS.: By the way, two additional questions of less interest:
> 1) Is there any way to execute old Xenix-286 binaries? Current implementation
>    of IBCS doesn't seem to recognize them. I wonder whether the 286-emulator
>    included in SCO Unix 386 is of any value.

It would if we could run Xenix 386 binaries.  8-).

> 2) Can be supported emulation for IBCS and Linux on the same kernel?

Yes.  Just enable them.  They don't use conflicting magic numbers
(which would be theonly real problem).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604292203.PAA05259>