By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,335 Members | 1,895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,335 IT Pros & Developers. It's quick & easy.

How to make code Data Execution Prevention (DEP) compatible?

P: n/a
P
I was wondering what sort of changes I need to make in order to make an
application to be DEP compatible with on Windows XP x64 version 2003.
I have compiled an open source C application
(japach:http://www.jikos.cz/jikos/japach/) but when I ran it on Windows
with DEP turned on, I get a core file and inside that, it says
"STATUS_ACCESS_VIOLATION". After searching through Google, most of the
results came back were on making an exception to the application that
isn't compatible through system settings. Is there a way to make it
compatible by making changes in the code?

Patrick

Nov 13 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
P wrote:
I was wondering what sort of changes I need to make in order to make an
application to be DEP compatible with on Windows XP x64 version 2003.
I have compiled an open source C application
(japach:http://www.jikos.cz/jikos/japach/) but when I ran it on Windows
with DEP turned on, I get a core file and inside that, it says
"STATUS_ACCESS_VIOLATION". After searching through Google, most of the
results came back were on making an exception to the application that
isn't compatible through system settings. Is there a way to make it
compatible by making changes in the code?

Patrick
All this is intricately linked with OS level details. As this group
tries to confine itself to standard C, please post to a group under
comp.os.ms-windows.* hierarchy, or to MSDN forums.

Nov 13 '06 #2

P: n/a
P wrote:
I was wondering what sort of changes I need to make in order to make an
application to be DEP compatible with on Windows XP x64 version 2003.
That's conceptually easy; fix the errors your program contains. If your
program is strictly conforming C (or rather, just well-behaved C) it should
never trigger the DEP mechanism.
I have compiled an open source C application
(japach:http://www.jikos.cz/jikos/japach/) but when I ran it on Windows
with DEP turned on, I get a core file and inside that, it says
"STATUS_ACCESS_VIOLATION".
I took a brief look at that program; it appears to be targeting UNIX-like
platforms and there's no mention of Windows support. If you can compile it
at all, it's still quite likely that the assumptions the program makes are
wrong (pay particular attention to any warnings your compiler emits; these
are not to be ignored). The core dump is just an indication that the program
isn't running the way it expected to.
After searching through Google, most of the results came back were on
making an exception to the application that isn't compatible through
system settings. Is there a way to make it compatible by making changes
in the code?
Not unless you want to invest some time in finding and fixing whatever is
causing the program to misbehave on Windows, which could be anything from an
incomplete library implementation to a data type mismatch. Turning off DEP
is a waste of time; it's very unlikely the program will run any better, and
triggering DEP is always an indication of either an error or an unportable
trick/hack that in standard C would be undefined behavior.

Try googling for "Cygwin" and "MinGW" for general information on how to
compile UNIX applications on Windows, and find appropriate newsgroups (like
comp.unix.programmer and comp.os.ms-windows.programmer) for questions about
OS-specific constructs (which are off-topic here).

S.
Nov 13 '06 #3

P: n/a
P
Not unless you want to invest some time in finding and fixing whatever is
causing the program to misbehave on Windows, which could be anything from an
incomplete library implementation to a data type mismatch. Turning off DEP
is a waste of time; it's very unlikely the program will run any better, and
triggering DEP is always an indication of either an error or an unportable
trick/hack that in standard C would be undefined behavior.

Try googling for "Cygwin" and "MinGW" for general information on how to
compile UNIX applications on Windows, and find appropriate newsgroups (like
comp.unix.programmer and comp.os.ms-windows.programmer) for questions about
OS-specific constructs (which are off-topic here).

S.
I forgot to mention I'm compiling in cygwin and it's working in windows
that don't come with DEP and windows with DEP but it's turned off. I
will post in those groups. Thanks.

Patrick

Nov 13 '06 #4

P: n/a
P wrote:
I was wondering what sort of changes I need to make in order to make an
application to be DEP compatible with on Windows XP x64 version 2003.
I have compiled an open source C application
(japach:http://www.jikos.cz/jikos/japach/) but when I ran it on Windows
with DEP turned on, I get a core file and inside that, it says
"STATUS_ACCESS_VIOLATION". After searching through Google, most of the
results came back were on making an exception to the application that
isn't compatible through system settings. Is there a way to make it
compatible by making changes in the code?
I've downloaded and attempted to compile it (linux 2.4). It won't
compile due to exit being called with no arguments.

After fixing all the calls to exit, it compiles and (seems to) run
fine.

After adding "-W -Wall" to the CFLAGS variable in the makefile,
it generates a *ton* of warnings including:

1. return without a value in functions declared as
returning non-void.
2. trampling over the std c libs namespaces; essentially
redefining "log"
3. falling of the end of functions declared as returning
a value.
4. implicit declaration of "free" - implies a missing include
directive.
5. ambiguity in assignment/comparison.
6. unused variables.
7. no declarations for some functions.
8. redefinition of #defines.
9. signed/unsigned comparison.

I suspect that the problem is not with DEP, but with the fact
that the program does so many illegal things that it's bound
to crash under some configurations.

Maybe you could try to fix all the warnings and give it another
try?
goose,

Nov 14 '06 #5

P: n/a
P
I've downloaded and attempted to compile it (linux 2.4). It won't
compile due to exit being called with no arguments.

After fixing all the calls to exit, it compiles and (seems to) run
fine.

After adding "-W -Wall" to the CFLAGS variable in the makefile,
it generates a *ton* of warnings including:

1. return without a value in functions declared as
returning non-void.
2. trampling over the std c libs namespaces; essentially
redefining "log"
3. falling of the end of functions declared as returning
a value.
4. implicit declaration of "free" - implies a missing include
directive.
5. ambiguity in assignment/comparison.
6. unused variables.
7. no declarations for some functions.
8. redefinition of #defines.
9. signed/unsigned comparison.

I suspect that the problem is not with DEP, but with the fact
that the program does so many illegal things that it's bound
to crash under some configurations.

Maybe you could try to fix all the warnings and give it another
try?
goose,
Hi goose,

Thanks! I've turned on the CFLAGS and fixed all the warnings. I'm
able to run it without having to turn off DEP. I'm not sure if this
was happening before but now I'm noticing the memory usage
progressively increments after a number of files being served.

Thanks for your help!

Patrick

Nov 15 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.