unresolved external symbols _chkstk

hi all
While building the device driver,
the following error is being seen. Unresolved external symbol __chkstk
whereas i am not using any such function call or symbol.
Why is this error seen??
My wild guess is that it has something to do with the excess use of stack.

I dont know
please advice

Thanks
Mayank

Hello Mayank,

Thursday, July 3, 2003, 8:26:34 AM, you wrote:

MK> hi all
MK> While building the device driver,
MK> the following error is being seen. Unresolved external symbol __chkstk
MK> whereas i am not using any such function call or symbol.
MK> Why is this error seen??
MK> My wild guess is that it has something to do with the excess use of stack.

MK> I dont know
MK> please advice

MK> Thanks
MK> Mayank

It seems you don’t know very simple and famous things! You may read
abouth it even in MSDN or any programming help system.
Just my humble suggestion - read the books before programming.

MK> —
MK> You are currently subscribed to ntdev as: xxxxx@nadatel.com
MK> To unsubscribe send a blank email to xxxxx@lists.osr.com


Best regards,
Michael mailto:xxxxx@nadatel.com

hi Michael
things that are pretty obvious for u or anybody else may not be so for
every body else. They are because i am from the linux backgroud and i am
doing ddk programming for the first time. So am a newbie in the first place.
Instead of writing those three long senetences if u had spent the same
effort explaining me then it would have been great. I am sorry if this
mailing list does not promote newbies.

thanks a lot
Mayank

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Michael
Sent: Thursday, July 03, 2003 2:58 PM
To: NT Developers Interest List
Subject: [ntdev] Re: unresolved external symbols _chkstk

Hello Mayank,

Thursday, July 3, 2003, 8:26:34 AM, you wrote:

MK> hi all
MK> While building the device driver,
MK> the following error is being seen. Unresolved external symbol __chkstk
MK> whereas i am not using any such function call or symbol.
MK> Why is this error seen??
MK> My wild guess is that it has something to do with the excess use of
stack.

MK> I dont know
MK> please advice

MK> Thanks
MK> Mayank

It seems you don’t know very simple and famous things! You may read
abouth it even in MSDN or any programming help system.
Just my humble suggestion - read the books before programming.

MK> —
MK> You are currently subscribed to ntdev as: xxxxx@nadatel.com
MK> To unsubscribe send a blank email to xxxxx@lists.osr.com


Best regards,
Michael mailto:xxxxx@nadatel.com


You are currently subscribed to ntdev as:
xxxxx@intersolutions.stpn.soft.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hello Mayank,

Thursday, July 3, 2003, 8:50:01 AM, you wrote:
The question you asked for is standard not only for DDK and also for
usual Windows programming.

MK> hi Michael
MK> things that are pretty obvious for u or anybody else may not be so for
MK> every body else. They are because i am from the linux backgroud and i am
MK> doing ddk programming for the first time. So am a newbie in the first place.
MK> Instead of writing those three long senetences if u had spent the same
MK> effort explaining me then it would have been great. I am sorry if this
MK> mailing list does not promote newbies.

MK> thanks a lot
MK> Mayank

MK> -----Original Message-----
MK> From: xxxxx@lists.osr.com
MK> [mailto:xxxxx@lists.osr.com]On Behalf Of Michael
MK> Sent: Thursday, July 03, 2003 2:58 PM
MK> To: NT Developers Interest List
MK> Subject: [ntdev] Re: unresolved external symbols _chkstk

MK> Hello Mayank,

MK> Thursday, July 3, 2003, 8:26:34 AM, you wrote:

MK>> hi all
MK>> While building the device driver,
MK>> the following error is being seen. Unresolved external symbol __chkstk
MK>> whereas i am not using any such function call or symbol.
MK>> Why is this error seen??
MK>> My wild guess is that it has something to do with the excess use of
MK> stack.

MK>> I dont know
MK>> please advice

MK>> Thanks
MK>> Mayank

MK> It seems you don’t know very simple and famous things! You may read
MK> abouth it even in MSDN or any programming help system.
MK> Just my humble suggestion - read the books before programming.

MK>> —
MK>> You are currently subscribed to ntdev as: xxxxx@nadatel.com
MK>> To unsubscribe send a blank email to xxxxx@lists.osr.com

MK> –
MK> Best regards,
MK> Michael mailto:xxxxx@nadatel.com

MK> —
MK> You are currently subscribed to ntdev as:
MK> xxxxx@intersolutions.stpn.soft.net
MK> To unsubscribe send a blank email to xxxxx@lists.osr.com

MK> —
MK> You are currently subscribed to ntdev as: xxxxx@nadatel.com
MK> To unsubscribe send a blank email to xxxxx@lists.osr.com


Best regards,
Michael mailto:xxxxx@nadatel.com

Mayanak,
Check whether you are using a very large array in your driver
code.
This is one possible reason. You will also get this error if you are trying
to link
your driver within VC with /Ge or /Gs0 flags.

Hope this helps!

Vijay

----- Original Message -----
From: “Mayank Kumar”
To: “NT Developers Interest List”
Sent: Thursday, July 03, 2003 9:56 AM
Subject: [ntdev] unresolved external symbols _chkstk

> hi all
> While building the device driver,
> the following error is being seen. Unresolved external symbol __chkstk
> whereas i am not using any such function call or symbol.
> Why is this error seen??
> My wild guess is that it has something to do with the excess use of stack.
>
> I dont know
> please advice
>
> Thanks
> Mayank
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@moschip.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

hi vijay
thanks for the reply. yes i was using a large array in one of function calls
which i have already
resolved
thanks
Mayank

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Vijay Anand
Sent: Thursday, July 03, 2003 10:51 AM
To: NT Developers Interest List
Subject: [ntdev] Re: unresolved external symbols _chkstk

Mayanak,
Check whether you are using a very large array in your driver
code.
This is one possible reason. You will also get this error if you are trying
to link
your driver within VC with /Ge or /Gs0 flags.

Hope this helps!

Vijay

----- Original Message -----
From: “Mayank Kumar”
To: “NT Developers Interest List”
Sent: Thursday, July 03, 2003 9:56 AM
Subject: [ntdev] unresolved external symbols _chkstk

> hi all
> While building the device driver,
> the following error is being seen. Unresolved external symbol __chkstk
> whereas i am not using any such function call or symbol.
> Why is this error seen??
> My wild guess is that it has something to do with the excess use of stack.
>
> I dont know
> please advice
>
> Thanks
> Mayank
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@moschip.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as:
xxxxx@intersolutions.stpn.soft.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Mayank Kumar wrote:

While building the device driver,
the following error is being seen. Unresolved external symbol __chkstk
whereas i am not using any such function call or symbol.

The compiler generates calls to this function during each function
prolog to check that sufficient stack space is available to hold all the
automatic variables. I believe that the compiler option “-Gh” will
suppress this, but check the MSDN documentation for the compiler to be
sure.

In any case, building a driver using the BUILD command in the DDK
doesn’t lead to this problem. So you must be building your driver some
other way. How *are* you building the driver, then?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

hi walter
as i replied earlier , the problem was occuring due to a large array that i
had declared inside
a function call. Now the problem no longer occurs. I was building my driver
using build.exe only.
Probably the unresolved external symbol message occurs only when u have
exceeded your available
stack limit. May be this is the compilers way of saying that u have exceeded
ur stack limit. It also
seems that this is a standard thing because on the newsgroups i found that
Symbian os also gives
an exactly same message when u exceed the stack limit.

thanks
Mayank

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Walter Oney
Sent: Thursday, July 03, 2003 2:54 PM
To: NT Developers Interest List
Subject: [ntdev] Re: unresolved external symbols _chkstk

Mayank Kumar wrote:

While building the device driver,
the following error is being seen. Unresolved external symbol __chkstk
whereas i am not using any such function call or symbol.

The compiler generates calls to this function during each function
prolog to check that sufficient stack space is available to hold all the
automatic variables. I believe that the compiler option “-Gh” will
suppress this, but check the MSDN documentation for the compiler to be
sure.

In any case, building a driver using the BUILD command in the DDK
doesn’t lead to this problem. So you must be building your driver some
other way. How *are* you building the driver, then?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com


You are currently subscribed to ntdev as:
xxxxx@intersolutions.stpn.soft.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

The compiler inserts so called stack-probes if a certain amount (or more) of
stack space is occupied of a function. This amount is 4k by default on x86
processors. This mechanism is designed and tuned to allow dynamic growing of
stack in user mode applications. I think that physical stack memory is
committed (in user mode only!) page-wise by traps on touching a new page and
that the explicit calls to _chkstk should prevent pages from being skipped.

But - in contrast - kernel stack space is a rare ressource. As far as I can
remember 12k for <= W2k and 16k under WXp. Thats why it’s a useful hint if
the _chkstk symbol is missed to review the driver with respect to stack
space demands (As you have done). BTW: The function referencing _chkstk can
be found by a compiler generated assembler listing if somebody has no idea
where as much stack space is consumed.

Regards
Volker

-----Original Message-----
From: Mayank Kumar [mailto:xxxxx@intersolutions.stpn.soft.net]
Sent: Thursday, July 03, 2003 12:53 PM
To: NT Developers Interest List
Subject: [ntdev] Re: unresolved external symbols _chkstk

hi walter
as i replied earlier , the problem was occuring due to a
large array that i
had declared inside
a function call. Now the problem no longer occurs. I was
building my driver
using build.exe only.
Probably the unresolved external symbol message occurs only
when u have
exceeded your available
stack limit. May be this is the compilers way of saying that
u have exceeded
ur stack limit. It also
seems that this is a standard thing because on the newsgroups
i found that
Symbian os also gives
an exactly same message when u exceed the stack limit.

thanks
Mayank

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Walter Oney
Sent: Thursday, July 03, 2003 2:54 PM
To: NT Developers Interest List
Subject: [ntdev] Re: unresolved external symbols _chkstk

Mayank Kumar wrote:
> While building the device driver,
> the following error is being seen. Unresolved external
symbol __chkstk
> whereas i am not using any such function call or symbol.

The compiler generates calls to this function during each function
prolog to check that sufficient stack space is available to
hold all the
automatic variables. I believe that the compiler option “-Gh” will
suppress this, but check the MSDN documentation for the compiler to be
sure.

In any case, building a driver using the BUILD command in the DDK
doesn’t lead to this problem. So you must be building your driver some
other way. How *are* you building the driver, then?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com


You are currently subscribed to ntdev as:
xxxxx@intersolutions.stpn.soft.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@baslerweb.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

“Moebius, V.” wrote in message
news:xxxxx@ntdev…
>
> The compiler inserts so called stack-probes if a certain amount (or more)
of
>

In short, getting this message indicates too much stack usage. It’s a
well-known error, mostly seen in new build environments (most recently, I’ve
seen this error produced from the W2K3 SP1 DDK).

And you DO get it just using build.

Peter
OSR

> -----Original Message-----

From: Peter Viscarola [mailto:xxxxx@osr.com]

And you DO get it just using build.

No I don’t get this error currently. (The problem was addressed by Mayank
Kumar originally in this thread.)

But I got this error formerly using W2k DDK in conjunction with VC6.0 and in
doing so especially by using of the so called “Processor Pack” add on. The
patched compiler inserted huge empty alignment blocks into stack layout
under specific circumstances spuriously.

Regards
Volker

> -----Original Message-----

From: Moebius, V. [mailto:xxxxx@baslerweb.com]

> -----Original Message-----
> From: Peter Viscarola [mailto:xxxxx@osr.com]

> And you DO get it just using build.

No I don’t get this error currently. …

Excuse me! May be I misunderstood your statement. If you meant that anybody
can get this error with build too then you are right - I think.

The problem is that you have not done your homework. If you had done a
Google search (or equivalent), you would have found a ton of hits on
__chkstk.

People here are friendly enough to newbies, but they expect newbies to
explore problems a little before asking for answers.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP