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

crash: "Ptr must be a pointer to Val type!" #1153

Closed
elly opened this issue Nov 8, 2011 · 2 comments
Closed

crash: "Ptr must be a pointer to Val type!" #1153

elly opened this issue Nov 8, 2011 · 2 comments

Comments

@elly
Copy link
Contributor

elly commented Nov 8, 2011

The following program crashes rustc with an assert failure inside llvm: http://www.leptoquark.net/~elly/rustdoc-valtype.rs.
#0 0xf7fdd430 in __kernel_vsyscall ()

No symbol table info available.
#1 0xf6d17c4f in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64

    resultvar = <optimized out>
    resultvar = <optimized out>
    pid = -152698892
    selftid = 8676

#2 0xf6d1b175 in __GI_abort () at abort.c:92

    save_stage = 2
    act = {__sigaction_handler = {sa_handler = 0xfd, sa_sigaction = 0xfd}, sa_mask = {__val = {
          4141206064, 304, 264, 252, 253, 137759776, 264, 304, 4142268404, 252, 253, 252, 
          4141140652, 137759784, 253, 4133106040, 137759608, 0, 4142007555, 4222451712, 137759784, 
          137759885, 137759784, 137759784, 137760036, 137760084, 137759784, 137760084, 0, 0, 0, 
          0}}, sa_flags = 0, sa_restorer = 0x43}
    sigs = {__val = {32, 0 <repeats 31 times>}}

#3 0xf6d10716 in __GI___assert_fail (

assertion=0xf7df3990 "getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && \"Ptr must be a pointer to Val type!\"", 
file=0xf7df2d3c "/home/elly/s/rust/src/llvm/lib/VMCore/Instructions.cpp", line=1065, 
function=0xf7df7e60 "void llvm::StoreInst::AssertOK()") at assert.c:81
    buf = 0x8360c28 "rustc: /home/elly/s/rust/src/llvm/lib/VMCore/Instructions.cpp:1065: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType"...

#4 0xf7adcd8a in llvm::StoreInst::AssertOK() () from /home/elly/a/rust/bin/../lib/librustllvm.so

No symbol table info available.
#5 0xf7ae100e in llvm::StoreInst::StoreInst(llvm::Value_, llvm::Value_, bool, llvm::Instruction*) ()

from /home/elly/a/rust/bin/../lib/librustllvm.so
No symbol table info available.
#6 0xf7a74a8f in LLVMBuildStore () from /home/elly/a/rust/bin/../lib/librustllvm.so

No symbol table info available.
#7 0xf6ec7249 in upcall_call_c_stack_i64 () at ./src/rt/arch/i386/ccall.S:26

No locals.
#8 0x080973d2 in middle::trans::do_spill::_7648ce608975ee90 ()

No symbol table info available.
#9 0x08076c14 in middle::trans::call_cmp_glue::_ba598d1087e2229c ()

No symbol table info available.
#10 0x0807caa6 in middle::trans::trans_compare::_5e77a429fae88bd5 ()

No symbol table info available.
#11 0x080bc945 in middle::trans_alt::compile_submatch::_4a5f506139fee9e3 ()

No symbol table info available.
#12 0x080bc41b in middle::trans_alt::compile_submatch::_4a5f506139fee9e3 ()

No symbol table info available.
#13 0x080b9e9f in middle::trans_alt::compile_submatch::_4a5f506139fee9e3 ()

No symbol table info available.
#14 0x080bf283 in middle::trans_alt::compile_submatch::_4a5f506139fee9e3 ()

No symbol table info available.
#15 0x080c0f76 in middle::trans_alt::trans_alt::_7b5041dd434dd5f5 ()

No symbol table info available.
#16 0x0809540a in middle::trans::trans_expr::_f9969b77af77ceb8 ()

No symbol table info available.
#17 0x0809b9cc in middle::trans::trans_stmt::_78d6f7d99a7a21dc ()

No symbol table info available.
#18 0x0809d748 in middle::trans::trans_block_dps::_6b45456deb3d2743 ()

No symbol table info available.
#19 0x08080456 in middle::trans::trans_for::inner::_b024d7de3ce31cb6 ()

No symbol table info available.
#20 0x08255fcb in middle::trans::trans_for::thunk1130 ()

No symbol table info available.
#21 0x080d6b81 in middle::trans_vec::iter_vec_raw::_54b754b8ce805811 ()

No symbol table info available.
#22 0x08080b73 in middle::trans::trans_for::_829df1651833c8be ()

No symbol table info available.
#23 0x08095280 in middle::trans::trans_expr::_f9969b77af77ceb8 ()

No symbol table info available.
#24 0x0809b9cc in middle::trans::trans_stmt::_78d6f7d99a7a21dc ()

No symbol table info available.
#25 0x0809d748 in middle::trans::trans_block_dps::_6b45456deb3d2743 ()

No symbol table info available.
#26 0x080a03a1 in middle::trans::trans_closure::_157a4b8b7e149afc ()

No symbol table info available.
#27 0x080a06aa in middle::trans::trans_fn::_c13b574235a3f772 ()

No symbol table info available.
#28 0x080a393d in middle::trans::trans_item::_17b2e5b3f8c5fc17 ()

No symbol table info available.
#29 0x080b0648 in middle::trans::trans_crate::_e559e0d9dd4f0325 ()

No symbol table info available.
#30 0x082926b4 in driver::rustc::compile_input::thunk8830 ()

No symbol table info available.
#31 0x0822f2b9 in driver::rustc::time::_b49018b3a488d239 ()

No symbol table info available.
#32 0x082315cd in driver::rustc::compile_input::_d938b147968b6d74 ()

No symbol table info available.
#33 0x0823a81f in driver::rustc::main::_d03dcf38abeac4ba ()

No symbol table info available.
#34 0x0823aeff in _rust_main ()

No symbol table info available.
#35 0xf6eb2a04 in task_start_wrapper (a=0xf6ba7018) at ./src/rt/rust_task.cpp:175

    task = 0x832bc00
    rval = 42
    failed = false
    env = <optimized out>

#36 0xdeadbeef in ?? ()

No symbol table info available.
#37 0xf6ba7018 in ?? ()

No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@brson
Copy link
Contributor

brson commented Nov 14, 2011

The code:

use std;
use rustc;

import rustc::syntax::ast;
import rustc::syntax::codemap;
import rustc::syntax::parse::parser;
import rustc::syntax::visit;

fn doc_item(item: @ast::item) {
    log item.ident;
    for attr: ast::attribute in item.attrs {
        alt attr.node.value.node {
            ast::meta_name_value("doc", {node: ast::lit_str(value), span: _}) {
                log #fmt["  doc %s", value];
            }
        }
    }
}

fn main() {
    let sess = @{cm: codemap::new_codemap(), mutable next_id: 0};
    let p = parser::parse_crate_from_source_file("rustdoc.rs", [], sess);
    let v = visit::mk_simple_visitor(@{
        visit_item: doc_item
        with *visit::default_simple_visitor()});
    visit::visit_crate(*p, (), v);
}

@marijnh
Copy link
Contributor

marijnh commented Nov 22, 2011

Here's a properly reduced testcase:

fn main() {
    tag foo { bar(str, {node: int, span: int}); baz; }
    alt baz {
      bar("foo", {node: _, _}) {}
    }
}

celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Remove redundant check from README.md

In the example, we were calling is_valid after `kani::any()` which is
redundant since the type has to implement the Arbitrary type.

* Also adjust Kani help
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

3 participants