Subject: Re: COMPAT_LINUX: why getpid() turned into a chown()?
To: None <p99dreyf@criens.u-psud.fr,tech-kern@netbsd.org>
From: Ben Harris <bjh21@netbsd.org>
List: tech-kern
Date: 01/30/2001 01:02:14
In article <1eo0rkc.y1rdqy1fqqnxkM@[10.0.12.137]> you write:
>I've now been stuck for more than a week on the same bug: When running
>Netscape in emulation, a getpid() turns into a chown(), and it fails.
>
>If I run Netscape on Linux, I have a setgid(), if I run it on NetBSD,
>that setgid() is turned into a chown(). chown() is really called (I can
>see that by doing a printf in kernel chown routine)so it's not a ktrace
>problem. And it is called with a first argument which is not a filename.
>It's my PID. So I assume Netscape really intended to do a setgid().
>
>Now, I think that the problem could hide in glibc. Anyone has an idea of
>how could I trace Netscape before entering kernel? gdb fails to do it,
>it asks me for a thread id.
>
>Please help, I'm stuck!

What I'd do on arm26 (and I've no idea if this will help on powerpc) is to
put a DDB breakpoint in sys_chown(), then find out the user program counter
at this point and disassemble around it to see what's going on.  This should
show you what syscall the code is intending to call.

[ Incidentaly, the last message I sent you should have gone to the list as
  well, but I forgot and lost my only copy.  Feel free to reply to the
  list. ]

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>