473,480 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
5 6426
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 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
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 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5504
by: John Edwards | last post by:
Hello, I have sort of a newbie question. I'm trying to optimize a loop by breaking it into two passes. Example: for(i = 0; i < max; i++) {
9
1578
by: john woo | last post by:
Hi Please see the following simple script: <TD align="Left" width="30%" > <select name="DEPARTMENT" SIZE ="1" style="width:200px;" onChange="Change()"> <option value="0"> &lt;ALL&gt...
35
2815
by: Michel Sanner | last post by:
Hello, One of the greatest feature of Python in my opinion is the way the interpreter can be used to integrate a wide variety of software packages by dynamically linking them. This approach has...
6
4829
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
42
2301
by: Sabiyur | last post by:
Hi all, one of the recent post gives the macro to do swap #define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp) This macro will work, if the execution is from left to right. That is step 1)...
0
1972
by: dunleav1 | last post by:
Does enabling/disabling Data Execution Prevention (DEP) have a performance impact on SQL 2000 or SQL 2005?
19
2407
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; ...
0
2065
by: tomPee | last post by:
Hi, I have no idea if this is the right section to post this in. But i thought it maybe belonged here most. The problem i having is actually, most likely really simple. But here i am running...
1
1788
by: =?Utf-8?B?TWFnaWNQYXdz?= | last post by:
Hi, I have a folder in My Documents which contains a digital scrapbooking kit, and whenever I click on the folder I get the dreaded DEP message ... it is a paid for kit, and therefore ? unlikely to...
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6750
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.