Edited to top-post blocking issues:
When running the following simulation, the simulation completes successfully in ptrace mode, but fails in preload mode.
(cd go-server && go build main.go)
rm -rf shadow.data && build/src/main/shadow --log-level info --interpose-method preload go-minimal.yaml
00:00:00.003525 [worker-1] 00:00:03.000000000 [INFO] [server:11.0.0.4] [process.c:497] [_process_start] starting process 'server.main.1000'
00:00:00.003603 [worker-1] 00:00:03.000000000 [INFO] [server:11.0.0.4] [thread_preload.c:199] [threadpreload_run] forking new thread with environment 'SHADOW_SPAWNED=TRUE SHADOW_LOG_START_TIME=837172211482 SHADOW_INTERPOSE_METHOD=PRELOAD <snip>'
00:00:00.003668 [worker-1] 00:00:03.000000000 [INFO] [server:11.0.0.4] [process.c:519] [_process_start] process 'server.main.1000' started
00:00:00.007286 [worker-1] 00:00:03.000000000 [WARN] [server:11.0.0.4] [syscall_handler.c:503] [syscallhandler_make_syscall] Detected unsupported syscall 204 called from thread 1000 in process server.main.1000 on host server
00:00:00.007287 [worker-1] 00:00:03.000000000 [ERROR] [server:11.0.0.4] [syscall_handler.c:507] [syscallhandler_make_syscall] Returning error 38 (ENOSYS) for unsupported syscall 204, which may result in unusual behavior
signal 6 received on thread with no signal stack
fatal error: non-Go code disabled sigaltstack
...
I'm not sure under what conditions they abort, but if it works in ptrace mode, we probably want it to also work in preload mode.
The following is a slightly modified version of #1540 (comment) (uses 3 clients rather than 1).
package main
import (
"net/http"
)
type SimpleHandler struct{}
func (h *SimpleHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
data := []byte("Hi, I'm a simple web server\n")
w.Write(data)
}
func main() {
handler := &SimpleHandler{}
http.ListenAndServe(":80", handler)
}
general:
stop_time: 10s
network:
graph:
type: 1_gbit_switch
hosts:
server:
processes:
- path: go-server/main
start_time: 3s
client:
# the simulation works with 1 client, but not 3
quantity: 3
processes:
- path: /bin/curl
args: -s server
start_time: 5s
Edited to top-post blocking issues:
When running the following simulation, the simulation completes successfully in ptrace mode, but fails in preload mode.
I'm not sure under what conditions they abort, but if it works in ptrace mode, we probably want it to also work in preload mode.
The following is a slightly modified version of #1540 (comment) (uses 3 clients rather than 1).