Skip to content

check empty layout when padding bytes #494

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

Merged
merged 1 commit into from
Feb 8, 2017
Merged

Conversation

flier
Copy link
Contributor

@flier flier commented Feb 8, 2017

fast workaround to fix issue #493

need to investigate why layout is empty

@emilio
Copy link
Contributor

emilio commented Feb 8, 2017

@bors-servo r+

  • Would be nice to have a test case for this though :/

@bors-servo
Copy link

📌 Commit df2ff4f has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit df2ff4f with merge 8264afa...

bors-servo pushed a commit that referenced this pull request Feb 8, 2017
check empty layout when padding bytes

fast workaround to fix issue #493

need to investigate why layout is empty
@flier
Copy link
Contributor Author

flier commented Feb 8, 2017

Would be nice to have a test case for this though :/

I need investigate it more deep to find out why it cause an empty layout, then I will add the test case

@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: emilio
Pushing 8264afa to master...

@bors-servo bors-servo merged commit df2ff4f into rust-lang:master Feb 8, 2017
@dignifiedquire
Copy link

I'm afraid nothing has changed with this PR:

   Compiling bindgen v0.21.2 (https://github.com/servo/rust-bindgen#8264afa8)
   Compiling librtcd v0.1.0 (file:///Users/dignifiedquire/opensource/webrtc/librtcd.rs)
error: failed to run custom build command for `librtcd v0.1.0 (file:///Users/dignifiedquire/opensource/webrtc/librtcd.rs)`
process didn't exit successfully: `/Users/dignifiedquire/opensource/webrtc/librtcd.rs/target/debug/build/librtcd-7e187874fd9e785f/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/Users/dignifiedquire/opensource/webrtc/librtcd.rs/lib

--- stderr
thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', /Users/dignifiedquire/opensource/webrtc/librtcd.rs/target/debug/build/bindgen-b8176bee56170882/out/codegen.rs:818
note: Run with `RUST_BACKTRACE=1` for a backtrace.

➜  librtcd.rs (master) ✗ RUST_BACKTRACE=1 cargo +stable test
   Compiling librtcd v0.1.0 (file:///Users/dignifiedquire/opensource/webrtc/librtcd.rs)
error: failed to run custom build command for `librtcd v0.1.0 (file:///Users/dignifiedquire/opensource/webrtc/librtcd.rs)`
process didn't exit successfully: `/Users/dignifiedquire/opensource/webrtc/librtcd.rs/target/debug/build/librtcd-7e187874fd9e785f/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/Users/dignifiedquire/opensource/webrtc/librtcd.rs/lib

--- stderr
thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', /Users/dignifiedquire/opensource/webrtc/librtcd.rs/target/debug/build/bindgen-b8176bee56170882/out/codegen.rs:818
stack backtrace:
   1:        0x105afa56a - std::sys::imp::backtrace::tracing::imp::write::hd3b65cdfe843284c
   2:        0x105afdaff - std::panicking::default_hook::{{closure}}::hf2b7428652613d83
   3:        0x105afd7a7 - std::panicking::default_hook::h5da8f27db5582938
   4:        0x105afdf66 - std::panicking::rust_panic_with_hook::hcef1e67c646c6802
   5:        0x105afde04 - std::panicking::begin_panic::hc2e8ca89533cd10d
   6:        0x105afdd22 - std::panicking::begin_panic_fmt::h60990696c3c3a88d
   7:        0x105afdc87 - rust_begin_unwind
   8:        0x105b26430 - core::panicking::panic_fmt::h10231c789bd0e97d
   9:        0x105b26334 - core::panicking::panic::h5e44af975c0a7e4d
  10:        0x10545b9f1 - bindgen::codegen::struct_layout::StructLayoutTracker::pad_field::{{closure}}::hbdc8a5b36f0e99ac
  11:        0x1052f1767 - <core::option::Option<T>>::and_then::h857eaa0236094bd5
  12:        0x10545aef1 - bindgen::codegen::struct_layout::StructLayoutTracker::pad_field::h6f3dd3edbda873d2
  13:        0x10547143e - <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen::h263ddf5ab0eaf7a9
  14:        0x105461d80 - <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen::h169fef65711902d7
  15:        0x10545f15a - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h2704ad81fda103e5
  16:        0x105478a1c - <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen::h263ddf5ab0eaf7a9
  17:        0x105461d80 - <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen::h169fef65711902d7
  18:        0x10545f15a - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h2704ad81fda103e5
  19:        0x10545f9ae - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::hbc43e26b5773c70c
  20:        0x10545f499 - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::h8fab0b2c35160b48
  21:        0x10545f01f - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h2704ad81fda103e5
  22:        0x10545f9ae - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::hbc43e26b5773c70c
  23:        0x10545fc52 - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::ha17314384f42790b
  24:        0x10545defd - bindgen::codegen::CodegenResult::inner::hac3e1bc6cecafa08
  25:        0x10545f4eb - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::h8fab0b2c35160b48
  26:        0x10545f01f - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h2704ad81fda103e5
  27:        0x10545f9ae - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::hbc43e26b5773c70c
  28:        0x10545fc52 - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::ha17314384f42790b
  29:        0x10545defd - bindgen::codegen::CodegenResult::inner::hac3e1bc6cecafa08
  30:        0x10545f4eb - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::h8fab0b2c35160b48
  31:        0x10545f01f - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h2704ad81fda103e5
  32:        0x1054939bd - bindgen::codegen::codegen::{{closure}}::h677644e149cfb83c
  33:        0x10542c6dc - bindgen::ir::context::BindgenContext::gen::h6b71ca06fda3d7c5
  34:        0x10549345b - bindgen::codegen::codegen::he381bbc640a74281
  35:        0x105451fb1 - bindgen::Bindings::generate::ha78b54881457e513
  36:        0x105450cd5 - bindgen::Builder::generate::h81920dbf0c2b0622
  37:        0x1052a8266 - build_script_build::main::h029a1f78fe6e13fd
  38:        0x105afedda - __rust_maybe_catch_panic
  39:        0x105afe306 - std::rt::lang_start::h87cb84a8b6cb187e
  40:        0x1052a8499 - main

@flier
Copy link
Contributor Author

flier commented Feb 8, 2017

@dignifiedquire please try PR #495

@dignifiedquire
Copy link

@flier, better with the patch, no more division errors but now these fun errors https://gist.github.com/dignifiedquire/68f882ff94d63e195dbda124944d9d00

I have installed llvm, gtk+ (for the glib headers) and openssl via homebrew (which are the ones I am referecing in build.rs)

Details about how I built librtcdcpp can be found here: chadnickbok/librtcdcpp#2

@emilio
Copy link
Contributor

emilio commented Feb 8, 2017

Thanks for digging into it @flier! Sorry for not being so much on top of this, but I had classes + work to do today :/

@dignifiedquire: I believe those other issues are known(-ish) issues about how partial template specialization is handled (hint: Is hard due to how libclang gives us that info, and we can't handle it all on rust anyway).

The way to make that work is marking as opaque the types that get wrong layout/template params for now.

@dignifiedquire
Copy link

I believe those other issues are known(-ish) issues about how partial template specialization is handled

Great, I will try this out later today and report back.

Thank you both for the super fast help!

@emilio
Copy link
Contributor

emilio commented Feb 8, 2017

Don't thank me, thank @flier who did pretty much all the digging here!

@flier
Copy link
Contributor Author

flier commented Feb 8, 2017

you are welcome :)

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

Successfully merging this pull request may close these issues.

5 participants