Menu

possible bug in ParserDel.pas

Ed Beroset
2020-05-06
2020-05-07
  • Ed Beroset

    Ed Beroset - 2020-05-06

    I have been attempting to compile and use OpenDSS on Alpine Linux in a container and believe I have found and fixed a bug. Specifically, in line 206 of ParserDel.pas within the TParser.CheckForVal() procedure, the indentation suggests that there is a missing Begin/End after the line that says:

    If TokenBuffer[1] = VariableDelimeter Then   // looking for '@'
    // shouldn't there be a Begin right here?
                  Dotpos   := pos('.', TokenBuffer);
    
     
    • Davis Montenegro

      Hi Ed,

      What version are you working with? The current version has the Begin and End:

         If Length(TokenBuffer) > 1 Then
            If TokenBuffer[1] = VariableDelimiter Then  // looking for '@'
            Begin
                  Dotpos   := pos('.', TokenBuffer);
                  CaratPos := pos('^', TokenBuffer);
                  ....
             End
      

      https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Source/Parser/ParserDel.pas

      Line 216.

      Best regards

      Davis

       
  • Ed Beroset

    Ed Beroset - 2020-05-06

    Hi Davis,

    Thanks, I see you're right, but it's peculiar. The command I used to get it is

    svn checkout https://svn.code.sf.net/p/electricdss/code/trunk/Version8/Source electric-dss
    

    I just rebuilt the container from scratch and indeed that error doesn't exist. I can only think that I must somehow have gotten a very old version. Now I'm getting this:

    An unhandled exception occurred at $00007F4B9A83DB40:
    EAccessViolation: 
      $00007F4B9A83DB40
    

    and then eventually a segfault. I'll see about adding a more descriptive error handler with a call stack to the code and try to see if I can figure this out.

     
    • Davis Montenegro

      Hi Ed,

      Try with version 7, version 8 has lots of commands related to CPU handling and several calls to Windows' specific functions for memory and processor management, which we haven't validated for other platforms.
      Both versions are stable and in production, but I guess version 7 could be a good start for testing cross platform.

      Best regards

      Davis

       
    • Ed Beroset

      Ed Beroset - 2020-05-07

      I've partially figured things out. I kept seeing this bug in ParserDel.pas and then finally figured out why: there are six copies of this file in the source tree. See https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Source/CMD_Lazz/Parser/ParserDel.pas and the bug is still there. By contrast if we use the URL you mentioned, https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Source/Parser/ParserDel.pas the bug is fixed. The problem is that I'm trying to create and use a command line version of the code in Linux in a container based on the code in Version8/Source/CMD_Lazz. See https://github.com/beroset/docker_dss for details. It almost works but has a few annoying bugs, and this is one of them.

       
      • Davis Montenegro

        Sounds great Ed,

        We are not maintaining that folder, so I guess you'll find some bugs there. You should try the version Tom McDermott is maintaining, which I'm sure will give you less trouble:

        https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version7/Source/CMD/

        Best regards

        Davis

         
  • Ed Beroset

    Ed Beroset - 2020-05-06

    Hi Davis,

    I'm trying that now. Some of the differences, e.g. in where libraries are stored and CMD_Lazz/CMD (in version 8) vs. CMD (version 7) are going to take a while to adapt. In particular, the liblinenoise source appears to be missing from the tree. I presume it's from https://github.com/antirez/linenoise. Is that correct?

     
    • Davis Montenegro

      Hi Ed,

      That's from the version Tom McDermott is developing for his personal use. I don't know those libraries and what are they used for, we don't use them in the official OpenDSS. Sorry. I guess Tom would be the best source.

      Best regards

      Davis

       
  • Roger Dugan

    Roger Dugan - 2020-05-07

    I'll let Tom know to check the Forum ...

     
  • Tom McDermott

    Tom McDermott - 2020-05-07

    I've just commited the current build instructions for opendsscmd here: https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Doc/OpenDSS_FNCS_Build.docx. You can also try the installer here, just to see if the program suits your needs before commiting to the rest of the build process: https://sourceforge.net/projects/electricdss/files/OpenDSSCmd/

    A few notes:
    1. We forked liblinenoise in order to get it working on Windows; but it's still not great on Windows.
    2. FNCS is a separate build process from PNNL repositories. Let me know if that's of any interest, because we'll eventually include FNCS in the opendsscmd desktop installers and/or opendsscmd build instructions. FNCS and HELICS co-simulation are one of the main reasons we have opendsscmd.
    3. Besides FNCS and HELICS, we have plans to more closely interface the residential and climate modules of GridLAB-D to opendsscmd
    4. There is no GUI and no plan for one. We use opendsscmd in scripted or co-simulation scenarios.
    5. I agree with Davis that the CMD_Lazz branch has gone stale. It included a GUI that "almost worked" until it no longer seemed worthwhile. Since then, it hasn't kept up with bug fixes or new features on other development branches.
    6. There is no plan for switching opendsscmd to the Version 8 branch. Many function signatures changed, and some of the Version 8 features are not easily ported to FPC. We (EPRI and PNNL) are manually synching some features between the branches, especially the Common Information Model (CIM) support, but eventually they will diverge more and more.

     
    • Ed Beroset

      Ed Beroset - 2020-05-07

      Thanks Tom, that's very helpful. I'll definitely be looking into the other resources as well.

       
  • Tom McDermott

    Tom McDermott - 2020-05-07

    BTW, we just put opendsscmd into a container for the Transactive Energy Simulation Platform (TESP), but that includes a lot more: GridLAB-D, EnergyPlus, ns-3, PYPOWER, AMES, FNCS and HELICS. opendsscmd is also in our GridAPPS-D Docker, but again, that probably includes more than what you're looking for.

     

Log in to post a comment.