Menu

`ps_search_finish` fails because `hmm_out_history` returns 0xFFFF

Help
2016-06-14
2016-06-17
  • Daniel Wolf

    Daniel Wolf - 2016-06-14

    I'm performing text alignment on a number of utterances in a loop. After about 30 utterances, alignment fails due to a failed assert.

    This is what happens:

    1. I call ps_search_finish at the end of an utterance.
    2. Within state_align_search_finish, hmm_out_history(final_phone) returns 0xFFFF.
    3. state_align_search_finish then calls ps_alignment_iter_goto, which returns NULL because pos >= itor->vec->n_ent
    4. Thus, assert(itor != NULL); fails.

    In every loop, I create a new alignment structure and a new search structure. The strange thing is that the first ~30 utterances are aligned just fine.

    I'm happy to supply any additional information.

     
    • Nickolay V. Shmyrev

      Maybe there is a memory corruption, try to run under valgrind.

       
      • Daniel Wolf

        Daniel Wolf - 2016-06-14

        I spent the last hour with gflags (valgrind for Windows). It doesn't appear to be memory corruption.

        The failed assert reproducably occurs at a the same point in execution. Is there any information I can supply that might help solve the problem?

         
  • Daniel Wolf

    Daniel Wolf - 2016-06-16

    I did some more digging. Here's a screenshot of the code where the error occurs. You'll note that n_phones is 5.

    The following screenshot shows the first 5 entries of sas->hmms. The last entry (#4) is what final_phone points to. You'll notice that for this entry, out_history is -1. This value is then assigned to cur.id. This means that in line 224, the array index is out of bounds and returns garbage.

    So the question is: Why is finalPhone->out_history == -1?

    I followed your advice and ran valgrind. I've attached the log, but it's not very helpful. It says that there is an "invalid read" in line 224. That's exactly the out-of-bounds array access I described above.

    Valgrind doesn't seem to find any problems before that. So that means that the -1 in out_history is probably not because of memory corruption.

    I'd appreciate any help!

     
    • Nickolay V. Shmyrev

      -1 means that the final phone was never reached. So probably the search should fail early here, not proceed further. It looks like a bug then, let me check.

       
      • Nickolay V. Shmyrev

        Yeah, it is simply a bug. It should check for last.id, not for last.score. I've just committed a fix, please update.

         
        • Daniel Wolf

          Daniel Wolf - 2016-06-17

          That's great news. I was afraid it might be something harder to find. Thanks a lot, Nickolay!

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.