Opened 2 years ago

Closed 20 months ago

#128 closed defect (worksforme)

Invalid memory access in llvm interpreter (LoadValueFromMemory)

Reported by: xbarnat Owned by: xrockai
Priority: normal Milestone: 3.0
Component: LLVM Version: 2.5
Severity: Keywords:
Cc:

Description (last modified by xrockai)

Based on fifo.cpp in examples/llvm I made a new version with POSIX threads. See attached files.
Running 64bit version of DiVinE on it terminates with Segmentation Fault.
I am attaching valgrind output.
Could you confirm the error on 32bit architecture?

$ clang -pthread fifo1.cpp 
$ ./a.out 
$ clang -DDIVINE -c -emit-llvm -O2 fifo1.cpp -o fifo1.bc
$ divine metrics -w 1 fifo1.bc
  exploring... 			 Segmentation fault
$ valgrind divine metrics -w 1 fifo1.bc
...
==9441== Invalid read of size 8
==9441==    at 0x7E5DE0: llvm::ExecutionEngine::LoadValueFromMemory(llvm::GenericValue&, llvm::GenericValue*, llvm::Type*) (in /home/divine/divine-2.x/_build/tools/divine)
==9441==    by 0x728E80: divine::llvm::Interpreter::visitLoadInst(llvm::LoadInst&) (execution.cpp:785)
==9441==    by 0x72FD09: divine::llvm::Interpreter::step(int, int) (Instruction.def:134)
==9441==    by 0x619331: divine::generator::LLVM::Successors::head() (llvm.h:150)
==9441==    by 0x672B73: divine::visitor::Common<divine::Queue, divine::visitor::Partitioned<divine::algorithm::Metrics<divine::algorithm::NonPORGraph<divine::generator::LLVM>, divine::Statistics>::VisitorSetup, divine::algorithm::Metrics<divine::algorithm::NonPORGraph<divine::generator::LLVM>, divine::Statistics>, divine::algorithm::Hasher>::Ours>::processQueue() (datastruct.h:71)
==9441==    by 0x6896B8: divine::visitor::Partitioned<divine::algorithm::Metrics<divine::algorithm::NonPORGraph<divine::generator::LLVM>, divine::Statistics>::VisitorSetup, divine::algorithm::Metrics<divine::algorithm::NonPORGraph<divine::generator::LLVM>, divine::Statistics>, divine::algorithm::Hasher>::exploreFrom(divine::Blob) (visitor.h:112)
==9441==    by 0x6897AE: divine::algorithm::Metrics<divine::algorithm::NonPORGraph<divine::generator::LLVM>, divine::Statistics>::_visit() (metrics.h:173)
==9441==    by 0x5F33F7: divine::RunThread<divine::algorithm::Metrics<divine::algorithm::NonPORGraph<divine::generator::LLVM>, divine::Statistics> >::main() (parallel.h:28)
==9441==    by 0x76A234: startMeUp (userealtls.cpp:238)
==9441==    by 0x4A28B4F: start_thread (pthread_create.c:304)
==9441==    by 0x5F1890C: clone (clone.S:112)
==9441==  Address 0xfffffffffffffc68 is not stack'd, malloc'd or (recently) free'd
...

Attachments (1)

fifo1.tgz (7.1 KB) - added by xbarnat 2 years ago.

Download all attachments as: .zip

Change History (3)

Changed 2 years ago by xbarnat

comment:1 Changed 2 years ago by xrockai

  • Component changed from examples to LLVM
  • Status changed from new to assigned

comment:2 Changed 20 months ago by xrockai

  • Description modified (diff)
  • Resolution set to worksforme
  • Status changed from assigned to closed

No longer relevant. This interpreter has been removed, including the bug.

Note: See TracTickets for help on using tickets.