How to increase stack size of a .net exe in windows? RRS feed

  • Question

  • I get a stack overflow exception and it is for this specific case only. I can see about EDITBIN.EXE /STACK:<s.. but can i do this in any way in a PC without Visual studio. I am trying to give an workaround for my user - so that he can work with the app till i fix it in code.

    Note: I am able solve my stack overflow issue by increasing the stack size using Editbin.exe - i want to do this in users pc..

    To Achive Success stay Relaxed, Not Stressed.

    Monday, October 22, 2012 5:59 PM


  • i can do that - but i want to find a way, if there are many users..

    To Achive Success stay Relaxed, Not Stressed.

    Well, of course the best way is to just fix the program so that you don't overflow the stack, which probably means unrolling a recursive function to use a stack internally instead.

    However, editbin isn't something you can redistribute (legally), I don't believe, and it requires a full VS command prompt.  As such, it's not trivial to run remotely.

    Otherwise, you could write a program to manually edit the image headers in the PE header table, but this would be a lot of effort - far more work than just deploying a new executable which has been increased.  For details on the image headers, see:

    Reed Copsey, Jr. -
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Marked as answer by HelpNeededO Tuesday, October 23, 2012 8:29 PM
    Monday, October 22, 2012 6:34 PM

All replies