Driver Issue

Hi All ,

I have inherited a device driver project and have noticed that after installing the driver and running the PC for a couple of days. Title bars of window start to disappear and the logon window does not have text boxes and several other Parse Error message.

I thought these were classic symptoms of leaking memory (I had reason to believe this as I had fixed some memory leaks before on this one). SoI went and checked with process explorer and the paged and non paged memory usage was very low and was not increasing with time.

Then I looked at the code again and found that a part of code was allocating and deallocating from non paged memory pool repeatedly , instead of allocating before and deloacting on driver unload.

My question is - can this be fragmenting the non paged memory pool and hence causing the symptoms mentioned and still show a low non paged memroy usage?

BR
Niladri Bose

Not what I would bet on first. While any driver obviously could fragment
memory enough to cause allocation failuress, and I don’t (personally) think
that the symptoms you describe are obviously indicative of that.

How much memory/number of allocations/how often are you talking about?

In and of itself, repeatedly allocating/deallocating, while in some cases
perhaps inefficient (and in some cases preferred), is not normally otherwise
a problem and definitely not unusual. If you’re talking about
allocating/freeing/allocating some monster NP buffer many of times, then
that might fail due to fragmentation over time, but even then, I would think
that you’re more likely to have something fail than weird effects in the UI
(though low np pool will do some weird stuff).

Either way, you could check this theory by making sure that you check all
your allocations for success. If you’re not getting allocation failures,
the odds of the parts of the rest of the system consistently getting them
AND surviving them would seem to be pretty small.

Q: What’s a ‘Parse Error’ message?

One thing I would try is to run your driver under driver verifier.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@napier.ac.uk
Sent: Friday, February 04, 2011 6:50 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Driver Issue

Hi All ,

I have inherited a device driver project and have noticed that after
installing the driver and running the PC for a couple of days. Title bars of
window start to disappear and the logon window does not have text boxes and
several other Parse Error message.

I thought these were classic symptoms of leaking memory (I had reason to
believe this as I had fixed some memory leaks before on this one). SoI went
and checked with process explorer and the paged and non paged memory usage
was very low and was not increasing with time.

Then I looked at the code again and found that a part of code was allocating
and deallocating from non paged memory pool repeatedly , instead of
allocating before and deloacting on driver unload.

My question is - can this be fragmenting the non paged memory pool and hence
causing the symptoms mentioned and still show a low non paged memroy usage?

BR
Niladri Bose


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

>

Hi All ,

I have inherited a device driver project and have noticed that after
installing the driver and running the PC for a couple of days. Title
bars of
window start to disappear and the logon window does not have text
boxes and
several other Parse Error message.

I thought these were classic symptoms of leaking memory (I had reason
to
believe this as I had fixed some memory leaks before on this one). SoI
went
and checked with process explorer and the paged and non paged memory
usage was
very low and was not increasing with time.

Then I looked at the code again and found that a part of code was
allocating
and deallocating from non paged memory pool repeatedly , instead of
allocating
before and deloacting on driver unload.

My question is - can this be fragmenting the non paged memory pool and
hence
causing the symptoms mentioned and still show a low non paged memroy
usage?

I think this is more likely a userspace issue. Does the problem occur
when not running your driver? The problems you describe are pretty
typical of Windows, especially older versions.

Open task manager and show the ‘GDI Objects’ (I think) column. You might
see one or two applications that have an excessive number compared to
everything else.

On my laptop (XP), after about a week, Outlook 2007 needs restarting for
the reasons you describe above, and probably about the same for Internet
Explorer but I use Firefox these days which doesn’t seem to have any of
those problems - I can have it open for the whole month (or two or three
if there are no important updates).

James

Thanks for your response.

The allocations are 256 KBytes and the rate varies based on data rate. in normative conditions it is ~ one every 500ms.

Parse Error message boxes ( with additional message failed on line n) pop up every now and then. Googled it and found it is something to do with window desktop themes on win XP.

I tried notmyfault and reproduces the same effects on xp by inducing non paged memry leak. But with this driver there are no leaks ~ at least via process explorer.

I will try driver varifier now.

BR
Niladri

Thanks James ,

I will recheck if there is any rogue user land application doing this.

But it is a brand new VM install with only the driver installed. I shall get snapshot before and after to see if I can reproduce the errors. And also keeping an eye on GDI object thanks.

BR
Niladri

Test the driver under Verifier.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi All ,
>
> I have inherited a device driver project and have noticed that after installing the driver and running the PC for a couple of days. Title bars of window start to disappear and the logon window does not have text boxes and several other Parse Error message.
>
> I thought these were classic symptoms of leaking memory (I had reason to believe this as I had fixed some memory leaks before on this one). SoI went and checked with process explorer and the paged and non paged memory usage was very low and was not increasing with time.
>
> Then I looked at the code again and found that a part of code was allocating and deallocating from non paged memory pool repeatedly , instead of allocating before and deloacting on driver unload.
>
> My question is - can this be fragmenting the non paged memory pool and hence causing the symptoms mentioned and still show a low non paged memroy usage?
>
>
> BR
> Niladri Bose
>
>
>

Sounds like a job for pool tags. It might sound redundant, but the
can help you determine if the leaks are directly from your driver, or
an artifact of something else working on your behalf. In the later
case, you need to close a handle or shut something down. The former,
you just need to free.

On 2/4/11, Maxim S. Shatskih wrote:
> Test the driver under Verifier.
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> wrote in message news:xxxxx@ntdev…
>> Hi All ,
>>
>> I have inherited a device driver project and have noticed that after
>> installing the driver and running the PC for a couple of days. Title bars
>> of window start to disappear and the logon window does not have text boxes
>> and several other Parse Error message.
>>
>> I thought these were classic symptoms of leaking memory (I had reason to
>> believe this as I had fixed some memory leaks before on this one). SoI
>> went and checked with process explorer and the paged and non paged memory
>> usage was very low and was not increasing with time.
>>
>> Then I looked at the code again and found that a part of code was
>> allocating and deallocating from non paged memory pool repeatedly ,
>> instead of allocating before and deloacting on driver unload.
>>
>> My question is - can this be fragmenting the non paged memory pool and
>> hence causing the symptoms mentioned and still show a low non paged memroy
>> usage?
>>
>>
>> BR
>> Niladri Bose
>>
>>
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Sent from my mobile device

It could be that usrmode IO request memory gets locked and not unlocked back.