TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Erik Huelsmann
from: Mario Semo
date: 1996-02-06 12:18:40
subject: Secondary thread / Guard-page excep

Hello Erik,

On Feb 04 15:45 96, Erik Huelsmann of 2:500/19.1929 wrote:

 EH> I did not install an exception handler for this secondary 
 EH> thread, but the compiler's runtime-library does not seem to 
 EH> install one for the main thread and does not seem to have 
 EH> any problems in stack-expansion.... 

the main thread's stack is preallocated.

PS: i use 1MB of not preallocated stack (allocation via guard page
handling) for all threads != main thread.  (without problems)

PS: i'm using VACPP. it does install handlers.

 EH> I could write an exception-handler that uses the 
 EH> guardpage-system to expand the stack, but the operating 
 EH> system is supposed to be able to do that itself...

thats what i expect too.

PS: maybe you are NOT touching all bytes on the stack? (if i turn up
stack-check, it could cause a problem here).

idea:

function()
{
 char x[10000];

 x[9999]='1';

...

}
so, when function is called, the stack looks like:

  ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
  ³TOS         ³
  ³            ³
  ³            ³
  ³            ³
  ³            ³
  ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
  ³IP of caller³
  ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
  ³x[0]        ³G
  ³            ³G
  ³            ³G
  ³            ³
  ³            ³
  ³x[9999]     ³
  ÃÄÄÄÄÄÄÄÄÄÄÄÄ´
  ³            ³
  ³            ³

the 'G' marked area will cause a guad page exception handled by the OS
(which will increase the physical stack size). but this code touches
x[9999] and so touches a page beyond the Guard page. maybe such a construct
causes problems on your side?

 WARPED!, Mario

--- Msgedsq/2 2.2e
* Origin: LC/32 Development Team-Vienna-Austria (2:310/14.11)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 310/14 1 24/999 2/777 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.