qiling
qiling copied to clipboard
golang time.Sleep error
*Describe the bug A clear and concise description of what the bug is. golang time.Sleep error Sample Code
fmt.Println("xxx")
time.Sleep(time.Second * 5)
fmt.Println("uuuuu")
print(qiling.__version__)
ql = Qiling(
["rootfs/x8664_linux/bin/sleep_hello"],
"rootfs/x8664_linux",
archtype = 'x8664',
ostype='linux',
verbose=QL_VERBOSE.DEFAULT,
multithread=True,
profile='netgear.ql',
console=True
)
ql.run()
Expected behavior A clear and concise description of what you expected to happen. sleep(5000)
Screenshots
If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.
I am not sure what is the problem.. can you elaborate? Also, the attached log is very unclear. Can you please run it in an ordinary console and copy here the log as text?
@elicn Seems like golang's sleep is not working
bin: xm.zip
@elicn After testing, golang, time.sleep, golang http, package time processing, and coroutine processing programs do not work
If you'll look closely you'll notice that the emulated program bumps into a runtime error and emits a stack trace just after printing "xxx":
runtime stack:
runtime.throw({0x49b048?, 0x123?})
C:/Users/qt970/sdk/go1.19.3/src/runtime/panic.go:1047 +0x5d fp=0x80000000dc58 sp=0x80000000dc28 pc=0x43177d
runtime.netpollinit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/netpoll_epoll.go:45 +0x1c5 fp=0x80000000dcb0 sp=0x80000000dc58 pc=0x42d8a5
runtime.netpollGenericInit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/netpoll.go:196 +0x3a fp=0x80000000dcc8 sp=0x80000000dcb0 pc=0x42d29a
runtime.doaddtimer(0xc000018000, 0xc00004e050)
C:/Users/qt970/sdk/go1.19.3/src/runtime/time.go:293 +0x30 fp=0x80000000dd20 sp=0x80000000dcc8 pc=0x44d7b0
runtime.modtimer(0xc00004e050, 0x172e2c66d6a1f20e, 0x0, 0x4a0bb0, {0x486c80?, 0xc0000061a0}, 0x0)
C:/Users/qt970/sdk/go1.19.3/src/runtime/time.go:507 +0x33f fp=0x80000000dd68 sp=0x80000000dd20 pc=0x44e29f
runtime.resettimer(...)
C:/Users/qt970/sdk/go1.19.3/src/runtime/time.go:554
runtime.resetForSleep(0xc0000061a0?, 0x400000002?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/time.go:204 +0x37 fp=0x80000000ddb0 sp=0x80000000dd68 pc=0x44d6b7
runtime.park_m(0xc0000061a0?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:3352 +0xa7 fp=0x80000000dde0 sp=0x80000000ddb0 pc=0x43ab07
runtime.mcall()
C:/Users/qt970/sdk/go1.19.3/src/runtime/asm_amd64.s:448 +0x43 fp=0x80000000ddf0 sp=0x80000000dde0 pc=0x45af43
goroutine 1 [sleep]:
runtime.gopark(0x172e2c65ac9c000e?, 0xc000044000?, 0x4?, 0x0?, 0xc00006a270?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:363 +0xd6 fp=0xc00005eed8 sp=0xc00005eeb8 pc=0x434396
time.Sleep(0x12a05f200)
C:/Users/qt970/sdk/go1.19.3/src/runtime/time.go:195 +0x135 fp=0xc00005ef18 sp=0xc00005eed8 pc=0x45a0d5
main.runServer()
C:/Users/qt970/src/xiangshu0829/srv.go:10 +0x65 fp=0xc00005ef70 sp=0xc00005ef18 pc=0x481205
main.main()
C:/Users/qt970/src/xiangshu0829/main.go:4 +0x17 fp=0xc00005ef80 sp=0xc00005ef70 pc=0x481177
runtime.main()
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:250 +0x212 fp=0xc00005efe0 sp=0xc00005ef80 pc=0x433fd2
runtime.goexit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00005efe8 sp=0xc00005efe0 pc=0x45d041
goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:363 +0xd6 fp=0xc00002afb0 sp=0xc00002af90 pc=0x434396
runtime.goparkunlock(...)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:369
runtime.forcegchelper()
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:302 +0xad fp=0xc00002afe0 sp=0xc00002afb0 pc=0x43422d
runtime.goexit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00002afe8 sp=0xc00002afe0 pc=0x45d041
created by runtime.init.6
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:290 +0x25
goroutine 3 [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:363 +0xd6 fp=0xc00002b790 sp=0xc00002b770 pc=0x434396
runtime.goparkunlock(...)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:369
runtime.bgsweep(0x0?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgcsweep.go:278 +0x8e fp=0xc00002b7c8 sp=0xc00002b790 pc=0x4214ce
runtime.gcenable.func1()
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgc.go:178 +0x26 fp=0xc00002b7e0 sp=0xc00002b7c8 pc=0x416386
runtime.goexit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00002b7e8 sp=0xc00002b7e0 pc=0x45d041
created by runtime.gcenable
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgc.go:178 +0x6b
goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc000040000?, 0x4b7a30?, 0x1?, 0x0?, 0x0?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:363 +0xd6 fp=0xc00002bf70 sp=0xc00002bf50 pc=0x434396
runtime.goparkunlock(...)
C:/Users/qt970/sdk/go1.19.3/src/runtime/proc.go:369
runtime.(*scavengerState).park(0x52a6c0)
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgcscavenge.go:389 +0x53 fp=0xc00002bfa0 sp=0xc00002bf70 pc=0x41f573
runtime.bgscavenge(0x0?)
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgcscavenge.go:617 +0x45 fp=0xc00002bfc8 sp=0xc00002bfa0 pc=0x41fb45
runtime.gcenable.func2()
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgc.go:179 +0x26 fp=0xc00002bfe0 sp=0xc00002bfc8 pc=0x416326
runtime.goexit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00002bfe8 sp=0xc00002bfe0 pc=0x45d041
created by runtime.gcenable
C:/Users/qt970/sdk/go1.19.3/src/runtime/mgc.go:179 +0xaa
goroutine 5 [runnable]:
runtime.runfinq()
C:/Users/qt970/sdk/go1.19.3/src/runtime/mfinal.go:162 fp=0xc00002a7e0 sp=0xc00002a7d8 pc=0x415380
runtime.goexit()
C:/Users/qt970/sdk/go1.19.3/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00002a7e8 sp=0xc00002a7e0 pc=0x45d041
created by runtime.createfing
C:/Users/qt970/sdk/go1.19.3/src/runtime/mfinal.go:157 +0x45
I don't think this has somethign to do with Qiling, rather with some dependency that wasn't met.
@elicn He is a basic static program, how should I satisfy his dependencies
netpollinit??
I noticed that some system call failed because they are not implemented by Qiling. Perhaps that is the problem, and it is propagated later on. I'll open a feature-request to implement them.
thanks