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

Could Rosecheckers skip errors in standard libraries? #1

Open
jaypiper opened this issue Jan 17, 2023 · 0 comments
Open

Could Rosecheckers skip errors in standard libraries? #1

jaypiper opened this issue Jan 17, 2023 · 0 comments

Comments

@jaypiper
Copy link

jaypiper commented Jan 17, 2023

When we try Rosecheckers in Ubuntu22.04 (gcc 11.3.0), it reports many errors in standard libraries and then exits with an exception, in which case no CERT C violation is printed.

Here are some examples:

  1. malloc
    We run the Rosecheckers on device.c, and it shows that the arguments of attribute malloc not match. The malloc with arguments is introduced in gcc11, as mentioned here.
./rosecheckers/rosecheckers ../nemu/src/device/device.c -I../nemu/include -I../nemu/src/isa/riscv32/include -D__GUEST_ISA__=riscv32 -DCONFIG_RTC_MMIO=0xa0000048 -DCONFIG_VGA_CTL_MMIO=0xa0000100 -DCONFIG_FB_ADDR=0xa1000000 -DCONFIG_SERIAL_MMIO=0xa00003f8 -DCONFIG_SDCARD_CTL_MMIO=0xa3000000 -DCONFIG_SDCARD_IMG_PATH="abc" -DITRACE_COND=true
"/usr/include/stdlib.h", line 566: error: attribute "__malloc__" does not take
          arguments
      __attr_dealloc_free;
      ^

"/usr/include/stdlib.h", line 570: error: attribute "__malloc__" does not take
          arguments
       __THROW __attr_dealloc (reallocarray, 1);
               ^

"/usr/include/stdio.h", line 189: error: attribute "__malloc__" does not take
          arguments
    __attribute_malloc__ __attr_dealloc_fclose __wur;
                         ^
……

Errors in Processing Input File: throwing an instance of "frontend_failed" exception due to syntax errors detected in the input code 

  1. SDL
    We then run it on p-device.c, which is the preprocessed device.c, with the malloc with arguments removed. The #include stack of avx headers is: SDL.h -> SDL_cpuinfo.h -> immintrin.h -> avx...
./rosecheckers/rosecheckers nemu/p-device.c -I../nemu/include -I../nemu/src/isa/riscv32/include -D__GUEST_ISA__=riscv32 -DCONFIG_RTC_MMIO=0xa0000048 -DCONFIG_VGA_CTL_MMIO=0xa0000100 -DCONFIG_FB_ADDR=0xa1000000 -DCONFIG_SERIAL_MMIO=0xa00003f8 -DCONFIG_SDCARD_CTL_MMIO=0xa3000000 -DCONFIG_SDCARD_IMG_PATH="abc" -DITRACE_COND=true
"/usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h", line 1500: error:
          invalid type conversion
    return ((__m256d) __builtin_ia32_vinsertf128_pd256 ((__v4df)(__m256d)(_mm256_setzero_pd ()), (__v2df)(__m128d)(__A), (int)(0)));
            ^

"/usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h", line 1506: error:
          invalid type conversion
    return ((__m256) __builtin_ia32_vinsertf128_ps256 ((__v8sf)(__m256)(_mm256_setzero_ps ()), (__v4sf)(__m128)(__A), (int)(0)));
            ^
……
"/usr/lib/gcc/x86_64-linux-gnu/11/include/avx512fintrin.h", line 13345: error:
          invalid type conversion
    return (__m512d) __builtin_ia32_vfmsubpd512_mask ((__v8df) __A,
            ^

Errors in Processing Input File: throwing an instance of "frontend_failed" exception due to syntax errors detected in the input code 

The problem of SDL also occurs in the provided docker, while the malloc does not due to the gcc version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant