[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSProcessInfo on linux 2.2 vs 2.4

From: Karl Kraft
Subject: Re: NSProcessInfo on linux 2.2 vs 2.4
Date: Thu, 12 Apr 2001 14:31:44 -0700

What 2.4 kernel are you using?  I'm on a Redhat 6.2 system that I've
upgraded to kernel 2.4.3, with the patches for the loopback file system.
I'm building straight out of current CVS.

My understanding of your comment in ChangeLog is that 2.2 kernels would
always throw away the last argument, not just empty last arguments.  If what
you now say is true, then I can live with the current setup in 2.2, but I
still need it to work in 2.4.

I'm consistently getting a segfault in +[NSProcessInfo load] on any program
I try to run.    If I call with no arguments, then _gnu_noobjc_argc==1,
which I expect.  After pulling the program name and storing it, it hits the
EOF, and trys to store EOF into _gnu_noobjc_argv[1][0], and while
_gnu_noobjc_argv[1] is a valid memory address (there is a +1 on line 345),
it contains null instead of a valid pointer (  line 369 breaks before
_gnu_noobjc_argv[1] because _gnu_noobjc_argc is 1)

So I don't see how this code could work given my current setup.

I've started rewriting the code to make it cleaner by just reading the file
twice, once to get the size, and then reading the entire file into memory,
and simply setting pointers to point to the start of each argument, but
before I finish, can you see something I'm missing as to why this is working
for you on 2.4, but not for me?

Also, I've checked the compile farm at source forge, and the FreeBSD machine
they have there uses a cmdline in the same file format as linux 2.4.   I
have no idea why the strip newline stuff appears at the bottom of this file.
Does anyone have a pointer as to why this code is in there?

----- Original Message -----
From: "Richard Frith-Macdonald" <address@hidden>
To: "Karl Kraft" <address@hidden>
Sent: Thursday, April 12, 2001 10:33
Subject: Re: NSProcessInfo on linux 2.2 vs 2.4

> On Thursday, April 12, 2001, at 06:04 PM, Karl Kraft wrote:
> > I recently upgraded a local box to 2.4 for testing out GNUstep, and
> > found
> > some problems with [NSProcessInfo arguments], namely that every program
> > got
> > an extra empty argument at the end.
> >
> > Before I could fix +[NSProcessInfo load], Richard patched it.  However,
> > this
> > new patch just causes the program to segfault, and the comment by
> > Richard in
> > the ChangeLog is that the patch will no longer work on 2.2 kernels,
> > which I
> > expect I will still be supporting for the next three years.
> Not at all ... the current code works fine on my 2.2 and 2.4 series
> kernels.
> It certainly doesn't segfault.
> It's just that, if on a 2.2 series system you pass an empty final
> argument,
> NSProcessInfo won't know about it.  About the only time this has
> mattered to
> me is when trying to set a user default to an empty string.
> I think ideally we should have configure check the kernel version to
> allow
> us to do a perfect job on both kernels though.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]