DebugVSRelease

Hi All,
I made a functional driver for pci card and compiled it in debug
version.debug version is working fine with the app debug version but when i
am trying to run the app in release version app become in hange state.i am
not able to see even gui .for checking purpose i commented the code for
loading the driver and excute the app in release version then app is working
fine.

i want to know is there any soecific way to use the driver with app in
release version .
what are the thing that i should take care for using the driver in relese
version.

Any help or pointer that can help me to solve this problem.

BestRegards
Nayan


Spice up your IM conversations. New, colorful and animated emoticons. Get
chatting! http://server1.msn.co.in/SP05/emoticons/

Your driver and your application are two separately compiled executable
objects, so superficially running the debug version of either of them
ought to have no effect other than timing on the behavior of the other.

I would use a debugger to debug the released version of your
application. In fact when I have situations like this I tend to run the
VS debugger remote to the test system to debug the application while
running windbg remote to the same system to control the driver’s
operation.

Your application and driver might share an IOCTL interface. Are the data
structures defined identically between builds?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of nayan kumar
Sent: Sunday, March 04, 2007 11:02 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] DebugVSRelease

Hi All,
I made a functional driver for pci card and compiled it in
debug
version.debug version is working fine with the app debug version but
when i
am trying to run the app in release version app become in hange state.i
am
not able to see even gui .for checking purpose i commented the code for
loading the driver and excute the app in release version then app is
working
fine.

i want to know is there any soecific way to use the driver with app in
release version .
what are the thing that i should take care for using the driver in
relese
version.

Any help or pointer that can help me to solve this problem.

BestRegards
Nayan


Spice up your IM conversations. New, colorful and animated emoticons.
Get
chatting! http://server1.msn.co.in/SP05/emoticons/


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

As far as the app and OS is concerned there is no difference between debug and release version of the driver. Debug version have some extra symbols and extra code that you may have between #ifdef DEBUG - #endif. There may be some relevent code that is getting compiled away in the Release version.

Check to see if you are not compiling away some relevent code in the Release version of the driver.

  • Crajyman - NathCorp

The most common release vs debug problem is that optimization can eliminate
variable reads and/or writes that occur in the checked build. Look for
variables that should be volatile declared, especially in loops where a
variable might be promoted out of the loop when that was not the intention.

wrote in message news:xxxxx@ntdev…
> As far as the app and OS is concerned there is no difference between debug
> and release version of the driver. Debug version have some extra symbols
> and extra code that you may have between #ifdef DEBUG - #endif. There may
> be some relevent code that is getting compiled away in the Release
> version.
>
> Check to see if you are not compiling away some relevent code in the
> Release version of the driver.
>
> - Crajyman - NathCorp
>

In my experience optimization has rarely been the cause of problems.
Instead I’ve found dead code - code always executed in the debug build
that is never executed in the release build - to be the most common
release vs debug problem. That would be your second example - code
modification due to #ifdef DEBUG compilation constants.

Prefast can help here to identify release build problems. A debugger can
help as well. And finally runtime tracing, using either release build
enabled debug prints or ETW, can be a huge help.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
Sent: Monday, March 05, 2007 9:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] DebugVSRelease

The most common release vs debug problem is that optimization can
eliminate
variable reads and/or writes that occur in the checked build. Look for
variables that should be volatile declared, especially in loops where a
variable might be promoted out of the loop when that was not the
intention.

wrote in message news:xxxxx@ntdev…
> As far as the app and OS is concerned there is no difference between
debug
> and release version of the driver. Debug version have some extra
symbols
> and extra code that you may have between #ifdef DEBUG - #endif. There
may
> be some relevent code that is getting compiled away in the Release
> version.
>
> Check to see if you are not compiling away some relevent code in the
> Release version of the driver.
>
> - Crajyman - NathCorp
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

We need a little more information to help. You might want to post the
code that loads the driver which you commented out in the free build in
order to get it to work. Also, as Mark mentioned, WinDbg and some
KdPrint’s can go a long, long way here. If you already are using
KdPrint, you will to make a minor change in order for them to expand to
an actual call DbgPrint in a free build. You can either call DbgPrint
directly, or, immediately after including NTDDK.H, #undef it and then
#define it as it is in WDM.H, but without the conditional guards. If
you are not using any sort of tracing yet, then I would start by adding
some basic trace statements at the key points in each function of your
driver. For starters, at the entry and exit of DriverEntry and every
function (of yours) that it calls directly. This, with the help of
WinDbg or DbgView, should give you a better idea of how far you are
getting before it hangs. You could always just place a breakpoint at
DriverEntry, but this method will hopefully prevent some single stepping
by providing a better starting point.

Hope this helps,

mm

>> xxxxx@stratus.com 2007-03-06 08:41 >>>
In my experience optimization has rarely been the cause of problems.
Instead I’ve found dead code - code always executed in the debug build
that is never executed in the release build - to be the most common
release vs debug problem. That would be your second example - code
modification due to #ifdef DEBUG compilation constants.

Prefast can help here to identify release build problems. A debugger
can
help as well. And finally runtime tracing, using either release build
enabled debug prints or ETW, can be a huge help.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
Sent: Monday, March 05, 2007 9:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] DebugVSRelease

The most common release vs debug problem is that optimization can
eliminate
variable reads and/or writes that occur in the checked build. Look for

variables that should be volatile declared, especially in loops where a

variable might be promoted out of the loop when that was not the
intention.

wrote in message news:xxxxx@ntdev…
> As far as the app and OS is concerned there is no difference between
debug
> and release version of the driver. Debug version have some extra
symbols
> and extra code that you may have between #ifdef DEBUG - #endif.
There
may
> be some relevent code that is getting compiled away in the Release
> version.
>
> Check to see if you are not compiling away some relevent code in the

> Release version of the driver.
>
> - Crajyman - NathCorp
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi All,
Thanks to all for their kind assitence.i solve the problem actually
it was mistake.
But for my knowledge purpose i want to know what are the constraints and
precaution that i should keep in my mind about debug release problem.

if i am compiling the driver and app as follows.

DRIVER Application
Debug Release
Debug Debug

Release Release
Release Debug

Any tutorial and url that throw some light on these issues.

BestRegards
Nayan


The idiot box is no longer passé; it’s making news and how!
http://content.msn.co.in/Entertainment/TV/Default.aspx