karelklic / canal

Abstract interpreter for real-world application programs
https://github.com/karelklic/canal/wiki
Other
32 stars 3 forks source link

Structure.cpp:248(getItem) assert failed: !result.empty() #138

Open xbrukner opened 11 years ago

xbrukner commented 11 years ago
/home/tomas/projekty/canal/lib/Structure.cpp:248(getItem) assert failed: !result.empty()
[bt]: (1) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Structure::getItem(Canal::Domain const&) const+0x215 [0x401109c1]
[bt]: (2) /home/tomas/projekty/canal/lib/libcanal.so : +0xdc0a0 [0x401010a0]
[bt]: (3) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Pointer::Pointer::store(Canal::Domain const&, Canal::State&) const+0x190 [0x4010206e]
[bt]: (4) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Operations::store(llvm::StoreInst const&, Canal::State&)+0xd7 [0x400fa64b]
[bt]: (5) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Operations::interpretInstruction(llvm::Instruction const&, Canal::State&)+0x330 [0x400f745a]
[bt]: (6) /home/tomas/projekty/canal/lib/libcanal.so : Canal::Interpreter::Iterator::interpretInstruction()+0x3f [0x400f2fa5]
[bt]: (7) /home/tomas/projekty/canal/tool/canal : State::run()+0x2e [0x80cb1de]
[bt]: (8) /home/tomas/projekty/canal/tool/canal : CommandRun::run(std::vector<std::string, std::allocator<std::string> > const&)+0x7b [0x80c5527]
[bt]: (9) /home/tomas/projekty/canal/tool/canal : Commands::executeLine(std::string const&)+0x1c2 [0x80c62f0]
[bt]: (10) /home/tomas/projekty/canal/tool/canal : main+0x139 [0x80b487d]
[bt]: (11) /lib/i386-linux-gnu/libc.so.6 : __libc_start_main+0xf3 [0x404324d3]
[bt]: (12) /home/tomas/projekty/canal/tool/canal() [0x80b43b5]

Files: http://www.fi.muni.cz/~xbrukner/integration/extent-scan.c, http://www.fi.muni.cz/~xbrukner/integration/extent-scan.s

xbrukner commented 11 years ago
%struct.fiemap = type { i64, i64, i32, i32, i32, i32, [0 x %struct.fiemap_extent] }
%fiemap = alloca %struct.fiemap*, align 4
%19 = load %struct.fiemap** %fiemap, align 4
%20 = getelementptr inbounds %struct.fiemap* %19, i32 0, i32 4
store i32 72, i32* %20, align 4

Struct in %20 contains only two elements.

xbrukner commented 11 years ago

New backtrace:

/var/research/canal/canal/lib/Structure.cpp:227(extractelement) assert failed: !set.isTop() && set.mValues.size() == 1
[bt]: (1) /var/research/canal/canal-build-28/lib/libcanal.so : Canal::Structure::extractelement(Canal::Domain const&) const+0x77 [0x2b301ae2b01f]
[bt]: (2) /var/research/canal/canal-build-28/lib/libcanal.so : Canal::Structure::load(llvm::Type const&, std::vector<Canal::Domain*, std::allocator<Canal::Domain*> > const&) const+0xcf [0x2b301ae2c24b]
[bt]: (3) /var/research/canal/canal-build-28/lib/libcanal.so : Canal::Pointer::Pointer::dereferenceAndMerge(Canal::State const&) const+0x55f [0x2b301ae18579]
[bt]: (4) /var/research/canal/canal-build-28/lib/libcanal.so : Canal::Operations::load(llvm::LoadInst const&, Canal::State&)+0x60 [0x2b301ae1221e]
[bt]: (5) /var/research/canal/canal-build-28/lib/libcanal.so : Canal::Operations::interpretInstruction(llvm::Instruction const&, Canal::State&)+0x6db [0x2b301ae0f813]
[bt]: (6) /var/research/canal/canal-build-28/lib/libcanal.so : Canal::Interpreter::Iterator::interpretInstruction()+0x3e [0x2b301ae09bac]
[bt]: (7) /var/research/canal/canal-build-28/tool/canal : State::run()+0x36 [0x532fee]
[bt]: (8) /var/research/canal/canal-build-28/tool/canal : CommandRun::run(std::vector<std::string, std::allocator<std::string> > const&)+0x86 [0x52a87a]
[bt]: (9) /var/research/canal/canal-build-28/tool/canal : Commands::executeLine(std::string const&)+0x244 [0x52c4ec]
[bt]: (10) /var/research/canal/canal-build-28/tool/canal : main+0x264 [0x5150ce]
[bt]: (11) /lib/libc.so.6 : __libc_start_main+0xfd [0x2b301c1d2c8d]
[bt]: (12) /var/research/canal/canal-build-28/tool/canal() [0x514a39]