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

ICE: Hiding a symbol in an rlib using asm! causes issues #18953

Closed
bharrisau opened this issue Nov 14, 2014 · 4 comments
Closed

ICE: Hiding a symbol in an rlib using asm! causes issues #18953

bharrisau opened this issue Nov 14, 2014 · 4 comments
Labels
A-inline-assembly Area: inline asm!(..) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@bharrisau
Copy link
Contributor

This is obviously my fault, but reporting it anyway.

I am using the asm! macro to make weak symbols in an rlib. When using the rlib with extern crate and trying to over-ride the weak symbol with a strong one, an ICE is generated.

task 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 433', /build/rust-git/src/rust/src/librustc/lib.rs:1

stack backtrace:
   1:     0x2b650307fc20 - rt::backtrace::imp::write::hcc244d480521f5e9Pdt
   2:     0x2b6503082ca0 - <unknown>
   3:     0x2b650294ec80 - unwind::begin_unwind_inner::h5eadd82ce47d0284E9c
   4:     0x2b650294e900 - unwind::begin_unwind_fmt::h776d307dc6ed351966c
   5:     0x2b650294e8c0 - rust_begin_unwind
   6:     0x2b650298e350 - panicking::panic_fmt::hec098d294ebfb5fb68j
   7:     0x2b650298e1a0 - panicking::panic_bounds_check::h6f58fc03a7f8fc9dF7j
   8:     0x2b6501888bc0 - <unknown>
   9:     0x2b65061a01d0 - <unknown>
  10:     0x2b65063bfc70 - _ZNK4llvm9SourceMgr12PrintMessageERNS_11raw_ostreamENS_5SMLocENS0_8DiagKindERKNS_5TwineENS_8ArrayRefINS_7SMRangeEEENS8_INS_7SMFixItEEEb
  11:     0x2b65063bfea0 - _ZNK4llvm9SourceMgr12PrintMessageENS_5SMLocENS0_8DiagKindERKNS_5TwineENS_8ArrayRefINS_7SMRangeEEENS6_INS_7SMFixItEEEb
  12:     0x2b650619be80 - <unknown>
  13:     0x2b65061a2ed0 - <unknown>
  14:     0x2b65061a5480 - <unknown>
  15:     0x2b6505c07ee0 - _ZNK4llvm10AsmPrinter13EmitInlineAsmENS_9StringRefEPKNS_6MDNodeENS_9InlineAsm10AsmDialectE
  16:     0x2b6505c08620 - _ZNK4llvm10AsmPrinter13EmitInlineAsmEPKNS_12MachineInstrE
  17:     0x2b6505c03e90 - _ZN4llvm10AsmPrinter16EmitFunctionBodyEv
  18:     0x2b65058257a0 - <unknown>
  19:     0x2b650633ff40 - _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE
  20:     0x2b65063405a0 - _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE
  21:     0x2b65063405f0 - _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE
  22:     0x2b65055e9af0 - LLVMRustWriteOutputFile
  23:     0x2b6501882870 - back::write::write_output_file::hf52e1818d5684c7e4jc
  24:     0x2b6501889f00 - <unknown>
  25:     0x2b650187e100 - <unknown>
  26:     0x2b650188fa70 - <unknown>
  27:     0x2b650188a480 - back::write::run_passes::h36cd15358abc1d05hVc
  28:     0x2b6502097af0 - <unknown>
  29:     0x2b650187e100 - <unknown>
  30:     0x2b6502043310 - driver::driver::phase_5_run_llvm_passes::haab60ec0089417cdclC
  31:     0x2b650203a470 - driver::driver::compile_input::h02996843b5f2a565eRB
  32:     0x2b65020bd800 - <unknown>
  33:     0x2b65020bd6f0 - <unknown>
  34:     0x2b6501896bc0 - <unknown>
  35:     0x2b65018969b0 - <unknown>
  36:     0x2b65015a5a30 - <unknown>
  37:     0x2b650299be00 - <unknown>
  38:     0x2b650299bdf0 - rust_try
  39:     0x2b650294c600 - unwind::try::h333ab25385d8e012mYc
  40:     0x2b650294c490 - task::Task::run::h2157d702c714dd0du4b
  41:     0x2b65015a5770 - <unknown>
  42:     0x2b650294dca0 - <unknown>
  43:     0x2b65079de250 - start_thread
  44:     0x2b6502d2a3b9 - clone
  45:                0x0 - <unknown>

@huonw huonw added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-inline-assembly Area: inline asm!(..) labels Nov 14, 2014
@thomas-huet
Copy link

Could you show the code that produces this?

@bharrisau
Copy link
Contributor Author

Can't reproduce on native targets (this was part of Zinc, using thumbv6em target). Also only appears when using LTO.

I'll keep working on a small example.

@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

Stale; needs test case.

@steveklabnik
Copy link
Member

This issue has not had a test case for a long time, and so, I'm giving it a close. Let me know if you've developed a case that shows this, @bharrisau !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: inline asm!(..) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants