Bug 41249 - iBCS looses command line arguments
iBCS looses command line arguments
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
6.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Arjan van de Ven
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-18 08:16 EDT by Need Real Name
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-06-14 18:35:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
a SCO COFF binary to test the arguments bug (29.60 KB, application/octet-stream)
2001-06-14 18:19 EDT, urs.rau
no flags Details
A SCO COFF binary to test the getenv() bug (45.51 KB, application/octet-stream)
2001-06-14 18:21 EDT, urs.rau
no flags Details
source code for SCO binary for revealing the bug (124 bytes, text/plain)
2001-06-14 18:22 EDT, urs.rau
no flags Details
source code for printTERM SCO COFF binary for revealing the bug (161 bytes, text/plain)
2001-06-14 18:24 EDT, urs.rau
no flags Details

  None (edit)
Description Need Real Name 2001-05-18 08:16:07 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)

Description of problem:
After upgrading the kernel from version 2.2.16-3 to version 2.2.19-6.2.1 
we realized the following problem:
An 80386 COFF executable running through iBCS no longer picks up its 
command line arguments. 


How reproducible:
Always

Steps to Reproduce:
1. Create the following c program as arg.c:
#include <stdio.h>
main(int argc, char *argv[])
{
    int i;
    for(i=0; i < argc; i++) printf("%s\n", argv[i]);
}
2. Compile it on SCO Unix:
cc -o arg arg.c
3. Run it:
$ ./arg hello there
./arg
hello
there
4. Copy the executable to Linux kernel 2.2.16, and run it:
$ ./arg hello there
./arg
hello
there
5. Copy the executable to Linux kernel 2.2.19, and run it:
$ ./arg hello there
./arg


6. This results in blank lines being printed, but no arguments.
7. Compile the original program under Linux, and it works as expected.

Actual Results:  Output was the following
./arg
<blank line>
<blank line>

Expected Results:  ./arg
hello
there

Additional info:

This is a trivial example to demonstrate the bug, but the actual error was 
discovered trying to run a commercial SCO product.  I do not have access 
to its source, so cannot fix it from that side, but we need to run our 
database!
Comment 1 Arjan van de Ven 2001-05-18 09:37:06 EDT
I think I've fixed the bug. I've recompiled a 2.2.19 kernel with the fix,
could you please try it?

I'm uploading it to http://people.redhat.com/arjanv/2.2.19

(can be a few minutes before it's there, I'm on a rather slow link)
Comment 2 Arjan van de Ven 2001-05-18 09:56:10 EDT
What kernel do you need exactly? i686-enterprise ?
Comment 3 holgerschurig 2001-06-05 02:49:26 EDT
By the way: a SCO binary of mine can't suddenly do getenv("TERM") anymore, it 
always tells "Terminal type 'unknown' is not known".
Comment 4 Arjan van de Ven 2001-06-05 06:19:54 EDT
holgerschurig@gmx.de: was this with the updated kernel ?
Comment 5 urs.rau 2001-06-14 18:19:26 EDT
Created attachment 21122 [details]
a SCO COFF binary to test the arguments bug
Comment 6 urs.rau 2001-06-14 18:21:12 EDT
Created attachment 21123 [details]
A SCO COFF binary to test the getenv() bug
Comment 7 urs.rau 2001-06-14 18:22:45 EDT
Created attachment 21124 [details]
source code for SCO binary for revealing the bug
Comment 8 urs.rau 2001-06-14 18:24:37 EDT
Created attachment 21125 [details]
source code for printTERM SCO COFF binary for revealing the bug
Comment 9 urs.rau 2001-06-14 18:30:53 EDT
Dear arjanv@redhat.com thank you for your quick response on this bug. And I am 
very sorry we didn't give you feed back in a timely manner too.

I have just verified your build 2.2.19-7.0.2 that you had uploaded within an 
hour and fifteen minutes (impressive).

Both of the reported bugs, the problem with loosing command line arguments as 
well as the problem in getting the environment variable were/are solved in your 
build 2.2.19-7.0.2.

How do we go about either getting the specific patch/diff, or alternatively the 
SRPM, that will fix our problem? So that we can recompile the kernel code for 
our machines?


Comment 10 urs.rau 2001-06-14 18:35:07 EDT
As I said a minute ago the problem is fixed BUT there is one cosmetical thing 
that did happen when I tested the lost arguments bug. I did get the following 6 
lines of warnings output to the screen before the expected and correct output 
of arg.coff 

./arg.coff hello world
libc: setlocale: LC_CTYPE: unable to open /etc/default/lang
libc: setlocale: LC_NUMERIC: unable to open /etc/default/lang
libc: setlocale: LC_TIME: unable to open /etc/default/lang
libc: setlocale: LC_COLLATE: unable to open /etc/default/lang
libc: setlocale: LC_MESSAGES: unable to open /etc/default/lang
libc: setlocale: LC_MONETARY: unable to open /etc/default/lang
./arg.coff
hello
world

Comment 11 Arjan van de Ven 2001-06-27 05:17:43 EDT
A fixed kernel has been released officially yesterday;
thanks for confirming the fix.

Note You need to log in before you can comment on or make changes to this bug.