Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7492557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:27:52+00:00 2026-05-29T16:27:52+00:00

Won’t the processor cause a TRAP to the operating system if the stack size

  • 0

Won’t the processor cause a TRAP to the operating system if the stack size limit is reached(thus preventing a stackoverflow :P)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:27:54+00:00Added an answer on May 29, 2026 at 4:27 pm

    I believe Windows does have a stack that grows when you reach the end.

    In the Visual Studio compiler the code responsible for this is in the chkstk.obj module.

    Since this code is open-source I can post it here:

    ;***
    ;_chkstk - check stack upon procedure entry
    ;
    ;Purpose:
    ;       Provide stack checking on procedure entry. Method is to simply probe
    ;       each page of memory required for the stack in descending order. This
    ;       causes the necessary pages of memory to be allocated via the guard
    ;       page scheme, if possible. In the event of failure, the OS raises the
    ;       _XCPT_UNABLE_TO_GROW_STACK exception.
    ;
    ;       NOTE:  Currently, the (EAX < _PAGESIZE_) code path falls through
    ;       to the "lastpage" label of the (EAX >= _PAGESIZE_) code path.  This
    ;       is small; a minor speed optimization would be to special case
    ;       this up top.  This would avoid the painful save/restore of
    ;       ecx and would shorten the code path by 4-6 instructions.
    ;
    ;Entry:
    ;       EAX = size of local frame
    ;
    ;Exit:
    ;       ESP = new stackframe, if successful
    ;
    ;Uses:
    ;       EAX
    ;
    ;Exceptions:
    ;       _XCPT_GUARD_PAGE_VIOLATION - May be raised on a page probe. NEVER TRAP
    ;                                    THIS!!!! It is used by the OS to grow the
    ;                                    stack on demand.
    ;       _XCPT_UNABLE_TO_GROW_STACK - The stack cannot be grown. More precisely,
    ;                                    the attempt by the OS memory manager to
    ;                                    allocate another guard page in response
    ;                                    to a _XCPT_GUARD_PAGE_VIOLATION has
    ;                                    failed.
    ;
    ;*******************************************************************************
    
    public  _alloca_probe
    
    _chkstk proc
    
    _alloca_probe    =  _chkstk
    
            push    ecx
    
    ; Calculate new TOS.
    
            lea     ecx, [esp] + 8 - 4      ; TOS before entering function + size for ret value
            sub     ecx, eax                ; new TOS
    
    ; Handle allocation size that results in wraparound.
    ; Wraparound will result in StackOverflow exception.
    
            sbb     eax, eax                ; 0 if CF==0, ~0 if CF==1
            not     eax                     ; ~0 if TOS did not wrapped around, 0 otherwise
            and     ecx, eax                ; set to 0 if wraparound
    
            mov     eax, esp                ; current TOS
            and     eax, not ( _PAGESIZE_ - 1) ; Round down to current page boundary
    
    cs10:
            cmp     ecx, eax                ; Is new TOS
            jb      short cs20              ; in probed page?
            mov     eax, ecx                ; yes.
            pop     ecx
            xchg    esp, eax                ; update esp
            mov     eax, dword ptr [eax]    ; get return address
            mov     dword ptr [esp], eax    ; and put it at new TOS
            ret
    
    ; Find next lower page and probe
    cs20:
            sub     eax, _PAGESIZE_         ; decrease by PAGESIZE
            test    dword ptr [eax],eax     ; probe page.
            jmp     short cs10
    
    _chkstk endp
    
            end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why won't XMLSerializer process my generic list? Sub Main() Serializing() End Sub <System.Serializable()> _
Won't the union in this question cause UB when used as this: union Data
Why won't #input-myBox clear when I select an item? It seems autocomplete is preventing
I won the bid on a project and now the client (who is itself
Why won't this xml schema validate ? Visual studio says that the simpleContent tag
why won't this work? function login(){ if(window.XMLHttpRequest){ ajax=new XMLHttpRequest(); }else if(window.ActiveXObject){ ajax=new ActiveXObject(Microsoft.XMLHTTP); }
Why won't this work? public static int[] GetListOfAllDaysForMonths() { static int[] MonthDays = new
htmlspecialchars won't do it and neither does htmlentities .
I won't use GIcon to change for the marker.Any other ways to change color
Mono won't fire the following code: I get internal server error 500, error writing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.