Running chameleon error
Opened this issue · 2 comments
xjtuwxg commented
Follow the install instruction, and compile the application with the following Makefile:
PREFIX = /home/xgwang/extdisk/chameleon/install/
CC = $(PREFIX)/x86_64/bin/musl-clang
CFLAGS = -static -popcorn-metadata -popcorn-target=x86_64-linux-gnu -secure-popcorn \
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-red-zone
STACK = $(PREFIX)/bin/gen-stackinfo
CHAMELEON = /home/xgwang/extdisk/chameleon/popcorn-chameleon/build/bin/chameleon
SRC = main.c
BIN = main
all: compile stack
compile:
@echo "Compile:"
$(CC) $(CFLAGS) $(SRC) -o $(BIN)
stack:
@echo "Gen stackinfo:"
$(STACK) -f $(BIN)
run:
$(CHAMELEON) -d -- $(BIN)
Got a running error as follows:
It seems there is a segmentation fault happens when doing compel_stop_on_syscall
[ src/transform.cpp:1469 ] DEBUG: 4001c8 size = 1 ret %rsp (%rsp)[8byte] -> %rsp
[ src/transform.cpp:1132 ] DEBUG: -> detected offset 8
[ src/transform.cpp:1573 ] DEBUG: rewrote 3 instruction(s)
[ src/transform.cpp:1601 ] DEBUG: randomizing function took 1818 us
[ src/transform.cpp:177 ] DEBUG: code randomization time: 3837 us
[ src/process.cpp:583 ] DEBUG: 2236: stealing userfault from child
[ compel ] DEBUG: LC3: Set up parasite blob using memfd
[ compel ] DEBUG: LC3: Putting parasite blob into 0x7f457cf08000->0x7fa5c20b0000
[ compel ] DEBUG: LC3: Dumping general registers for 2236 in native mode
[ compel ] DEBUG: LC4: cpu: x86_family 21 x86_vendor_id AuthenticAMD x86_model_id AMD Opteron 63xx class CPU
[ compel ] DEBUG: LC4: cpu: fpu: xfeatures_mask 0x5 xsave_size 832 xsave_size_max 832 xsaves_size 0
[ compel ] DEBUG: LC4: cpu: fpu: x87 floating point registers xstate_offsets 0 / 0 xstate_sizes 160 / 160
[ compel ] DEBUG: LC4: cpu: fpu: AVX registers xstate_offsets 576 / 576 xstate_sizes 256 / 256
[ compel ] DEBUG: LC3: Dumping GP/FPU registers for 2236
[ compel ] DEBUG: LC3: Putting tsock into pid 2236
[ compel ] DEBUG: LC3: Wait for parasite being daemonized...
[ compel ] DEBUG: LC4: Wait for ack 2 on daemon socket
pie: 2236: Running daemon thread leader
pie: 2236: __sent ack msg: 2 2 0
pie: 2236: Daemon waits for command
[ compel ] DEBUG: LC4: Fetched ack: 2 2 0
[ compel ] DEBUG: LC3: Parasite 2236 has been switched to daemon mode
[ compel ] DEBUG: LC4: Sent msg to daemon 64 0 0
pie: 2236: __fetched msg: 64 0 0
DEBUG: parasite: initialized uffd 7
DEBUG: parasite: sent uffd to chameleon
pie: 2236: __sent ack msg: 64 64 0
pie: 2236: Daemon waits for command
[ compel ] DEBUG: LC4: Wait for ack 64 on daemon socket
[ compel ] DEBUG: LC4: Fetched ack: 64 64 0
[ compel ] DEBUG: LC4: Waiting for 2236 to trap
[ compel ] DEBUG: LC4: Daemon 2236 exited trapping
[ compel ] DEBUG: LC4: Sent msg to daemon 3 0 0
pie: 2236: __fetched msg: 3 0 0
pie: 2236: 2236: new_sp=0x7fa5c20b4004 ip 0x0
[ compel ] DEBUG: LC4: 2236 was trapped
[ compel ] DEBUG: LC4: `- Expecting exit
[ compel ] DEBUG: LC1: Error (compel/src/lib/infect.c:1448): Task 2236 is in unexpected state: b7f
[ compel ] DEBUG: LC1: Error (compel/src/lib/infect.c:1456): Task stopped with 11: Segmentation fault
[ chameleon ] ERROR: could not set up state transformer: compel cure failed