SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stack overflow problems...

    Hi Everyone,
    I'm a little freaked as I spent the last 3 days changing the way data is loaded into the functions supporting a script. I used to pass a bunch of variables around, and had to resort to globals when I needed more information. so i figured that passing a LIST (anytype) would be much better - and I would be able to add whatever information I need without having to change the function definitions.. (just add another element to the list)...

    However now I'm getting stack overflows quickly after the script has started. I'm assuming that SilkTest uses "pass by reference" (like & in C) when I declare with inout, so I'm a little puzzled at why the stack is overflowing.

    If anyone has any suggestions it would be greatly appreciated. it would suck to lose the benefits of having a flexible list of data rather than having to pass everything around.

    thanks in advance
    pretty tired+disappointed
    Steve

    ------------------

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    What are you passing in to that function that gives you stack overflow? Does it happen all the time with any data in your list or just this perticular situation?

    It might be a Silk bug.

    I was trying to create a super big list of anytype of it almost crashed my pc:P I think the problem is not the creation part it's indeed the calling part. If you got an list of anytype of just more than the half of the stack size it might very well overflow the stack when you pass in this list.


    ------------------

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    hey Godknows,
    thanks for replying... well, last night I took the list and shrunk it down by half. Instead of having 30 elements of anytype, I broke the list in to 3 (list of strings, list of bools and a list of anytype).. and managed to bring it down to a total of 15 elements. + still getting stack overflows.

    so what you wrote is starting to make sense. I'm trying to think of ways to work around the problem. My next step (I guess, feel like I'm running out of options) will be to try passing a really long string around (using getfield to cut it up into elements). Still, I wish that the original linked list idea worked.

    Do you know if the problems only occur with a list of Anytype or will list passed around result in stack overflows? I'm trying to think about it before modifying the code again... spent too long on that this weekend.

    thanks a lot for your help
    S

    ------------------

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    It's hard to say, but ANYTYPE is indeed very big cause it has to know about all types. You will have to try.

    Did you try to step in the code? I am wondering if it goes in the function at all.
    You should also reboot your machine or at least log off and log back in just to clear the memory. Sometimes Silk just goes bad after a problem surfaces. If you send the code I might be able to try on my machine.

    ------------------

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    I do the same thing as you do, using LISTs as the parameters to my test harness. It makes it much easier to add new features to the test interface without breaking the existing testware. I don't declare my LISTS as "inout", however. I seem to remember that I also had problems with SilkTest flakyness when I tried to do this.

    I make the passed parameters input only and return() output paramaters:

    LIST OF ANYTYPE GetOrderInfo( LIST OF ANYTYPE LookupParameters )

    I have no stability problems with this.


    ------------------
    Rob Kapteyn
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  6. #6
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    hey guys,
    thanks for your suggestions..

    GodKnows: Can't send the code, but thanks for offering (company policy, etc).
    I'm going to try what Rob has suggested - make the functions return the list (declare it as an in only).

    RobKapteyn: Thanks for the suggestion, I'll make the conversion and let you know how it goes. If you don't mind me asking, approx how many elements do you have in your list that gets passed around? Hopefully more than 30.

    thanks a lot guys, you've given me new hope
    S



    ------------------

  7. #7
    Senior Member
    Join Date
    Dec 2001
    Location
    San Jose, CA
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    Another suggestion is to write your large and long input parameters into a text file and pass it to the function.
    Then, the function should read the data out of the specified file.
    I think that helps you from swapping large chunk of memory.

    Michael

    ------------------

  8. #8
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    hey everyone,

    RobKapteyn-> well I tried it, and unfortunately it didn't work for me. the only difference between yr implementation and what I did is in the function headers, i only write "public list Function" instead of "list of anytype". I don't think it makes a difference (but I'll try that next) as the stack overflows on the first function call - LIST isn't even a parameter to this function. How sad is that? It looks like I'll have to go back to having many parameters again - instead of the list.

    Michael-> thanks for the suggestion re files, I figure it would be useful but may come with the additional cost of a slower execution speed.. as I use the variables/information in question very frequently, most of the main engine functions would require a read. So for my implementation, I don't think this is the way I'd like to go (but thanks again, any suggestion is better than none).

    GodKnows-> you were right, it doesn't even go into the function that uses the list before it blows up. it seems to blow the stack on the first function call (list not a parameter).

    Well I'm kind of stumped for now. I'm thinking of building up a mad string (with all of the string types needed) and using GetField to chunk it when I need it. The other variables will have to become parameters (I guess). This bug/Segue issue really holds back the design of the testing architecture.. I was thinking of wrapping some List/Node style datatype via C++ and a DLL but the problem would be interfacing with Silk. Has anyone tried this? Do you think it would work?

    thanks again for all of your suggestions + help,
    Steve (Stevens@opmr.com)

    ------------------

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    Steve:

    I routinely pass around lists with hundreds of elements without an problem, but I must admit that I have standardized on the LIST OF STRING datatype, not LIST OF ANYTYPE.

    With some further thought, it might be that it is the "anytype" part of your construct that is giving you problems, not the "inout" part.

    When I fought with this, I decided there was a parsing error in the Silk complier when I combined too many complex concepts -- (1) list, (2) anytype, (3) inout. I think if you limit youself to any two of these three you will be OK.

    Now if only we could send bug reports to Segue and feel like that payed attention to them . . .

    -Rob

    ------------------
    Rob Kapteyn

    [This message has been edited by RobKapteyn (edited 04-22-2002).]
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  10. #10
    Junior Member
    Join Date
    Oct 2001
    Location
    Montreal, QC, Canada
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: stack overflow problems...

    sorry, 1 last one to say that another option is the "type ... is record" declaration (seems to be like a struct in C++). If anyone has had a bad experience with type ... is record, please let me know (so I don't waste more time modifying code).

    GodKnows-> haha what about the 4th evil segue thing : spawns!

    Rob-> I still liked the LIST OF STRING idea, and tried that first using a quick test (changing LIST OF ANYTYPE to LIST OF STRING) still results in a crash on a function that doesn't even use the list. Parser has issues for sure.

    So I'm down to trying this "type ... is record" or just break down and do my other idea (which was concat the strings together and use GetField to break it into chunks)

    I'm getting tired of these parsing errors (and my deadline is wednesday) so I'm a little hesitant to try the type ... is record thing.

    The last idea (strings+getfield) is the safest. I'll be limited to 1024 characters in the string (go segue tech support).. they also said i could do some concat stuff using '+' to increase that #. If anyone cares I can forward that email.

    thanks again, I really appreciate it
    S

    ------------------




    [This message has been edited by Meanface (edited 04-22-2002).]

 

 
Page 1 of 2 12 LastLast

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:39 PM.

Copyright BetaSoft Inc.