tflite-rs icon indicating copy to clipboard operation
tflite-rs copied to clipboard

Segfault in unit tests

Open ctsa opened this issue 2 years ago • 1 comments

I'm using the lastest rust version (1.63) on Centos7. I get a clean build of tflite-rs but the unit tests are segfaulting. I can trace one such problem down to the following line in unittest_struct_with_strings:

https://github.com/boncheolgu/tflite-rs/blob/master/src/model/stl/string.rs#L116

The error text is:

error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `/home/csaunders/devel/github/tflite-rs/target/debug/deps/tflite-87cf1d995d6e7fc6 --test-threads 1 --nocapture unittest_struct_with_strings` (signal: 11, SIGSEGV: invalid memory reference)

This is the primary issue I'm concerned about.

As a related issue/question - I was going to play with the cpp macro interaction in the unittest_struct_with_strings test a bit to uncover what was happening, but then I discovered that all of the inline c++ is pre-built once and doesn't updated on a rebuild. A full clean requires a full tensorflow rebuild. Is there a cargo command or other workaround to force the rust cpp macros to rebuild?

ctsa avatar Sep 09 '22 21:09 ctsa

yes, there is a feature, generate_model_apis.

$ cargo build --features generate_model_apis

boncheolgu avatar Sep 10 '22 01:09 boncheolgu