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

Calls to unknown functions in SV-COMP #1239

Closed
michael-schwarz opened this issue Nov 7, 2023 · 7 comments · Fixed by #1242 or #1269
Closed

Calls to unknown functions in SV-COMP #1239

michael-schwarz opened this issue Nov 7, 2023 · 7 comments · Fixed by #1242 or #1269
Assignees
Milestone

Comments

@michael-schwarz
Copy link
Member

michael-schwarz commented Nov 7, 2023

On top of the missing calls to printLongLongLine (#1237) Goblint reports the following calls to functions which are missing implementations. Most of them seem to be about missing builtins, which we should probably attempt to fix. (list deduplicated)

LDV issues

./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-dibusb-mb.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:575@tid:Top Threads(#1)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-dibusb-mb.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6284:5-6284:56)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-umt-010.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:353@tid:Top Threads(#2)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-umt-010.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6242:5-6242:55)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-ce6230.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:714@tid:Top Threads(#3)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-ce6230.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6873:5-6873:78)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-dtv5100.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:560@tid:Top Threads(#0)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-dtv5100.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6482:5-6482:48)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-digitv.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:866@tid:Top Threads(#1)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-digitv.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6886:5-6886:55)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-digitv.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:866@tid:Top Threads(#2)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-digitv.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6886:5-6886:55)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-umt-010.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:389@tid:Top Threads(#0)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-umt-010.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6294:5-6294:48)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-digitv.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:973@tid:Top Threads(#2)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-digitv.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6941:5-6941:56)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-au6610.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:692@tid:Top Threads(#top)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-au6610.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6549:5-6549:48)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-dibusb-mb.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:515@tid:Top Threads(#2)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-dibusb-mb.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6147:5-6147:55)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-gl861.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:475@tid:Top Threads(#1)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-gl861.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6426:5-6426:75)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-ce6230.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:1637@tid:Top Threads(#4)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-ce6230.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:7060:5-7060:78)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-ce6230.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:1637@tid:Top Threads(#3)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-ce6230.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:7060:5-7060:78)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-dtv5100.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:488@tid:Top Threads(#top)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-dtv5100.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6449:5-6449:77)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-pctv452e.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:2178@tid:Top Threads(#0)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-pctv452e.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:9196:5-9196:61)
./SV-COMP23_valid-memsafety.32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-gl861.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:642@tid:Top Threads(#0)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/32_1_cilled_ok_nondet_linux-3.4-32_1-drivers--media--dvb--dvb-usb--dvb-usb-gl861.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6456:5-6456:48)
./SV-COMP23_valid-memsafety.43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-au6610.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.yml.log:[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:534@tid:Top Threads(#1)) (/home/goblint2/svcomp/sv-benchmarks/c/ldv-linux-3.4-simple/43_1a_cilled_ok_nondet_linux-43_1a-drivers--media--dvb--dvb-usb--dvb-usb-au6610.ko-ldv_main0_sequence_infinite_withcheck_stateful.cil.out.i:6534:5-6534:76)

__VERIFIER_nondet_size_t (#1242)

./SV-COMP23_valid-memsafety.ddv_machzwd_inb_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inb_p.i:2780:3-2780:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_outb_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_outb_p.i:2779:3-2779:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_outl_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_outl_p.i:2779:3-2779:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inb.i:2779:3-2779:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inl_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inl_p.i:2782:3-2782:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inl_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inl_p.i:2796:3-2796:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_pthread_mutex_unlock.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_pthread_mutex_unlock.i:2781:3-2781:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inw_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inw_p.i:2781:3-2781:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inw_p.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inw_p.i:2795:3-2795:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_outl.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_outl.i:2779:3-2779:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_outl.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_outl.i:2793:3-2793:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inl.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inl.i:2779:3-2779:44)
./SV-COMP23_valid-memsafety.ddv_machzwd_inl.yml.log:[Error][Imprecise][Unsound] Function definition missing for __VERIFIER_nondet_size_t (/home/goblint2/svcomp/sv-benchmarks/c/ddv-machzwd/ddv_machzwd_inl.i:2793:3-2793:44)

__builtin_memcp (#1242)

./SV-COMP23_valid-memsafety.if_etherip-fixed-double-free-invalid-deref2.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_memcmp (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-fixed-double-free-invalid-deref2.i:7971:10-7978:51)
./SV-COMP23_valid-memsafety.if_etherip-double-free.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_memcmp (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-double-free.i:7969:10-7976:51)
./SV-COMP23_valid-memsafety.if_etherip-fixed-double-free-invalid-deref1.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_memcmp (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-fixed-double-free-invalid-deref1.i:7970:10-7977:51)
./SV-COMP23_valid-memsafety.if_etherip-fixed-double-free.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_memcmp (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-fixed-double-free.i:7972:10-7979:51)

__builtin_strlen (#1242)

./SV-COMP23_valid-memsafety.instrumented_interval_nohup_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_strlen (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_interval_nohup_comb.i:47719:9-47719:50)
./SV-COMP23_valid-memsafety.instrumented_interval_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_strlen (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_interval_cksum_comb.i:47763:9-47763:50)
./SV-COMP23_valid-memsafety.instrumented_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_strlen (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_cksum_comb.i:47722:9-47722:50)
./SV-COMP23_valid-memsafety.instrumented_nohup_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __builtin_strlen (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_nohup_comb.i:47661:9-47661:50)

__fread_unlocked_* (#1242)

./SV-COMP23_valid-memsafety.instrumented_interval_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __fread_unlocked_chk (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_interval_cksum_comb.i:8386:5-8386:110)
./SV-COMP23_valid-memsafety.instrumented_interval_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __fread_unlocked_chk_warn (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_interval_cksum_comb.i:8396:7-8397:77)
./SV-COMP23_valid-memsafety.instrumented_interval_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __fread_unlocked_alias (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_interval_cksum_comb.i:8409:3-8409:106)
./SV-COMP23_valid-memsafety.instrumented_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __fread_unlocked_chk_warn (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_cksum_comb.i:8396:7-8397:77)
./SV-COMP23_valid-memsafety.instrumented_cksum_comb.yml.log:[Error][Imprecise][Unsound] Function definition missing for __fread_unlocked_alias (/home/goblint2/svcomp/sv-benchmarks/c/goblint-coreutils/instrumented_cksum_comb.i:8409:3-8409:106)

_Exit (#1242)

./SV-COMP23_valid-memcleanup.global-atexit-1.yml.log:[Error][Imprecise][Unsound] Function definition missing for _Exit (/home/goblint2/svcomp/sv-benchmarks/c/memsafety/global-atexit-1.i:566:32-566:40)

_assert (#1242)

./SV-COMP23_valid-memsafety.if_etherip-double-free.yml.log:[Error][Imprecise][Unsound] Function definition missing for __assert (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-double-free.i:402:5-402:66)
./SV-COMP23_valid-memsafety.if_etherip-fixed-double-free-invalid-deref2.yml.log:[Error][Imprecise][Unsound] Function definition missing for __assert (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-fixed-double-free-invalid-deref2.i:402:5-402:66)
./SV-COMP23_valid-memsafety.if_etherip-fixed-double-free-invalid-deref1.yml.log:[Error][Imprecise][Unsound] Function definition missing for __assert (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-fixed-double-free-invalid-deref1.i:402:5-402:66)
./SV-COMP23_valid-memsafety.if_etherip-fixed-double-free.yml.log:[Error][Imprecise][Unsound] Function definition missing for __assert (/home/goblint2/svcomp/sv-benchmarks/c/openbsd-6.2/if_etherip-fixed-double-free.i:402:5-402:66)
@michael-schwarz michael-schwarz added this to the SV-COMP 2024 milestone Nov 7, 2023
@sim642
Copy link
Member

sim642 commented Nov 7, 2023

[Error][Imprecise][Unsound] Function definition missing for (alloc@sid:353@tid:Top Threads(#2))

I'm not sure what this means. Are we somehow calling heap memory?

@michael-schwarz
Copy link
Member Author

Are we somehow calling heap memory?

This is what the call looks like, the warning is issued in the last line here.

static int dibusb_thomson_tuner_attach(struct dvb_usb_adapter *adap )
{ 
 [...]

  tmp___9 = (struct dvb_frontend *(*)(struct dvb_frontend *fe , int pll_addr , struct i2c_adapter *i2c , unsigned int pll_desc_id ))tmp___10;

  __a = tmp___9;
  __cil_tmp16 = 0 * 360UL;
  __cil_tmp17 = 1600 + __cil_tmp16;
  __cil_tmp18 = (unsigned long )adap;
  __cil_tmp19 = __cil_tmp18 + __cil_tmp17;
  __cil_tmp20 = *((struct dvb_frontend **)__cil_tmp19);
  __cil_tmp21 = *((struct dvb_usb_device **)adap);
  __cil_tmp22 = (unsigned long )__cil_tmp21;
  __cil_tmp23 = __cil_tmp22 + 3720;
  __cil_tmp24 = (struct i2c_adapter *)__cil_tmp23;
  tmp___11 = (*__a)(__cil_tmp20, 97, __cil_tmp24, 5U);
}

Given the message comes from this code where f is a varinfo, I wonder if we are missing a deref somewhere here?

let unknown_desc f =
 let old_accesses (kind: AccessKind.t) args = match kind with
   | Write when GobConfig.get_bool "sem.unknown_function.invalidate.args" -> args
   | Write -> []
   | Read when GobConfig.get_bool "sem.unknown_function.read.args" -> args
   | Read -> []
   | Free -> []
   | Call when get_bool "sem.unknown_function.call.args" -> args
   | Call -> []
   | Spawn when get_bool "sem.unknown_function.spawn" -> args
   | Spawn -> []
 in
 let attrs: LibraryDesc.attr list =
   if GobConfig.get_bool "sem.unknown_function.invalidate.globals" then
     [InvalidateGlobals]
   else
     []
 in
 (* TODO: remove hack when all classify are migrated *)
 if not (CilType.Varinfo.equal f dummyFunDec.svar) && not (use_special f.vname) then (
   M.msg_final Error ~category:Imprecise ~tags:[Category Unsound] "Function definition missing";
   M.error ~category:Imprecise ~tags:[Category Unsound] "Function definition missing for %s" f.vname
 );
 LibraryDesc.of_old ~attrs old_accesses

@michael-schwarz
Copy link
Member Author

It looks like the source in the ldv tasks is the following gem (there is modelling missing again):

void *__symbol_get(const char *arg0) {
  return ldv_malloc(0UL);
}
tmp___10 = __symbol_get("dib3000mb_attach");
tmp___9 = (struct dvb_frontend *(*)(struct dib3000_config const *config , struct i2c_adapter *i2c ,
                                      struct dib_fe_xfer_ops *xfer_ops ))tmp___10;
__a = tmp___9;
tmp___11 = (*__a)(__cil_tmp16, __cil_tmp20, __cil_tmp21);
// Call to __a

I don't think there is anything we can fix in general here. If we are "unsound" for one of these tasks, we will just have to fight for their removal.

@sim642
Copy link
Member

sim642 commented Nov 8, 2023

I think we found something similar last year because I made some changes here: https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks/-/merge_requests/1384. But the change was to consider them as valid-memsafety violation.

I now see that all the cases are from MemSafety runs, so this is a non-issue as long as we actually consider the dereference invalid. It should be regardless of being a function pointer because the allocated block has size 0.

@sim642
Copy link
Member

sim642 commented Nov 20, 2023

In preruns from Dirk I noticed more unknown functions in Juliet tasks:

[Error][Imprecise][Unsound] Function definition missing for wprintf
[Error][Imprecise][Unsound] Function definition missing for iswxdigit
[Error][Imprecise][Unsound] Function definition missing for swscanf

@sim642 sim642 reopened this Nov 20, 2023
@michael-schwarz michael-schwarz self-assigned this Nov 20, 2023
@sim642
Copy link
Member

sim642 commented Nov 22, 2023

From Dirk's latest prerun logs, we still have a lot of missing function definitions. Some are due to LDV benchmarks being incomplete and there's nothing we should do about it (https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks/-/issues/1398).

From standard functions it seems to be imaxabs and the following:

SV-COMP24_no-overflow.comm_3args_ok.yml.log
4841:[Error][Imprecise][Unsound] Function definition missing for feof_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:158188:9-158188:30)
4861:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:158194:18-158194:59)
4903:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:158194:18-158194:59)
4929:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:88234:13-88234:40)
4991:[Error][Imprecise][Unsound] Function definition missing for strcoll (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:163567:9-163567:31)
5022:[Error][Imprecise][Unsound] Function definition missing for strcoll (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:163567:9-163567:31)
5075:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:88329:21-88329:48)
5120:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:177782:9-177782:71)
5136:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:177790:9-177790:71)
5137:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:177793:9-177793:71)
5138:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:177797:5-177797:61)
5195:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/comm_3args_ok.c:88329:21-88329:48)
SV-COMP24_unreach-call.instrumented_cut_comb.yml.log
1288:[Error][Imprecise][Unsound] Function definition missing for __strndup (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:65430:3-65430:33)
1888:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:87446:17-87447:100)
1914:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:87624:13-87625:65)
2031:[Error][Imprecise][Unsound] Function definition missing for __fread_chk_warn (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:8300:7-8301:63)
2057:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:87649:11-87650:69)
2100:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:87684:11-87685:79)
2148:[Error][Imprecise][Unsound] Function definition missing for clearerr_unlocked (../../sv-benchmarks/c/goblint-coreutils/instrumented_cut_comb.i:87960:5-87960:30)
6497:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked
6498:[Error][Imprecise][Unsound] Function definition missing for clearerr_unlocked
6499:[Error][Imprecise][Unsound] Function definition missing for __strndup
SV-COMP24_no-overflow.uniq_3args_ok.yml.log
5020:[Error][Imprecise][Unsound] Function definition missing for feof_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:158281:9-158281:30)
5040:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:158287:18-158287:59)
5080:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:158287:18-158287:59)
5192:[Error][Imprecise][Unsound] Function definition missing for strcoll (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:163698:9-163698:31)
5227:[Error][Imprecise][Unsound] Function definition missing for strcoll (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:163698:9-163698:31)
5281:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:87722:17-87722:81)
5297:[Error][Imprecise][Unsound] Function definition missing for feof_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:87708:16-87708:38)
5322:[Error][Imprecise][Unsound] Function definition missing for fwrite_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:177930:5-177930:61)
5338:[Error][Imprecise][Unsound] Function definition missing for feof_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:87749:16-87749:38)
5356:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:87754:21-87754:43)
5373:[Error][Imprecise][Unsound] Function definition missing for ferror_unlocked (../../sv-benchmarks/c/coreutils-v8.31/uniq_3args_ok.c:87819:10-87819:61)
SV-COMP24_no-overflow.env_3args_ok.yml.log
4976:[Error][Imprecise][Unsound] Function definition missing for stpcpy (../../sv-benchmarks/c/coreutils-v8.31/env_3args_ok.c:85495:17-85495:39)
5110:[Error][Imprecise][Unsound] Function definition missing for __libc_current_sigrtmin (../../sv-benchmarks/c/coreutils-v8.31/env_3args_ok.c:164659:17-164659:50)
5125:[Error][Imprecise][Unsound] Function definition missing for __libc_current_sigrtmax (../../sv-benchmarks/c/coreutils-v8.31/env_3args_ok.c:164660:17-164660:50)
5158:[Error][Imprecise][Unsound] Function definition missing for __libc_current_sigrtmin (../../sv-benchmarks/c/coreutils-v8.31/env_3args_ok.c:164535:13-164535:46)
5173:[Error][Imprecise][Unsound] Function definition missing for __libc_current_sigrtmax (../../sv-benchmarks/c/coreutils-v8.31/env_3args_ok.c:164536:13-164536:46)
SV-COMP24_valid-memsafety.net_reset.yml.log
48:[Error][Imprecise][Unsound] Function definition missing for addrcmp (../../sv-benchmarks/c/loops-crafted-1/net_reset.c:210:8-210:174)
49:[Error][Imprecise][Unsound] Function definition missing for addrcmp (../../sv-benchmarks/c/loops-crafted-1/net_reset.c:210:8-210:174)
50:[Error][Imprecise][Unsound] Function definition missing for addrcmp (../../sv-benchmarks/c/loops-crafted-1/net_reset.c:210:8-210:174)
51:[Error][Imprecise][Unsound] Function definition missing for addrcmp (../../sv-benchmarks/c/loops-crafted-1/net_reset.c:210:8-210:174)
52:[Error][Imprecise][Unsound] Function definition missing for addrcmp (../../sv-benchmarks/c/loops-crafted-1/net_reset.c:210:8-210:174)

I will reassign this to @karoliineh.

@sim642 sim642 assigned karoliineh and unassigned michael-schwarz Nov 22, 2023
@michael-schwarz
Copy link
Member Author

I will reassign this to @karoliineh.

Thanks, we got a bit swamped with MemSafety things here, I'm grateful if Karoliine has time to do this.

karoliineh added a commit that referenced this issue Nov 22, 2023
sim642 added a commit to sim642/opam-repository that referenced this issue Nov 24, 2023
nberth pushed a commit to nberth/opam-repository that referenced this issue Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants