Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear which functions are not interpreted #722

Open
podhrmic opened this issue Nov 20, 2024 · 1 comment
Open

Unclear which functions are not interpreted #722

podhrmic opened this issue Nov 20, 2024 · 1 comment
Labels
CN spec testing cn CN-exec Related to CN executable spec generation, called using `cn instrument` question Further information is requested

Comments

@podhrmic
Copy link
Contributor

When running cn test ... on various OpenSUT code, I often get the following error:

root@ac94c45769b6:/work/components/mission_protection_system/src# cn test --output-dir=test -I include --include=include/wars.h --magic-comment-char-dollar components/instrumentation_common.c
include/common.h:34:24: warning: experimental keyword 'cn_function' (use of experimental features is discouraged)
uint8_t c_NINSTR() /*$ cn_function NINSTR; $*/ { return NINSTR; }
                       ^~~~~~~~~~~ 
...
cn: internal error, uncaught exception:
    Failure("Uninterpreted CN functions not supported at runtime. Please provide a concrete function definition")
    Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
    Called from Cn__Cn_internal_to_ail.cn_to_ail_function_internal in file "backend/cn/lib/cn_internal_to_ail.ml", lines 2952-2954, characters 6-29
    Called from Stdlib__List.map in file "list.ml", line 86, characters 15-19
    Called from Cn__Executable_spec_internal.generate_c_functions_internal in file "backend/cn/lib/executable_spec_internal.ml", lines 376-382, characters 4-24
    Called from Cn__Executable_spec.main in file "backend/cn/lib/executable_spec.ml", line 233, characters 4-63
    Called from Dune__exe__Main.run_tests.(fun) in file "backend/cn/bin/main.ml", lines 495-504, characters 10-26
    Called from Cerb_colour.without_colour in file "util/cerb_colour.ml", line 40, characters 10-13
    Called from Dune__exe__Main.run_tests.(fun) in file "backend/cn/bin/main.ml", lines 476-531, characters 6-10
    Called from Dune__exe__Main.with_well_formedness_check in file "backend/cn/bin/main.ml", lines 157-168, characters 6-48
    Re-raised at Dune__exe__Main.with_well_formedness_check in file "backend/cn/bin/main.ml", line 176, characters 4-69
    Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
    Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 35, characters 37-44

The source code hides certain functions/features to make cn verify pass, but it is difficult for me to understand which functions are causing the problems for cn test. I tried removing all modifications, but I am still hitting the same error. Is it possible to add a more informative output, ideally pointing at the offending line in the C source?

@dc-mak dc-mak added question Further information is requested cn CN spec testing labels Nov 20, 2024
@rbanerjee20 rbanerjee20 added the CN-exec Related to CN executable spec generation, called using `cn instrument` label Nov 26, 2024
@podhrmic
Copy link
Contributor Author

podhrmic commented Dec 9, 2024

@ZippeyKeys12 this issue is important for debugging - the OpenSUT code contains lot of #ifdef CN_ENV to help the verification pass, but testing might need a different set of #ifdef CN_TEST macros. So a more informative output would be very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CN spec testing cn CN-exec Related to CN executable spec generation, called using `cn instrument` question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants