rnp icon indicating copy to clipboard operation
rnp copied to clipboard

runtime error: call to function ffi_pass_callback_file

Open ni4 opened this issue 5 years ago • 7 comments

Description

Following error appears on centos sanitize build:

/__w/rnp/rnp/src/lib/rnp.cpp:1080:7: runtime error: call to function ffi_pass_callback_file(rnp_ffi_st*, void*, rnp_key_handle_st*, char const*, char*, unsigned long) through pointer to incorrect function type 'bool (*)(rnp_ffi_st *, void *, rnp_key_handle_st *, const char *, char *, unsigned long)'
2020-10-16T16:39:09.8868329Z 201: /__w/rnp/rnp/src/rnp/fficli.cpp:315: note: ffi_pass_callback_file(rnp_ffi_st*, void*, rnp_key_handle_st*, char const*, char*, unsigned long) defined here

ni4 avatar Oct 16 '20 18:10 ni4

Strange since ffi_pass_callback_file is defined correctly:

static bool
ffi_pass_callback_file(rnp_ffi_t        ffi,
                       void *           app_ctx,
                       rnp_key_handle_t key,
                       const char *     pgp_context,
                       char             buf[],
                       size_t           buf_len)

ni4 avatar Feb 17 '21 11:02 ni4

This could be false positive, as the issue with stdout_writer, see PR #1709. Possible solution:

#if defined(__clang__)
__attribute__((no_sanitize("undefined")))
#endif

ni4 avatar Nov 25 '21 11:11 ni4

It seems like a trait of outdated Clang shipped with CentOS 7.

In PR 1792, CI checks on centos-based systems with "mode sanitize" and clang:

  • centos7 / centos:7 Botan [mode sanitize; test type ; CC clang; GnuPG stabl... - FAIL
  • centos7 / centos:7 Botan [mode sanitize; test type ; CC clang; GnuPG beta] - FAIL
  • centos8-openssl / centos:stream8 OpenSSL [test type rnp_tests; mode sanitiz... CC clang... - PASS
  • centos8 / centos:stream8 Botan [test type ; mode sanitize; CC clang; GnuPG stable] - PASS
  • centos8-openssl / centos:stream8 OpenSSL [test type cli_tests; mode sanitiz... CC clang... - PASS
  • centos8 / centos:stream8 Botan [test type ; mode sanitize; CC clang; GnuPG - PASS

So I'd suggest to disregard the combination centos7 + clang + sanitize.

andrey-utkin avatar Apr 13 '22 17:04 andrey-utkin

@andrey-utkin I think it would be the right time to drop CentOS 7, especially since CentOS 8 has already been discontinued. Maybe make the next release the last release for CentOS 7?

ronaldtse avatar Apr 13 '22 17:04 ronaldtse

@ronaldtse CentOS 7 has EOL 2024, while 8 had end of 2021, is it okay to drop 2-year support timeline? Also, then should not we add support for CentOS stream 9 instead?

ni4 avatar Apr 13 '22 17:04 ni4

@ni4 whoa, I did not realise that CentOS 8 was EOLed before CentOS 7. In this case we should keep CentOS 7... And yes we should support the CentOS Stream version. I think deprecating CentOS 8 and adding support for CentOS 9 can be independent steps.

ronaldtse avatar Apr 13 '22 17:04 ronaldtse

Oh, I forgot - we already use CentOS 8 Stream images in CI, but those are unofficial (there are no official on the Docker hub, they use Quay). Will file an issue for CentOS 9 Stream.

ni4 avatar Apr 14 '22 09:04 ni4