×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    47

    Set stack size in Series 60 emulators?

    I recently upgraded from Series60_2_0_CW SDK to S60_2nd_FP2_CW SDK. When I run my app on FP2, I crash because a statement in my program that gets 1024 bytes on the stack overwrites some data I need. This does not happen with the older SDK, and everything else is the same.

    I have looked for a place to compare stack sizes of the 2 emulators, but haven't found it. epoc.ini and epoc.sys.ini aren't the places.

    Is there a place where this is set?

    Maybe it's not the stack size, since you'd think it would be enough (and EPOCSTACKSIZE in mmp files doesn't apply to emulators).

    Are there other differences between the 2 emulators?

    Thanks

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    Hi,

    hm your description of problem is not so accurate. I dont understand sentence "I crash because a statement in my program that gets 1024 bytes on the stack overwrites some data I need"...

    For automatic varialbles, which 'lives' on the stack by default is allocated 8 kB. If you exceed it in you method it usually results in __chkstk ERROR. I never test it, but as I know you shold increase the stack size by typing

    EPOCSTACKSIZE <size>
    where <size> is new stack size on device.

    Bye
    STeN

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    47
    Actually, I'm not sure what the problem is. I'm not overflowing the stack in the method that has the 1024 byte buf, but that statement overwrites some class member data that I have. That causes my DNS lookup to fail, since it is now getting bad data. The problem is very possibly in my program, but with the old SDK, I seem to have enough stack space -- my class member data is not overwritten. EPOCSTACKSIZE would make no difference, as that doesn't apply to the emulator (WINS, WINSCW). My program works fine on the phone -- it's only the S60 FP2 emulator where I have the problem.

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    Hi,

    it seems to be both strange and interesting, could you put the affected code here? I have installed both SDKs, co I could look on it - if I will have time

    Bye
    STeN

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    26

    eumlator stack size is always 4K ?

    I have same kind of problem.

    I add few lines on basics\helloword example for testing stack size.

    LOCAL_C void doExampleL()
    {
    char buf[4092];

    memset(buf, 'A', sizeof(buf));
    console->Printf(_L("HelloWorld \n"));
    }

    On 6620 device, it crashed with default .mmp.
    If I add "EPOCSTACKSIZE 0x4000" in .mmp, it worked.

    On emulater, it always crash.
    If I use buf[3000], it works. I guess emulator stack size is always
    4K byte.

    Anybady knows how to set stack size on emulator?

    I use S60_2nd_FP2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×