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

Possibly missing included files in src/native/counters.h when compiling with a self-built LLVM tool #96

Open
Non1187 opened this issue Oct 31, 2024 · 0 comments

Comments

@Non1187
Copy link

Non1187 commented Oct 31, 2024

When I build atheris by pip install ., some errors occur:

Error Information
➜  atheris git:(master) pip install .

Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Processing /root/autodl-tmp/atheris
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: atheris
Building wheel for atheris (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for atheris (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [88 lines of output]
......
src/native/counters.cc:26:41: error: unknown type name 'uint8_t'
26 | void __sanitizer_cov_8bit_counters_init(uint8_t* start, uint8_t* stop);
| ^
src/native/counters.cc:26:57: error: unknown type name 'uint8_t'
26 | void __sanitizer_cov_8bit_counters_init(uint8_t* start, uint8_t* stop);
| ^
src/native/counters.cc:27:31: error: unknown type name 'uint8_t'
27 | void __sanitizer_cov_pcs_init(uint8_t* pcs_beg, uint8_t* pcs_end);
| ^
src/native/counters.cc:27:49: error: unknown type name 'uint8_t'
27 | void __sanitizer_cov_pcs_init(uint8_t* pcs_beg, uint8_t* pcs_end);
| ^
src/native/counters.cc:134:30: error: unknown type name 'uint8_t'
134 | reinterpret_cast<uint8_t*>(pctable + counter_index_registered),
| ^
src/native/counters.cc:135:41: error: unknown type name 'uint8_t'
135 | .pctable_end = reinterpret_cast<uint8_t*>(pctable + next_index)};
| ^
src/native/counters.cc:134:40: error: cannot initialize a member subobject of type 'unsigned char *' with an rvalue of type 'PCTableEntry '
134 | reinterpret_cast<uint8_t
>(pctable + counter_index_registered),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/native/counters.cc:135:51: error: cannot initialize a member subobject of type 'unsigned char *' with an rvalue of type 'PCTableEntry '
135 | .pctable_end = reinterpret_cast<uint8_t
>(pctable + next_index)};
| ^~~~~~~~~~~~~~~~~~~~
8 errors generated.
error: command '/root/autodl-tmp/install/llvm/installed/llvm-git/bin/clang++' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for atheris
Failed to build atheris
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (atheris)

Adding #include <cstdint> in the src/native/counters.h can solve this problem.

Since I use a self-built llvm compiler and install it into a specified location under and the environment is a docker container, this might be a system question, not atheris itself. Feel free to close this issue if it's inappropriate for asking.

  • Python version: 3.10.15
  • Clang version: 20.0.0git (https://github.com/llvm/llvm-project.git 0aec4d2b78a08f5f3e4b0ad0340a99e486d00110)
  • System information: Linux autodl-container-1bda119e52-55952cb3 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
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