Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

RE: ksh dumping core (dep off)

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> RE: ksh dumping core (dep off) Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
RE: ksh dumping core (dep off) - Sep. 10, '05, 6:42:18 AM   
prj32

 

Posts: 29
Joined: Oct. 16, '04,
Status: offline
Anyone seen this when executing perl? (after having the abovementioned patch applied). I haven't yet disabled DEP (need to arrange reboot) - however I have tried inserting PSXSS.EXE into the DEP exclusion list, which doesn't sort it out.

$ perl
Memory fault (core dumped)

(in reply to Rodney)
Post #: 21
RE: ksh dumping core (dep off) - Sep. 10, '05, 10:47:44 AM   
breiter

 

Posts: 294
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
Yeah. DEP causes any Interix binaries compiled with GCC to fault out. I have never had any luck with setting exclusion lists. It just has to be turned off entirely, which is a real shame.

Microsoft are you listening? What bout fixing GCC for Interix so that it builds binaries that are compatible with DEP? Could it be GCC 4 while you're at it? And it would be nice if you got the code accepted into the CVS tree, too.

(in reply to prj32)
Post #: 22
RE: ksh dumping core (dep off) - Sep. 10, '05, 2:43:25 PM   
markfunk

 

Posts: 622
Joined: Mar. 31, '03,
Status: offline
with respect to "putting it into the CVS tree", this is not
a Microsoft problem.
Microsoft (and before that, Softway Systems) tried really, really,
really hard to get the gcc changes back into the gcc CVS tree.
But for whatever reason, the gcc folks were not receptive to
incorporating the changes.
You should really focus your comments/complaints/suggestions
at the gcc maintainers.

I really don't see Microsoft doing very much with gcc compilers.
They really don't want to be in this business.

(in reply to breiter)
Post #: 23
RE: ksh dumping core (dep off) - Sep. 10, '05, 7:19:20 PM   
prj32

 

Posts: 29
Joined: Oct. 16, '04,
Status: offline
I just read on another post that if you exclude "posix.exe, psxss.exe, psxrun.exe" to excep list of DEP and restart your box - it works? Not disabling this whole lot, but a restart is required.

Any comments? or should I not waste my time - reboots are far between :-)

(in reply to markfunk)
Post #: 24
RE: ksh dumping core (dep off) - Sep. 10, '05, 7:50:19 PM   
breiter

 

Posts: 294
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
> Microsoft (and before that, Softway Systems) tried really, really,
> really hard to get the gcc changes back into the gcc CVS tree.
> But for whatever reason, the gcc folks were not receptive to
> incorporating the changes.

Hmm. I wasn't aware of this. I'm sorry if my remarks were offensive.
In my ignorance, I assumed that Microsoft had been somewhat less than
collaborative with the GCC maintainers. It sounds like a political,
if not religious, problem.

> I really don't see Microsoft doing very much with gcc compilers.
> They really don't want to be in this business.

<rant>

Well that is the expectation that they have created by buying Interix,
continuing to ship it with GCC and promoting Interix to be a Windows
Subsystem in Win2k3 R2 and Vista. Competitors such as SUN and Apple ship
GCC and support it on their platform. How can the Subsystem for UNIX Applications
be taken seriously if it doesn't have binutils and GCC, etc. Microsoft may
not like the GNU project, but it is just reality that these are least common
denominator tools on a UNIX-like system.

I would think that Microsoft's main interest in the GCC compilers and
the rest of the GNU toolchain is to allow their customers to re-target UNIX
applications designed to be compiled with GCC onto the Interix subsystem. Which
is to say: make it easy for people to run just about everything on the Windows
platform.

To be honest, I'm not that interested in having these GNU tools for thier own sake.
They are just a vehicle to get code to build and just work without much trouble.
And *that* is interesting.

I don't think there can be any dispute that it is a problem that the GCC that Microsoft
ships with Interix won't build binaries that run with DEP, which is the default
setting of XP SP2 and Win2k3 SP1 and later. Microsoft should fix it or quietly sponsor
someone else to do so.

</rant>

(in reply to markfunk)
Post #: 25
RE: ksh dumping core (dep off) - Sep. 10, '05, 9:03:47 PM   
breiter

 

Posts: 294
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
quote:

ORIGINAL: prj32

I just read on another post that if you exclude "posix.exe, psxss.exe, psxrun.exe" to excep list of DEP and restart your box - it works? Not disabling this whole lot, but a restart is required.

Any comments? or should I not waste my time - reboots are far between :-)

Nope. It doesn't work. I wish it did. You would just be wasting reboots.

For example, if you put these 3 binaries into the exception list in "OptOut" mode and then try to use the /toos ssh client, for example, it will segfault on you. It doesn't help to add specific Interix binaries that are segfaulting to the list, either. I don't understand the DEP system enough to know why this doesn't work or if there is a way around it. Unless someone else does know a real solution, you need to set "/noexecute=AlwaysOff" in boot.ini.

(in reply to prj32)
Post #: 26
RE: ksh dumping core (dep off) - Sep. 11, '05, 1:28:54 AM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> Nope. It doesn't work. I wish it did. You would just be wasting reboots.

Right.
The three files mentioned are part of a set of files that we used to call "The Jewels"; there are two other files.
The Jewels are not what get tripped with DEP (or NX if you prefer). If it was then the Interix wouldn't run at all.

It's the binaries in user-land that attempt to run some code on a page marked with a no execute bit (that's
where the mention of "NX" comes from). The code you compile in "foo.c" can be free of any code that does this,
but there can be in one of the libraries (shared or not) a code chunk that does it. This only applies to gcc
generated code (which includes all shared libraries and DSO's).

To answer the question: "Why doesn't adding an Interix binary to the Opt-out list work?"
Answer (as I currently understand it):
The Opt-out list works with software and hardware DEP.
The "magical" Opt-out list is in Win32-land and Interix has no knowledge of it. So the doesn't get into the equation.

How is DEP set on with a program?
The Kernel sets the no execute (DEP) bit on the appropriate pages as the load happens.
When the no execute bit is seen on a page that the system tries to execute an exception is generated.
This exception is sent at the program by the Kernel. The exception is usually an access violation
which translated to Unix is SEGV. An Interix program doesn't handle SEGV and the subsystem is notified.
The program dies and the parent process can wait() and get this info.

How does the opt-out list work then? Here's my guess (given I rewrote the loader for Interix
back in the Softway days so set[ug]id would work; I doubt it's changed):
When someone tries to run a program the appropriate subsystem is notified. The subsystem then requests
the kernel to do "things" (big hand wave here over the details). With SP2 the request for memory has a
flag to ask the kernel to not bother setting the DEP bit as the program is loaded. The Win32 subsystem
has been updated (naturally) to know about this flag and of the list it maintains. So the Win32 subsystem
can add or not add the flag to the key request. Interix doesn't know about the request flag let alone
the opt-out list. So the opt-out list works for Win32, but not Interix. So Interix programs always run
with the DEP bit defaulted; Win32 programs run with the DEP bit explicitly off or as default. The Kernel
defaults to turn the DEP bit on (or not) based on system setting at boot, but will make an exception
about marking the pages if requested.

That's the current state for Interix 3.5. Can it be changed? Sure. Will it change? I dunno, I have no control over this!
What about SUA/Interix-5.2? I haven't checked ('cause it's taken me way to long to dredge my memory
to work up this answer and it's 1 (freak'n') 30 in the morning )

(in reply to breiter)
Post #: 27
Page:   <<   < prev  1 [2]
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> RE: ksh dumping core (dep off) Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047