Skip to content

Runtime Error when compiling with -O2 or higher #7

@jhennrich

Description

@jhennrich

I managed to build kaldi for android (ndk r16b, api 21, arm) using your dockerfile and also crosscompiling on my linux_x86_64 machine following your blog post. However I get runtime errors when I start onlinedecoding. This happens only when compiling with "-O2" or "-O3". With "-O0" or "-O1" everything works like a charm. The behavior is the same with the docker-build and locally cross-compiled version.

This is the error:
ERROR: FstHeader::Read: Bad FST header: HCLG.fst
ERROR ([5.4.153~1-3f4f4]:ReadFstKaldiGeneric():kaldi-fst-io.cc:53) Reading FST: error reading FST header from HCLG.fst

Digging into the problem I found that kaldi::Input input stream is corrupted: (again, works with -O0/O1, so the fst-file should be alright)

kaldi::Input ki("HCLG.fst");
ki.Stream().good() // false
ki.Stream().eof() // false
ki.Stream().fail() // true
ki.Stream().bad() // true

Any Idea what might be the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions