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

test_object_file::test_symbol_iterator triggers assert in llvm 10 #199

Open
nlewycky opened this issue Jul 8, 2020 · 2 comments
Open

test_object_file::test_symbol_iterator triggers assert in llvm 10 #199

nlewycky opened this issue Jul 8, 2020 · 2 comments
Labels
Milestone

Comments

@nlewycky
Copy link
Contributor

nlewycky commented Jul 8, 2020

Describe the Bug
LLVMGetSymbolSize gets the common symbol size, which requires that the symbol be a common symbol.

To Reproduce
Please provide a simple sample of code which reproduces the issue on your machine.

$ cargo test --features=llvm10-0 test_object_file::test_symbol_iterator
test test_object_file::test_symbol_iterator ... all-0b042a69785d4445: ../include/llvm/Object/ObjectFile.h:295: uint64_t llvm::object::ObjectFile::getCommonSymbolSize(llvm::object::DataRefImpl) const: Assertion `getSymbolFlags(Symb) & SymbolRef::SF_Common' failed.

Expected Behavior
I don't see any way with the C API to check whether the type of the symbol (in C++ this is getSymbolFlags(Symbol)). If that's right, we might just have to remove size from the API, or mark it unsafe with a comment that explains the situation.

LLVM Version (please complete the following information):

  • LLVM Version: 10
  • Inkwell Branch Used: master
@TheDan64 TheDan64 added the bug label Jul 8, 2020
@TheDan64 TheDan64 added this to the 0.1.0 milestone Jul 8, 2020
@TheDan64
Copy link
Owner

TheDan64 commented Jul 8, 2020

Agreed - I think marking it unsafe and adding documentation is better than removing it altogether.

@TheDan64
Copy link
Owner

TheDan64 commented Jul 8, 2020

Though it's a shame the C API lacks a symbol check

@TheDan64 TheDan64 modified the milestones: 0.1.0, 0.2.0 Mar 29, 2022
@TheDan64 TheDan64 modified the milestones: 0.5.0, 0.6.0 Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants