Announcement

Collapse
No announcement yet.

Bug In Miva Engine or just Scripting Error

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

    Bug In Miva Engine or just Scripting Error



    I'm getting sick and tired of having my scripts being blamed for crashes =
    in
    the Miva Empresa for Windows engine.

    Can ANYONE show me any MivaScript that when coded improperly should =
    cause
    the engine to crash? Obviously, there must be SOMETHING that I'm doing =
    in
    my MivaScript that regularly can cause the Miva Engine to crash (at =
    least
    the Windows version), and is documented somewhere as being something NOT =
    to
    do.....but I cannot find anything listed anywhere.

    I know in C/C++ you have pointers....lots of room to do things wrong and
    crash, but I just cannot find any such language constructs in =
    MivaScript.
    But, since Miva Support and Development Staff continually =
    "pass-the-buck" by
    blaming me, I thought I would finally solicit information from other
    MivaScripts users...because obviously I'm missing something here.

    Thanks for your time.

    Darren Ehlers
    OpenUI Developer Consortium
    <A HREF ="http://www.openui.org/=20">http://www.openui.org/=20</A>





    #2
    RE: [mrc] Bug In Miva Engine or just Scripting Error



    Hi Darren,

    I've seen two things in scrips cause an "engine crash".
    Neither are actually engine crashes as you'll see below
    and only the first could really be attributed to a bug
    in the script.

    1) Infinite loop / deadlock. The infinite loop condition
    can be caused by any number of programming errors, and
    deadlock can occur with lockfiles. Both can cause the
    server to issue a Server 500 error if the server timeout
    is shorter than the engine timeout. (though recently I've
    seen the engine stop processing and display an error code
    if it thinks it has detected a deadlock)

    2) Significant memory consumption. If a script uses up
    too much memory, the web server may kill the engine. Most
    common on hosts that artificially limit the process size.
    This will also cause a Server 500 error.

    Other than this, nothing you do in Miva Script should
    cause a server crash. In theory. :) Now, I *have* seen
    instances where incorrect token/template code caused
    an infinite loop, leading the store owner and/or host
    to "blame" the module that allows template/token code.
    But again, that's not a module bug, it's just a danger
    of having interpreted code that a customer can modify.

    Regards,
    James



    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Darren
    Sent: Thursday, January 20, 2005 12:52 PM
    To: [email protected]; [email protected];
    [email protected]
    Subject: [mrc] Bug In Miva Engine or just Scripting Error


    I'm getting sick and tired of having my scripts being blamed for crashes in
    the Miva Empresa for Windows engine.

    Can ANYONE show me any MivaScript that when coded improperly should cause
    the engine to crash? Obviously, there must be SOMETHING that I'm doing in
    my MivaScript that regularly can cause the Miva Engine to crash (at least
    the Windows version), and is documented somewhere as being something NOT to
    do.....but I cannot find anything listed anywhere.

    I know in C/C++ you have pointers....lots of room to do things wrong and
    crash, but I just cannot find any such language constructs in MivaScript.
    But, since Miva Support and Development Staff continually "pass-the-buck" by
    blaming me, I thought I would finally solicit information from other
    MivaScripts users...because obviously I'm missing something here.

    Thanks for your time.

    Darren Ehlers
    OpenUI Developer Consortium
    <A HREF ="http://www.openui.org/">http://www.openui.org/</A>




    Comment


      #3
      Bug In Miva Engine or just Scripting Error



      Darren,

      I assume you're using uncompiled? I had some issues with the engine =
      crashing
      because of my code; however I don't remember exactly what caused it (I =
      think
      it might have been a loop or something, don't know). I'll see if I can =
      find
      any example.

      I've been using the VM ever since it came out, so I don't use uncompiled =
      any
      more. Haven't had those problems since the old empresa days.

      But I know that bad code CAN cause the engine to crash (of course it =
      doesn't
      mean that is the problem).

      HTH,

      Ben

      -----Original Message-----
      From: [email protected] [mailto:[email protected]] On =
      Behalf
      Of Darren
      Sent: Thursday, January 20, 2005 11:52 AM
      To: [email protected]; [email protected];
      [email protected]
      Subject: [meu] Bug In Miva Engine or just Scripting Error

      I'm getting sick and tired of having my scripts being blamed for crashes =
      in
      the Miva Empresa for Windows engine.

      Can ANYONE show me any MivaScript that when coded improperly should =
      cause
      the engine to crash? Obviously, there must be SOMETHING that I'm doing =
      in
      my MivaScript that regularly can cause the Miva Engine to crash (at =
      least
      the Windows version), and is documented somewhere as being something NOT =
      to
      do.....but I cannot find anything listed anywhere.

      I know in C/C++ you have pointers....lots of room to do things wrong and
      crash, but I just cannot find any such language constructs in =
      MivaScript.
      But, since Miva Support and Development Staff continually =
      "pass-the-buck" by
      blaming me, I thought I would finally solicit information from other
      MivaScripts users...because obviously I'm missing something here.

      Thanks for your time.

      Darren Ehlers
      OpenUI Developer Consortium
      <A HREF ="http://www.openui.org/=20">http://www.openui.org/=20</A>




      Comment


        #4
        Bug In Miva Engine or just Scripting Error



        Nope, using compiled....but it's the same issue that has been going on for
        4-5 years with Miva Empresa for Windows. When put under any load, it seems
        to just croak.

        And you say that bad code can cause the engine to crash....do you have any
        examples?

        Darren

        > -----Original Message-----
        > From: [email protected]
        > [mailto:[email protected]] On Behalf Of Ben Walsh
        > Sent: Thursday, January 20, 2005 12:18 PM
        > To: [email protected]; [email protected];
        > [email protected]
        > Subject: RE: [meu] Bug In Miva Engine or just Scripting Error
        >
        >
        > Darren,
        >
        > I assume you're using uncompiled? I had some issues with the
        > engine crashing because of my code; however I don't remember
        > exactly what caused it (I think it might have been a loop or
        > something, don't know). I'll see if I can find any example.
        >
        > I've been using the VM ever since it came out, so I don't use
        > uncompiled any more. Haven't had those problems since the old
        > empresa days.
        >
        > But I know that bad code CAN cause the engine to crash (of
        > course it doesn't mean that is the problem).
        >
        > HTH,
        >
        > Ben
        >
        > -----Original Message-----
        > From: [email protected]
        > [mailto:[email protected]] On Behalf Of Darren
        > Sent: Thursday, January 20, 2005 11:52 AM
        > To: [email protected]; [email protected];
        > [email protected]
        > Subject: [meu] Bug In Miva Engine or just Scripting Error
        >
        > I'm getting sick and tired of having my scripts being blamed
        > for crashes in the Miva Empresa for Windows engine.
        >
        > Can ANYONE show me any MivaScript that when coded improperly
        > should cause the engine to crash? Obviously, there must be
        > SOMETHING that I'm doing in my MivaScript that regularly can
        > cause the Miva Engine to crash (at least the Windows
        > version), and is documented somewhere as being something NOT
        > to do.....but I cannot find anything listed anywhere.
        >
        > I know in C/C++ you have pointers....lots of room to do
        > things wrong and crash, but I just cannot find any such
        > language constructs in MivaScript. But, since Miva Support
        > and Development Staff continually "pass-the-buck" by blaming
        > me, I thought I would finally solicit information from other
        > MivaScripts users...because obviously I'm missing something here.
        >
        > Thanks for your time.
        >
        > Darren Ehlers
        > OpenUI Developer Consortium
        > <A HREF ="http://www.openui.org/ ">http://www.openui.org/ </A>
        >
        >
        >
        >

        Comment


          #5
          Bug In Miva Engine or just Scripting Error



          It is possible (or at least was) to crash the engine using
          just MivaScript. I haven't run across anything lately that
          would crash it, but I'm sure bugs are still out there.

          One example I came across (and mind you this was 2-3 years
          ago so I forgot all the fine details) was in <MvDO>. It has
          to deal with trying to <MvDO> a function in the file you're
          running. So if you were running main.mv and tried to:
          <MvDO FILE="main.mv" NAME="l.date"
          VALUE="{showdate(s.time_t)}">
          it would cause a crash. There were other factors involved
          but that was the crux.

          Another dealt with nested functions where one was a
          built-in and one was user defined. So something like:
          <MvEVAL EXPR="{ gettoken(get_username(users.d.name), " ",
          1) }"> Once again, I think there was one other factor
          involved but it escapes me.

          These were offical "Scott Bugs". Stuff that only I could
          have found due to odd programming habits and dumb luck.

          So yes, it is/was possible to crash the engine using
          nothing but correctly written MivaScript. Now it's just a
          matter of tracking down what your scripts are doing and
          reducing it down to reach the one line of code that's
          causing headaches.

          /ScottMc

          --- Ben Walsh <[email protected]> wrote:

          > Darren,
          >
          > I assume you're using uncompiled? I had some issues with
          > the engine crashing
          > because of my code; however I don't remember exactly what
          > caused it (I think
          > it might have been a loop or something, don't know). I'll
          > see if I can find
          > any example.
          >
          > I've been using the VM ever since it came out, so I don't
          > use uncompiled any
          > more. Haven't had those problems since the old empresa
          > days.
          >
          > But I know that bad code CAN cause the engine to crash
          > (of course it doesn't
          > mean that is the problem).
          >
          > HTH,
          >
          > Ben
          >
          > -----Original Message-----
          > From: [email protected]
          > [mailto:[email protected]] On Behalf
          > Of Darren
          > Sent: Thursday, January 20, 2005 11:52 AM
          > To: [email protected]; [email protected];
          > [email protected]
          > Subject: [meu] Bug In Miva Engine or just Scripting Error
          >
          > I'm getting sick and tired of having my scripts being
          > blamed for crashes in
          > the Miva Empresa for Windows engine.
          >
          > Can ANYONE show me any MivaScript that when coded
          > improperly should cause
          > the engine to crash? Obviously, there must be SOMETHING
          > that I'm doing in
          > my MivaScript that regularly can cause the Miva Engine to
          > crash (at least
          > the Windows version), and is documented somewhere as
          > being something NOT to
          > do.....but I cannot find anything listed anywhere.
          >
          > I know in C/C++ you have pointers....lots of room to do
          > things wrong and
          > crash, but I just cannot find any such language
          > constructs in MivaScript.
          > But, since Miva Support and Development Staff continually
          > "pass-the-buck" by
          > blaming me, I thought I would finally solicit information
          > from other
          > MivaScripts users...because obviously I'm missing
          > something here.
          >
          > Thanks for your time.
          >
          > Darren Ehlers
          > OpenUI Developer Consortium
          > <A HREF ="http://www.openui.org/ ">http://www.openui.org/ </A>
          >
          >
          >
          >

          Comment


            #6
            Bug In Miva Engine or just Scripting Error



            Hi Darren,

            Frankly I am quite "happy" to hear that I am not the only one who manages to
            crash the engine with regular Mivascripts.

            On Linux or FreeBSD I never experienced any stability problems for identical
            scripts like I do on my Windows servers (Win2000 and Win2003, both on IIS 5
            and 6). What is extremely annoying now is that after 4 or 5 repeated crashes
            of EmpresaVM, IIS6 shuts Empresa off, basically requiring a manual restart
            of IIS. Of course as a security measure that is probably a good thing.

            I tend to attribute most of these crashes to filesystem issues relating to
            packing and locking. I also know that Empresa -sometimes- crashes on some
            array functions (miva_array_deserialize() when there are over 12.500
            (approx.) array members), and it choke so badly on some scripts that used
            glosub array that I actually never used it anymore. It's possible that this
            has been fixed since.

            miva_array_deserialize() never had any problems on *nix.

            I have a few scripts that can run for several hours, and here, too, the
            engine occassionally simply dies without any further notice (or entry into
            Wins event log). Since Mivascript was never truly designed for these kind of
            things, I did not consider this as a big problem (as a matter of fact it is
            quite impressive that the old lady -Empresa- handles some of those long
            running things so well). A simple workaround is to break the long task into
            smaller tasks that automatically call the next one, even though the
            undelying problem might still persist.

            I suspected memory issues, but there was nothing really worrysome to observe
            during runtime of these scripts (enough memory, no strange leaks etc). Even
            MivaMia handled really large amounts of memory quite well (>1GB) when even
            my mouse wouldn't move anymore.

            Markus








            -----Original Message-----
            From: [email protected] [mailto:[email protected]] On Behalf
            Of Darren
            Sent: Thursday, January 20, 2005 12:52 PM
            To: [email protected]; [email protected];
            [email protected]
            Subject: [meu] Bug In Miva Engine or just Scripting Error

            I'm getting sick and tired of having my scripts being blamed for crashes in
            the Miva Empresa for Windows engine.

            Can ANYONE show me any MivaScript that when coded improperly should cause
            the engine to crash? Obviously, there must be SOMETHING that I'm doing in
            my MivaScript that regularly can cause the Miva Engine to crash (at least
            the Windows version), and is documented somewhere as being something NOT to
            do.....but I cannot find anything listed anywhere.

            I know in C/C++ you have pointers....lots of room to do things wrong and
            crash, but I just cannot find any such language constructs in MivaScript.
            But, since Miva Support and Development Staff continually "pass-the-buck" by
            blaming me, I thought I would finally solicit information from other
            MivaScripts users...because obviously I'm missing something here.

            Thanks for your time.

            Darren Ehlers
            OpenUI Developer Consortium
            <A HREF ="http://www.openui.org/ ">http://www.openui.org/ </A>




            Comment


              #7
              Bug In Miva Engine or just Scripting Error



              I believe Darren's post went misunderstood or misinterpreted. There are
              certainly many bugs in diverse versions of Miva Empresa, that can cause the
              engine to crash, but Darren is not a newbie that he wouldn't know that.
              Darren reported himself some of them that passed through this list. He would
              be easily able to work around the bugs. Darren's point was that in Miva
              Script there is no way to programmatically cause the engine to crash through
              bad or too resource intensive coding. If it happens, it is Empresa who
              failed, not the script.

              Certainly, Miva Script can be written poorly, insecure, inefficient, slow,
              resource-hungry, but that's still not a reason for the Empresa to crash.
              Unlike at other languages, Miva Script _syntax_ does not let any possibility
              to crash the engine deliberately, whatever you try to write. Other languages
              can be crushed for example through improper use of pointers, (like Darren
              mentioned), or direct memory, IRQ or BIOS operations in many other
              languages), but there is nothing like that that could not be handled by
              Empresa.

              So yes, you can crash Empresa, but only through hitting an Empresa bug. If
              Empresa does not handle exceptions like low memory cleanly, it is certainly
              not a fault of the concerned Miva Script. Sure, it is better to write
              applications using as few resources as possible, but if they need more, the
              engine must either response with an error, or process them. If it crashes,
              it is an Empresa bug, not a Miva Script bug.

              Not to blame solely Miva Empresa, the fault may be also in layers below it
              (Web server, C libraries, OS, BIOS). Especially if the problem happens
              exclusively on certain platforms, there is some chance the bug is not in
              Empresa but rather elsewhere. Honestly told, I would rather expect the
              problem at the specific Empresa build in such case, though :)

              Ivo Truxa

              | http://miva.truxoft.com
              | Advanced Miva Merchant modules







              -----Original Message-----
              From: Scott McC

              It is possible (or at least was) to crash the engine using
              just MivaScript. I haven't run across anything lately that
              would crash it, but I'm sure bugs are still out there.

              One example I came across (and mind you this was 2-3 years
              ago so I forgot all the fine details) was in <MvDO>. It has
              to deal with trying to <MvDO> a function in the file you're
              running. So if you were running main.mv and tried to:
              <MvDO FILE="main.mv" NAME="l.date"
              VALUE="{showdate(s.time_t)}">
              it would cause a crash. There were other factors involved
              but that was the crux.

              Another dealt with nested functions where one was a
              built-in and one was user defined. So something like:
              <MvEVAL EXPR="{ gettoken(get_username(users.d.name), " ",
              1) }"> Once again, I think there was one other factor
              involved but it escapes me.

              These were offical "Scott Bugs". Stuff that only I could
              have found due to odd programming habits and dumb luck.

              So yes, it is/was possible to crash the engine using
              nothing but correctly written MivaScript. Now it's just a
              matter of tracking down what your scripts are doing and
              reducing it down to reach the one line of code that's
              causing headaches.

              /ScottMc

              --- Ben Walsh <[email protected]> wrote:

              > Darren,
              >
              > I assume you're using uncompiled? I had some issues with
              > the engine crashing
              > because of my code; however I don't remember exactly what
              > caused it (I think
              > it might have been a loop or something, don't know). I'll
              > see if I can find
              > any example.
              >
              > I've been using the VM ever since it came out, so I don't
              > use uncompiled any
              > more. Haven't had those problems since the old empresa
              > days.
              >
              > But I know that bad code CAN cause the engine to crash
              > (of course it doesn't
              > mean that is the problem).
              >
              > HTH,
              >
              > Ben
              >
              > -----Original Message-----
              > From: [email protected]
              > [mailto:[email protected]] On Behalf
              > Of Darren
              > Sent: Thursday, January 20, 2005 11:52 AM
              > To: [email protected]; [email protected];
              > [email protected]
              > Subject: [meu] Bug In Miva Engine or just Scripting Error
              >
              > I'm getting sick and tired of having my scripts being
              > blamed for crashes in
              > the Miva Empresa for Windows engine.
              >
              > Can ANYONE show me any MivaScript that when coded
              > improperly should cause
              > the engine to crash? Obviously, there must be SOMETHING
              > that I'm doing in
              > my MivaScript that regularly can cause the Miva Engine to
              > crash (at least
              > the Windows version), and is documented somewhere as
              > being something NOT to
              > do.....but I cannot find anything listed anywhere.
              >
              > I know in C/C++ you have pointers....lots of room to do
              > things wrong and
              > crash, but I just cannot find any such language
              > constructs in MivaScript.
              > But, since Miva Support and Development Staff continually
              > "pass-the-buck" by
              > blaming me, I thought I would finally solicit information
              > from other
              > MivaScripts users...because obviously I'm missing
              > something here.
              >
              > Thanks for your time.
              >
              > Darren Ehlers
              > OpenUI Developer Consortium
              > <A HREF ="http://www.openui.org/ ">http://www.openui.org/ </A>
              >
              >
              >
              >

              Comment

              Working...
              X