Announcement

Collapse
No announcement yet.

Stack Overflow

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stack Overflow

    Hi everyone,

    For some time, my application tell me a "stack overflow" when I touch buttons on the display.

    For example, in the 1st Form, if you touch several times on + or -, a stack overflow will be appear.

    Same thing on the other forms.

    Do you have any idea ??

    Thanks a lot.
    Sylvain.
    Attached Files

  • #2
    Hi Sylvian

    I have tested your project and I get the same result.

    I had a look in MagicEvent13 and noticed towards the end there is a call to

    Aff_Trace();

    I can't find this so was wondering if the code example you sent was complete.

    Best regards

    Paul

    Comment


    • #3
      Hi Paul,

      Thanks.
      Aff_Trace(); is in "CourbeTemps.inc" included in MyApp.rar.

      Attached Files

      Comment


      • #4
        Ok Thanks,

        I changed these to globals which seems to have cured it on my side.

        var prov,prov2;
        var fValMax[2];
        var fltDIV[2];
        var fHeight[2];
        var fTab[2];
        var fGain[2];

        Could you please try it to see if it makes a difference

        Best regards

        Paul
        Attached Files

        Comment


        • #5
          Ok thanks.

          Globals or privates variables work fine for this part of code.

          But I've the same problem if I go to Form2 :
          1. Click on "Param Cycle"
          2. Than click on a Keyboard icon
          3. Than in Form2 enter several number .... And sometime the application crash with a stack overflow !

          When I comment the red line below in code, that works fine !!?
          An other example, go to Form2, and click several times on the arrow to clear tLeddigits ... a stack overflow appear !

          And finally, I have the same problem in an other form, always with tLeddigits object.

          Code:
          func rMagicKbClrEvent2(var reportID, var objType, var objHash, var value)
              switch
                  case(value == 20)                               // EFFACER
                      if(ValSaisie >= 0)
                          ValSaisie := ValSaisie/10;
                          WriteObject(tLeddigits,14,ValSaisie);   // �crit dans led digit 1
                      endif
                      break;
                  case(value == 21)
                      ValSaisie := 0;
                      WriteObject(tLeddigits,14,0);               // RAZ de led digit
                      break;
                  case(value == 22)                               // ESCAPE
                      gFlagMAJ := DO_MAJ;
                      gActionMB := OldForm;
                      OldForm := MAJ_FORM2;
                      break;
                  case(value == 23)                               // touche VALID
                      WriteObject(tLeddigits,0,ValSaisie);        // �crit dans led digit 0
                      *AdrValSaisie := ValSaisie;
                      *AdrUnitSaisie := UnitSaisie;
                      /*-- pour mettre a jour la form suite � une saisie --*/
                      gFlagMAJ := DO_MAJ;
                      gActionMB := OldForm;
                      OldForm := MAJ_FORM2;
                      break;
                  case((value >= 0) && (value <= 9))
                      if(ValSaisie < 1000)
                          ValSaisie := ValSaisie*10 + value;
          WriteObject(tLeddigits,14,ValSaisie); // �crit dans led digit 1
          endif break; endswitch if((value >= 10) && (value <= 12)) UnitSaisie := value - 10; WriteObject(tStrings,0,UnitSaisie); // ecrit dans string �S ou autre endif endfunc

          Comment


          • #6
            Hi,

            Thanks for the additional information.

            Yes I get the same result on form2

            Can you try adding this as the first line of MagicCode1

            #STACK 280

            It seems to solve the stack overflow that you are getting but you will have to do some thorough testing.

            Best regards

            Paul

            Comment


            • #7
              Hi Paul,

              That's works so fine !

              Thank you.

              Regards
              Sylvain

              Comment

              Working...
              X