Announcement

Collapse
No announcement yet.

EVE Stack Overflow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EVE Stack Overflow

    Hi everyone,

    I'm stuck on a problem of Stack Overflow.

    errno=15
    PC=13882
    SP=-3822
    UserHeap 17730
    SysHeap 11984


    This error comes when i'm using the listbox, in form 14 or 17 and all the code in red is uncomment.
    I don't know if it's come from global variable, or somewhere else ... but if I comment the (follow code) in current form 17 it's still occur.
    Code:
    repeat
       ...
           repeat
              ...
           forever
       ...
    forever
    MagicCode4.inc (PostActivateForm)
    Code:
    if (CurrentForm == 14) /* MACRO MODE: creation of the generator macro listbox. */
        var count, hFont;
    
        to(items);
        print("[M12] : SweepMode,[M24] : Macro toto,[M1],[M2] : SweepMode,[M13], [M24] :Macro toto,[M24] : Macro toto,[M24] : SweepRegFreq RegAmpl Stop&amp,[M24] :Macro toto,[M24] : Macro toto"); //liste des macro dans le générateur
        list := 0;
        repeat
            count := ListBox(items, hFont, 70, 5, 235, 315) ;      // (non string) pointer to item list, font to use (could be uSD font), top, left, bottom, right or listbox
            gfx_MoveTo(55, 110) ;
            txt_BGcolour(WHITE);
            txt_FGcolour(BLACK);
            if (img_Touched(hndl, -1) == iUserbutton24 && count != -1)
                DrawBox(45, 100, 275, 205, BLACK, WHITE);
                txt_Wrap(265);
                macro := "[M24] : SweepRegFreq NonRegAmpl Stop&Recovery Conditions"; // Macro recuperation from generator
                print("You have selected Macro:\n\n", [STR]macro, "\n\n");
                pause(1000);
                print("\t\t\t\t\t\t\tMacro saved !");
                pause(3000);
                txt_Wrap(OFF);
                break;
            else if (img_Touched(hndl, -1) == iUserbutton29)
                break;
            else if (img_Touched(hndl, -1) == iUserbutton24 && count == -1)
                gfx_MoveTo(55, 145) ;
                DrawBox(45, 125, 275, 180, BLACK, WHITE);
                txt_Wrap(265);
                print("You didn't select macro !");
                pause(2000);
                txt_Wrap(OFF);
            endif
        forever
        ActivateForm(7);
    else if (CurrentForm == 17) /* START/STOP CONDITIONS: creation of the conditions listbox , display of pop-up messages , boxdigit to print value */
    var counter, Font, x, y, state;
        var back := 0;
    
        list := 1;
        to(conditions);
        print("Restart conditions:,Duration (h/m/s/ms),  Temperature (*C), _________________ , Stop conditions:,Duration (h/m/s/ms),  Temperature (*C),    Energy (kJ)");
        DrawBox(5, 60, 160, 95, BLACK, WHITE);
        gfx_MoveTo(8, 62) ;
        txt_BGcolour(WHITE);
        txt_FGcolour(BLACK);
        print("Select condition..") ;
        counter := ListBox(conditions, Font, 100, 5, 235, 160) ;
        repeat
            state := touch_Get(TOUCH_STATUS);
            if (state == TOUCH_PRESSED) x := touch_Get(TOUCH_GETX); y := touch_Get(TOUCH_GETY);
            if ((x >= 5 && x <= 160) && (y >= 100 && y <= 235))
                repeat
                    counter := ListBox(conditions, Font, 100, 5, 235, 160) ;
                    //txt_BGcolour(WHITE);
                    //txt_FGcolour(BLACK);
                    if (img_Touched(hndl, -1) == iUserbutton29)
                        back := 1;
                        break;
                    else if (img_Touched(hndl, -1) == iUserbutton24)
                        gfx_MoveTo(55, 145) ;
                        DrawBox(45, 125, 275, 180, BLACK, WHITE);
                        txt_Wrap(265);
                        print("You didn't modified anything.") ;
                        pause(2000);
                        break;
                    else if (counter == -1 || counter != -1)
                        gfx_MoveTo(7, 63) ;
                        txt_BGcolour(WHITE);
                        txt_FGcolour(BLACK);
                        if (counter == -1) print(" You didn't select\n anything.") ;
                        if (counter != -1) print(" You have selected\n energy condition.") ;
                        break;
                    endif
                forever
            endif
            if (back == 1) break;
        forever
        ActivateForm(7);
    else if (CurrentForm == 8 || CurrentForm == 9 || CurrentForm == 10 || CurrentForm == 2) /* Display of active macro in the main form (Form: 2/ 8/ 9/ 10) */
        var myvar;
        var cpt := 0;
        var byteToggle := 0;
        var stringLength;
    
        gfx_MoveTo(5, 203);
      //  colorRGB := gfx_RGBto565(0, 174, 239); //bleu cyan
        txt_BGcolour(BLACK);
        txt_FGcolour(WHITE);
    
        //buffer := memAlloc(strlen(macro));
        to(buffer);
        print([STR]macro);
        stringLength := strlen(buffer);
        txt_Wrap(255);
        while (cpt < stringLength)
            if (byteToggle == 0)
                myvar := LObyte(buffer[cpt]);
            else if (byteToggle == 1)
                myvar := HIbyte(buffer[cpt]);
                cpt++;
            endif
            print([CHR]myvar);  // print character
            byteToggle++;
            byteToggle := byteToggle % 2;
        wend
        txt_Wrap(OFF);
    endif
    Last edited by Toragan; 7th June 2019, 08:24 PM.

  • #2
    This attached file works without Stack Overflow, it's just better for you to see the code.

    I have 17 forms in my original program and this part of my code give me a Stack Overflow.

    Maybe I have to free something.
    Attached Files

    Comment


    • #3
      Hi Toragan,

      Thank you for sharing your code here.

      So far, we are reviewing your code and doing our best about your problem.


      Have you seen the related forum thread about your concern can be found below?
      https://forum.4dsystems.com.au/node/43996 - errno=15

      If you have not seen it yet, in post # 2 and post # 8, it will give you an idea, what causes the error and find out if your program makes endless recusing respectively.


      Best regards,
      Kayven

      Comment


      • #4
        Hi Kayven,

        I wrote #STACK 4096 and it's works better.

        Best regards
        Toragan

        Comment


        • #5
          Hi Toragan,


          We are glad to know that your problem has been resolved.


          If you have further concern, please let us know.

          All the best,
          Kayven

          Comment


          • #6
            Hi Kayven,

            After several attempts without the red part, but using Form 14 and setting #STACK 4096 my program doesn't Stack Overflow but freezing and I have to reboot it.
            I'm using mem_Alloc and mem_Free, to free memory but I have the impress it doesn't work well.

            If you have an idea of the potential problem let me know.

            Best regards,
            Toragan

            Comment


            • #7
              Hi Toragan.

              Sorry for the inconvenience.

              We want to know what SD card you are using?
              It might be the problem as discussed here: LEDDIGITS thing freezes in arduino loop

              And, you mentioned about freeing memory, please refer to the relevant forum thread found here: mem_Free frozen function


              Best regards,
              Kayven

              Comment

              Working...
              X