RE: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Dave Korn
Brian Dessent wrote on 12 March 2008 17:25: > a) figure out which module of the process is the main one > b) look up its ImageBase > c) compute which page in that processes' VM corresponds to that > ImageBase plus some magic offset (which also implicitly means that all > subsystems must use exactl

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Brian Dessent
Dave Korn wrote: > Given that, it's therefore going to have been done as quickly and cheaply > as possible, so why should we assume they wouldn't they just check the value > in the PE header at the start of NtSetInformationProcess? I know it's MS and everything, and if the subject was Outlook o

RE: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Dave Korn
Corinna Vinschen wrote on 12 March 2008 16:23: > On Mar 12 16:13, Dave Korn wrote: > > Brian Dessent wrote on 12 March 2008 15:59: > > > Dave Korn wrote: > > > > Now, who supposes you could work around the restriction by writing > > > > > > > > * (WORD *) 0x004000dc = POSIX_CUI; > > > > > >

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Corinna Vinschen
On Mar 12 16:13, Dave Korn wrote: > Brian Dessent wrote on 12 March 2008 15:59: > > Dave Korn wrote: > > > Now, who supposes you could work around the restriction by writing > > > > > > * (WORD *) 0x004000dc = POSIX_CUI; > > > > > > just before calling NtSetInformation? > > > > How are you g

RE: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Dave Korn
Brian Dessent wrote on 12 March 2008 15:59: > Dave Korn wrote: > > > Now, who supposes you could work around the restriction by writing > > > > * (WORD *) 0x004000dc = POSIX_CUI; > > > > just before calling NtSetInformation? > > How are you going to fool the executive by poking around in t

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Brian Dessent
Dave Korn wrote: > Now, who supposes you could work around the restriction by writing > > * (WORD *) 0x004000dc = POSIX_CUI; > > just before calling NtSetInformation? How are you going to fool the executive by poking around in the PE header from userspace long after the process has initiali

RE: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Dave Korn
Brian Dessent wrote on 12 March 2008 15:00: > Dave Korn wrote: > > > The native API, to the very best of my knowledge, exports exactly the > > same set of interfaces to every subsystem. Can you explain exactly > > what you're talking about here? > > Microsoft Windows Internals, 4th. Ed (Russi

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Brian Dessent
Dave Korn wrote: > The native API, to the very best of my knowledge, exports exactly the same > set of interfaces to every subsystem. Can you explain exactly what you're > talking about here? Microsoft Windows Internals, 4th. Ed (Russinovich & Solomon), p. 60: > Because POSIX.1 compliance was

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Corinna Vinschen
On Mar 12 12:16, Dave Korn wrote: > Brian Dessent wrote on 11 March 2008 04:56: > > > - When the testcase's binary is located anywhere but %windir% or > > %windir%\system32, then everything is fine. > > - Otherwise you get: > > Ah. So the error only arises when the binary is located in windows

RE: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-12 Thread Dave Korn
Brian Dessent wrote on 11 March 2008 04:56: > - When the testcase's binary is located anywhere but %windir% or > %windir%\system32, then everything is fine. > - Otherwise you get: Ah. So the error only arises when the binary is located in windows system dir. Right alongside all those thousand

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-10 Thread Brian Dessent
Linda Walsh wrote: > There...now you've done it. You had me break 'gdb'. Alright, let me see if I can summarize this entire failure into something that's hopefully repeatable by anyone looking to reproduce it: - The reduced testcase is: int main(int, char **) { fork(); } - Working direc

Re: Bug: C-prog from Win dies in fork; gdb.exe also won't run

2008-03-10 Thread Linda Walsh
Brian Dessent wrote: Linda Walsh wrote: Perhaps -- you don't, but my first symptom of a problem was a simple cygwin program refusing to run from cmd.exe. At the same time, I'm having problems with 'bash' (or 'ash') as launched from windows as well -- in both cases, the programs "used