ExAllocatePool with bad parameter

Hi
I have a blue screen because
by mistake, I think I use the
ExAllocatePoolWithTag with size (0-2 bytes) that is almost 4Gb.

Normally it should return NULL.

Such a setting causes there a blue screen?

Show us your code and a !analyze -v. I’ve never known any of the
ExAllocate calls to blue screen unless you are dumb enough to use
NonPagedPoolMustSucceed as the pool type. Using NonPagedPoolMustSucceed
is supposed to crash if it cannot allocate the memory.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@sivaller.no-ip.org” wrote in
message news:xxxxx@ntdev:

> Hi
> I have a blue screen because
> by mistake, I think I use the
> ExAllocatePoolWithTag with size (0-2 bytes) that is almost 4Gb.
>
> Normally it should return NULL.
>
> Such a setting causes there a blue screen?

used with NonPagedPool

Memory corruption.

Run your code with Verifier’s Special Pool to find it.


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

wrote in message news:xxxxx@ntdev…
> Hi
> I have a blue screen because
> by mistake, I think I use the
> ExAllocatePoolWithTag with size (0-2 bytes) that is almost 4Gb.
>
> Normally it should return NULL.
>
> Such a setting causes there a blue screen?
>

I am in a good mood this afternoon, so I will try an explain what little I
know about winbag’s setup and usage.

First, definitions:
host = computer where windbg is running. Also the best place to build the
driver under test. If running a 32-bit OS load windbg 32-bit, otherwise
64-bit.
target, SUT, AUT, … = computer where driver and hardware under test will
run.

Second, basic setup:

  1. Install TI chipset based 1394a ports on both computers. Hook them up.
  2. Modify the target’s boot.ini or use bcdedit to use 1394a and your
    favorite channel number. I prefer to use a free third party tool called
    BCD/BCD64, have it copy the default entry to one I modify for debugging and
    make default. That still gives me a good normal boot capability.
  3. On the host system, set the following environment variable:
    _NT_SYMBOL_PATH=srv*C:\SymCache*http://msdl.microsoft.com/download/symbols
  4. On the host system, delete all entries under:
    HKCU\Software\Microsoft\Windbg\Workspaces
  5. On the host system, run Standard.reg or StandardVS.reg if you have a
    single monitor or multimon.reg if you have dual monitors.
  6. On the host system, run windbg with no parameters (standard shortcut)
    and set up the log file, tab sizes, etc. (optional). Exit windbg.
  7. On the host system, copy the standard shortcut to the desktop for
    windbg. Modify the shortcut parameters for 1394a, channel, etc.
  8. On the host system, setup a MyMap.ini and an environment variable to
    force it to be used automatically.

If you have the .kdfiles setup properly and build your driver on the host
system, windbg will update it each time it is to be loaded on the SUT. You
do NOT need to add the file which should have been a directory to the
searchable symbol path.

The first time you run each OS variation expect to wait a long time for
SymCache to be populated with all the OS symbols.

If you can’t spend the time and effort to learn how to use the most basic of
tools, why would anyone be inclined to answer your questions? If you can’t
handle the work, I hear McDonalds is always hiring.

wrote in message news:xxxxx@ntdev…
> Hi
> I have a blue screen because
> by mistake, I think I use the
> ExAllocatePoolWithTag with size (0-2 bytes) that is almost 4Gb.
>
> Normally it should return NULL.
>
> Such a setting causes there a blue screen?
>

>I’ve never known any of the ExAllocate calls to blue screen

Actually, I saw that allocating size zero will bugcheck it.

wrote in message news:xxxxx@ntdev…
> Actually, I saw that allocating size zero will bugcheck it.

You’ll only get a BSOD if Verifier is running.

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

wrote in message news:xxxxx@ntdev…
>>I’ve never known any of the ExAllocate calls to blue screen
>
> Actually, I saw that allocating size zero will bugcheck it.
>

Checked build too ( as I recall ). Don’t do this.

  • S

-----Original Message-----
From: Scott Noone
Sent: Tuesday, September 07, 2010 7:31
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] ExAllocatePool with bad parameter

wrote in message news:xxxxx@ntdev…
> Actually, I saw that allocating size zero will bugcheck it.

You’ll only get a BSOD if Verifier is running.

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

wrote in message news:xxxxx@ntdev…
>>I’ve never known any of the ExAllocate calls to blue screen
>
> Actually, I saw that allocating size zero will bugcheck it.
>


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