-
Notifications
You must be signed in to change notification settings - Fork 744
build fails with (signal: 11, SIGSEGV: invalid memory reference) #493
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
Comments
Are you on 32 bits? if the answer is yes please see this |
no, I am on 64bit macOS |
Sounds likely this is the same, because I haven't been able to repro on linux. If it isn't I'd need you to get a backtrace or something to try to figure out what is this :) |
Trying some things out right now. The original error seems to be related to me not using the correct clang version. But even after the switch things are not doing what they are supposed to do. |
Running on rust stable (1.14) with bindgen@0.21.2:
Running on rust stable (1.14) with bindgen@master:
|
Well, this is due to recent changes to support padding in struct layout, cc @flier. can you attach the log resulting from running with |
I'm not sure what I'm doing wrong, but there doesn't seem to be any additional output when running with rust_log
|
Huh, I guess you need to run the script itself ( |
This doesn't look particularly useful either
|
Gah, likely to need whatever env vars your build script uses, maybe I can't take a look right now, will do when I have the time. |
When passing all the env variables, it runs but still no log output:
will see if I can find the reason why |
That's still panicking when not finding an env var though. |
Wrong copy, paste
|
For the fn padding_bytes(&self, layout: Layout) -> usize {
if self.latest_offset % layout.align == 0 {
0
} else {
layout.align - (self.latest_offset % layout.align)
}
} I will submit a patch to avoid it soon. On the other hand, when I try to reproduce it, I got a lot of error like --- stderr
ERROR:bindgen::ir::item: Unhandled cursor kind CXCursorKind(30): Cursor(__test kind: FunctionTemplate, loc: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:451:28, usr: Some("c:@N@std@N@__1@N@__libcpp_is_function_imp@FT@>1#T__test#*t0.0#C#"))
ERROR:bindgen::ir::item: Unhandled cursor kind CXCursorKind(30): Cursor(__test kind: FunctionTemplate, loc: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:452:27, usr: Some("c:@N@std@N@__1@N@__libcpp_is_function_imp@FT@>1#T__test#$@N@std@N@__1@N@__libcpp_is_function_imp@S@__dummy_type#C#"))
ERROR:bindgen::ir::item: Unhandled cursor kind CXCursorKind(30): Cursor(__test kind: FunctionTemplate, loc: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:453:28, usr: Some("c:@N@std@N@__1@N@__libcpp_is_function_imp@FT@>1#T__test.#$@N@std@N@__1@S@__two#")) I'm not sure whether it is cause the wrong layout |
@flier I can reproduce this, but only when using bindgen@0.21.2 with rust-nightly log: https://gist.github.com/dignifiedquire/cb97915e83c52361c7b5de6e9e7cc5d7 |
The solution here is just avoiding the division by zero, should be a one line patch. |
check empty layout when padding bytes fast workaround to fix issue #493 need to investigate why layout is empty
@dignifiedquire which rust-nightly version you are using? $ rustup run nightly rustc --version
rustc 1.17.0-nightly (c49d10207 2017-02-07) |
|
@flier you pr doesn't appear fix it #494 (comment) |
@emilio seems an invalid enum decl cause the empty layout.
|
check layout align before padding bytes Fix issue #493 again :S Still finding way to reproduce it
This should be fixed now. |
I'v been trying to generate headers for this project: https://github.com/chadnickbok/librtcdcpp but after multiple attempts been stopped by this error:
You can find the code I am using in https://github.com/dignifiedquire/librtcd.rs
Any idea what could be causing this? (Sorry if I am missing something obvious my C++ knowledge is pretty limited)
The text was updated successfully, but these errors were encountered: