Bug: Logos crashes doing a Syntax Search on an unordered group

Hi

As per the discussion in http://community.logos.com/forums/p/26601/196424.aspx#196424 doing a particular Syntax Search against an unordered group causes a crash:

image 

On my system this produces the crash log below:

1715.Logos4Crash.txt

but as you can see from http://community.logos.com/forums/p/26601/196407.aspx#196407 other crash types can occur as well.

I am running 4.2 B7

Graham

Comments

  • Melissa Snyder
    Melissa Snyder Member Posts: 4,702 ✭✭✭

    Both crash logs (yours and Ka-Liong's) appear to be from previous crashes. Yours is dated 11-25 and his is dated 10-16. The program seems to be closing, but not producing a Logos4Crash.txt file (I'm seeing the same thing). 

    I'll submit a report. Thanks.

  • Graham Criddle
    Graham Criddle MVP Posts: 33,144

    Thanks Melissa

    Yours is dated 11-25

    I spotted something strange about the timestamp but didn't chase it down!

    Graham

  • Rick Brannan (Logos)
    Rick Brannan (Logos) Member, Logos Employee Posts: 1,862

    Hi Graham

    Typically when you run an unordered group, you want to anchor it in some containing structure of some sort (a phrase or clause for LSGNT?). Otherwise, particularly with this example, the search needs to try all permutations of all options between the first word and last word of the NT. (An unordered group means something, followed by anything, followed by another something).

    I'd recommend you anchor this to a clause or phrase and see what happens.

    Rick Brannan
    Data Wrangler, Faithlife
    My books in print

  • Bradley Grainger (Logos)
    Bradley Grainger (Logos) Administrator, Logos Employee Posts: 12,070

    Without a top-level containing structure, this query will use up all the memory in your system, eventually fail to allocate new memory (after many minutes of execution), then crash (and the nature of the crash actually prevents any diagnostic information from being written to the log, so we can't tell from the log file what really happened).

  • Graham Criddle
    Graham Criddle MVP Posts: 33,144

    Rick / Bradley

    Thanks for the responses - makes a lot of sense. I had come across this and need to remember it!

    Anchoring in a clause component (for example) works fine

    Thanks again

    Graham

  • Rosie Perera
    Rosie Perera Member Posts: 26,194 ✭✭✭✭✭


    Without a top-level containing structure, this query will use up all the memory in your system, eventually fail to allocate new memory (after many minutes of execution), then crash (and the nature of the crash actually prevents any diagnostic information from being written to the log, so we can't tell from the log file what really happened).


    Can't you detect ahead of time that there's no top-level containing structure and thus the query will use up all the memory in your system and cause a crash? If so, couldn't you refuse to run it rather than allowing it to crash? I know Logos's philosophy is not to put up explanatory error messages. But something like "This query needs a top-level containing structure" would be better than crashing. Users who don't find this thread on the forum won't have any idea why it's crashing or how to avoid it.

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    Can't you detect ahead of time that there's no top-level containing structure and thus the query will use up all the memory in your system and cause a crash? If so, couldn't you refuse to run it rather than allowing it to crash?

    That reminds me that, in general, only a valid search query should be allowed to run[:)]

    Dave
    ===

    Windows 11 & Android 13

  • Rick Brannan (Logos)
    Rick Brannan (Logos) Member, Logos Employee Posts: 1,862

    Hi Rosie


    Without a top-level containing structure, this query will use up all the memory in your system, eventually fail to allocate new memory (after many minutes of execution), then crash (and the nature of the crash actually prevents any diagnostic information from being written to the log, so we can't tell from the log file what really happened).


    Can't you detect ahead of time that there's no top-level containing structure and thus the query will use up all the memory in your system and cause a crash? If so, couldn't you refuse to run it rather than allowing it to crash? I know Logos's philosophy is not to put up explanatory error messages. But something like "This query needs a top-level containing structure" would be better than crashing. Users who don't find this thread on the forum won't have any idea why it's crashing or how to avoid it.

    The crash here, I believe, depends on the range specified. I might be able to make a valid case to run this query in, say, 2 John or perhaps in a range like Eph 1.3-17. With a small enough range, I don't think this will crash, I think it will actually have enough memory to complete and return hits.

    I'm not saying we (Logos) shouldn't do anything, I'm just saying the query itself is valid and there might actually be a case for someone wanting to try it.

    Rick Brannan
    Data Wrangler, Faithlife
    My books in print

  • NetworkGeek
    NetworkGeek Member Posts: 3,731 ✭✭✭

    I agree that if possible Logos should do something to not let queries that users do incorrectly, crash the user out of their system. In fact, if you check here, I mentioned it in July and Melissa said development was working on a fix. I wonder if anything came of that?

    So I will reiterate again, the way to stop this, is the following logic:

    <within the search code>

    If request for memory fails, (assume that this is because of a run-away condition of a badly constructed search),

    then release all memory and resources owned by the task, display an appropriate user message (the search failed due to out of memory, check it and run it again), and then end the search processing, giving control of the system back to the user.

    This could be made very friendly.  In fact, the error message could point to something in the help file that outlines the top tips on what to look for (like the tip in this thread, anchor the search in a containing structure.) Or maybe the message directs the user to the forums or wiki for help if they can't get their search to work. Something friendly could be displayed here.

    This is exactly what databases do - they do not let a user query consume all system resources and crash, it's very bad for uptime and reliability. Can't we do something similar here, it's just not good software design to let a user do something within the bounds of the program usage that crashes the system!!

     

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    I'm not saying we (Logos) shouldn't do anything, I'm just saying the query itself is valid and there might actually be a case for someone wanting to try it.

    The original request was "noun followed by an adjective and they agree in gender and number". Then it became "the same search that allows the noun and adjective within certain number of words between them?" and the user crashed using the Unordered Group; not knowing that it is essentially unbound. There were plenty examples of  searches crashing or taking a very long time in L3 with unbound queries. My point is that none of the queries were constructed correctly because of ignorance and I doubt that an unbound search is ever meaningful! The simplest solution is to regard it as invalid.

    Dave
    ===

    Windows 11 & Android 13

  • Caleb Lau
    Caleb Lau Member Posts: 54 ✭✭

    Hi,

    I just learn how to use syntax search. This is why I unintentionally created a nonsense query. Obviously, I did not realize my query is "unbound".  I am especially having problem understanding how "Anything", "Gap", "Group", "Unordered Group" and "OR" work. Some guidance is very much appreciated with the following two morphological queries to get me going in the right direction. Thanks.

    1) Noun and verb in any order and within 1 word from each other, and they agree in number.

    2) Noun followed by adjective and within 3 words from each other, and they agree in case, number and gender.

     

    The following pictures are query 1 & 2 that I did using my Biblework. This is the queries that I want to perform in Logos 4.

    imageimage

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    2) Noun followed by adjective and within 3 words from each other, and they agree in case, number and gender.

    The query below stops hits occurring between clauses, but the terms could still be unrelated due to the arbitrary separation! Note that you have to set Anything as indicated in red! The dotted lines indicate that I have ticked "Matching skips levels" by right clicking the Word terms.

    Try the search without the Clause  ie. Word 1

                                                           Anything

                                                           Word 2

    and compare the two sets of results to see which is more meaningful.

    image

    Dave
    ===

    Windows 11 & Android 13

  • Caleb Lau
    Caleb Lau Member Posts: 54 ✭✭

    Hi Dave,

    Thanks for your help. I follow your example wiht "Anything set to "repeats 0 to 3" but getting 0 results. Probably the query is not correct. Biblework returns over 2000 hits.

     

    image

     

  • Caleb Lau
    Caleb Lau Member Posts: 54 ✭✭

    Hi Dave,

    I forgot to tick "Matching skips levels". Now, the query returns 1942 results. Thanks.

     

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    1) Noun and verb in any order and within 1 word from each other, and they agree in number.

    Because Unordered is unbound we have to use an OR term to specify the terms in any order and with the maximum separation of 1 word.

    Again, you can link the terms with a Clause and compare the sets of results.

    image

    Dave
    ===

    Windows 11 & Android 13

  • Caleb Lau
    Caleb Lau Member Posts: 54 ✭✭

    The search seems to match words criteria within clause boundary. Am I correct? If true, this is not the same as morphological search which ignores the syntax. This feature is in Graphical query editor. Hence, this is one of the missing feature in Logos 4.

  • Caleb Lau
    Caleb Lau Member Posts: 54 ✭✭

    Hi Dave,

    I tried the following "Unordered" query and seem to get the correct result. Thanks.

    image

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    The search seems to match words criteria within clause boundary. Am I correct?

    Yes! Clause sets the bounds for the terms below it (or subordinate to it).

    If true, this is not the same as morphological search which ignores the syntax. This feature is in Graphical query editor.

    Both Morph Search and Graphical Query editor (GQE) are text searches, so both ignore the syntax. GQE has great power in comparing terms via AGREE and is definitely needed in L4.

     

    Dave
    ===

    Windows 11 & Android 13

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    I tried the following "Unordered" query and seem to get the correct result. Thanks.

    It's not quite what you were asking! The Anything term is totally ignored within Unordered, so you may as well remove it; the word separation is determined by the size of the Clause. If you are happy with the results then you have taken one step toward mastery of syntax searches!

    Dave
    ===

    Windows 11 & Android 13

  • Caleb Lau
    Caleb Lau Member Posts: 54 ✭✭

    I tried the following "Unordered" query and seem to get the correct result. Thanks.

    It's not quite what you were asking! The Anything term is totally ignored within Unordered, so you may as well remove it; the word separation is determined by the size of the Clause. If you are happy with the results then you have taken one step toward mastery of syntax searches!

    Hi Dave,

    Thanks. Yes, "Anything" have not effect in the query. This seems to me a bug. Otherwise, how "Anything" work? Unless, it works only within Ordered group which is strange. So here, we have a missing feature and a bug. :-)

  • Dave Hooton
    Dave Hooton MVP Posts: 36,098

    I'm not saying we (Logos) shouldn't do anything, I'm just saying the query itself is valid and there might actually be a case for someone wanting to try it.

    The original request was "noun followed by an adjective and they agree in gender and number". Then it became "the same search that allows the noun and adjective within certain number of words between them?" and the user crashed using the Unordered Group; not knowing that it is essentially unbound. There were plenty examples of  searches crashing or taking a very long time in L3 with unbound queries. My point is that none of the queries were constructed correctly because of ignorance and I doubt that an unbound search is ever meaningful! The simplest solution is to regard it as invalid.

    Rick,

    The alternative would be to allow Anything to function within an Unordered group because it is ignored at present, thus making Unordered inherently unbound. I would also like to see the selected parameters for Anything displayed in the diagram eg. repeats 0 to 3.

    Dave
    ===

    Windows 11 & Android 13

This discussion has been closed.