Uploaded image for project: 'SWORD'
  1. SWORD
  2. API-150

Unknown problem with Strong's keyed LD modules

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: None
    • Component/s: core, import/export
    • Labels:
      None

      Description

      In recent versions of Sword, Strong's keyed LD modules will loop infinitely due to some bad sort/compare code somewhere.

      The BDBGlosses_Strongs module (released 2012-04-14) demonstrates this in current-version front ends. Similarly, it is unbuildable with recent build tools, and I had to use tools from r2565 to build the module. It's keys are H1 through H8674, without duplicates that I can see or any other problems that should prevent straightforward building.

        Attachments

          Activity

          Hide
          kalemas Kostya Maslyuk added a comment -

          Not sure but my investigations at MOD-61 would help.

          Have we defined sort order for dictionaries? And maybe we should force module authors to place entries in that order? I have logged module creation and there is much of sorting this cause problems...

          Show
          kalemas Kostya Maslyuk added a comment - Not sure but my investigations at MOD-61 would help. Have we defined sort order for dictionaries? And maybe we should force module authors to place entries in that order? I have logged module creation and there is much of sorting this cause problems...
          Hide
          kalemas Kostya Maslyuk added a comment -

          I see that when we write for example key H77, the last key is H9, then last key becomes H99 and when we write keys after H1000 - the last key if H999.

          Maybe we need some kind of number-aware sorting (sorry if i'm incorrect, i mean we may need to detect numbers in keys and sort relative to them)? Message me when you decide what we actually need, i may make some work.

          Show
          kalemas Kostya Maslyuk added a comment - I see that when we write for example key H77, the last key is H9, then last key becomes H99 and when we write keys after H1000 - the last key if H999. Maybe we need some kind of number-aware sorting (sorry if i'm incorrect, i mean we may need to detect numbers in keys and sort relative to them)? Message me when you decide what we actually need, i may make some work.
          Hide
          chrislit Chris Little added a comment -

          Key sort order is defined by whatever comparison function we use, probably istrcmp(). Module authors do not need to place entries in any particular order (and couldn't reliably do so anyway), because the engine is supposed to re-order keys into its correct sort order.

          The potential problem is that we have slightly different sorting algorithms when the module is written and when it is read. Maybe localization is a factor on some systems. Maybe we have a missing toupper() step somewhere. Maybe the comparison function is slightly different in glibc vs. on Windows. None of these seem particularly likely, but it seems that there must be a difference in comparison somewhere.

          Show
          chrislit Chris Little added a comment - Key sort order is defined by whatever comparison function we use, probably istrcmp(). Module authors do not need to place entries in any particular order (and couldn't reliably do so anyway), because the engine is supposed to re-order keys into its correct sort order. The potential problem is that we have slightly different sorting algorithms when the module is written and when it is read. Maybe localization is a factor on some systems. Maybe we have a missing toupper() step somewhere. Maybe the comparison function is slightly different in glibc vs. on Windows. None of these seem particularly likely, but it seems that there must be a difference in comparison somewhere.
          Hide
          kalemas Kostya Maslyuk added a comment -

          Did you read my commenytaries for MOD-61 issue? Any dictionary with entries that are numbers but not padded correctly without StrongsPadding=false in conf file will cause infinite loop on frontend's side...

          Are you still experience problems building module from attached file? I don't.

          The actual problem that i would like to highlight is that sorting with strcmp()/strncmp() places entry H9 after H77. It is correct from sorting algoritm point of view, but would cause confusion from user's.

          Show
          kalemas Kostya Maslyuk added a comment - Did you read my commenytaries for MOD-61 issue? Any dictionary with entries that are numbers but not padded correctly without StrongsPadding=false in conf file will cause infinite loop on frontend's side... Are you still experience problems building module from attached file? I don't. The actual problem that i would like to highlight is that sorting with strcmp()/strncmp() places entry H9 after H77. It is correct from sorting algoritm point of view, but would cause confusion from user's.
          Hide
          kalemas Kostya Maslyuk added a comment -

          Actually i can not reproduce this issue. Can't we close it?

          Show
          kalemas Kostya Maslyuk added a comment - Actually i can not reproduce this issue. Can't we close it?
          Hide
          kalemas Kostya Maslyuk added a comment -

          ZZzz..

          Show
          kalemas Kostya Maslyuk added a comment - ZZzz..

            People

            • Assignee:
              Unassigned
              Reporter:
              chrislit Chris Little
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: