dryark / ios_remote_provider

Other
45 stars 32 forks source link

Runtime error: invalid memory address or nil pointer dereference #84

Open ishan230590 opened 2 years ago

ishan230590 commented 2 years ago

![Uploading Screen Shot 2022-04-27 at 11.35.22 AM.png…]()

fortgpl commented 2 years ago

Facing the same issue.

dmin@admins-MacBook-Air ios_remote_provider % ./main run WARN Could not read specified calculated path. Calculated options will not function. defaults_path=calculated.json error="stat calculated.json: no such file or directory" type=err_read_calculated WARN Leftover go-ios - Sending SIGTERM args="[forward --udid 8101 8101]" pid=3799 proc=go-ios type=proc_cleanup WARN Leftover go-ios - Sending SIGTERM args="[forward --udid 8102 8102]" pid=3800 proc=go-ios type=proc_cleanup INFO Logged in to control floor type=cf_login_success INFO Connecting ControlFloor WebSocket link="ws://localhost:8090/provider/ws" type=cf_ws_connect INFO Notifying CF of device existence name="device existence" type=cf_notify udid="cadc" values="map[clickHeight:[896] clickWidth:[414] height:[896] udid:[7724b4c60b753c0d2406c27b83fef01d0028cadc] width:[414]]" INFO Device Present type=dev_present uuid="cadc" INFO Device Info ModelNumber=MN482 ProductType="iPhone9,2" ProductVersion=14.8.1 type=dev_info_basic uuid="cadc" INFO Notifying CF of device info name="device info" type=cf_notify udid="cadc" values="map Starting bin/go-ios with [forward --udid 8101 8101] Starting bin/go-ios with [forward --udid 8102 8102] INFO Process start - tunnel_8102->8102 binary=bin/go-ios proc="tunnel_8102->8102" type=proc_start INFO Process start - tunnel_8101->8101 binary=bin/go-ios proc="tunnel_8101->8101" type=proc_start tunnel start:{"level":"info","msg":"Start listening on port 8101 forwarding to port 8101 on device","time":"2022-05-26T18:46:29+05:30"} tunnel start:{"level":"info","msg":"Start listening on port 8102 forwarding to port 8102 on device","time":"2022-05-26T18:46:29+05:30"} Starting CFA via bin/go-ios with args runwda --bundleid INFO Process start - cfa binary=bin/go-ios proc=cfa type=proc_start WARN Process end - cfa proc=cfa type=proc_end INFO Process start - cfa binary=bin/go-ios proc=cfa type=proc_start INFO Notifying CF of CFA stop name="CFA stop" type=cf_notify udid="cadc" values="map[udid:[]]" WARN Process end - cfa proc=cfa type=proc_end INFO Notifying CF of CFA stop name="CFA stop" type=cf_notify udid="cadc" values="map[udid:[]]" INFO Process start - cfa binary=bin/go-ios proc=cfa type=proc_start WARN Process end - cfa proc=cfa type=proc_end INFO Notifying CF of CFA stop name="CFA stop" type=cf_notify udid="***cadc" values="map[udid:[]]" Got request to start video stream for Connecting to CF imgStream Connected CF imgStream panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x4320b13]

goroutine 10 [running]: main.(CFA).Screenshot(0xc0003b43c0) /Users/admin/Desktop/IOS-STF/ios_remote_provider/cfa.go:659 +0x73 main.(Device).startVidStream(0xc000382340) /Users/admin/Desktop/IOS-STF/ios_remote_provider/device.go:589 +0x4c main.(ControlFloor).startVidStream(...) /Users/admin/Desktop/IOS-STF/ios_remote_provider/controlfloor.go:164 main.(ControlFloor).openWebsocket.func15() /Users/admin/Desktop/IOS-STF/ios_remote_provider/controlfloor.go:424 +0x3c created by main.(*ControlFloor).openWebsocket /Users/admin/Desktop/IOS-STF/ios_remote_provider/controlfloor.go:424 +0x1945

fortgpl commented 2 years ago
Screenshot 2022-05-26 at 7 09 11 PM

Please find the screenshot. A Blank screen is coming in UI

linhvv12 commented 2 years ago

have you fix for this problem?.

hienhoang-aspire commented 1 year ago

hi @ishan230590 : I got the same issue : panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x4320b13]. Do you find the way to fix it?

hienhoang-aspire commented 1 year ago

hi @nanoscopic : I got the same issue when starting ios_remote_provider. Could you help to specify how could we deal with this situation? Log ios_remote_provider: hienhoang@ip-xxx-xxx-x-x ios_remote_provider % ./main run INFO Logged in to control floor type=cf_login_success WARN ControlFloor connection is self signed type=cf_ws_selfsign INFO Connecting ControlFloor WebSocket link="wss://localhost:8080/provider/ws" type=cf_ws_connect INFO Notifying CF of device existence name="device existence" type=cf_notify udid="001E" values="map[clickHeight:[844] clickWidth:[390] height:[844] udid:[00008101-00124C2A0191001E] width:[390]]" INFO Device Present type=dev_present uuid="001E" INFO Device Info ModelNumber=MGJ53 ProductType="iPhone13,2" ProductVersion=15.5 type=dev_info_basic uuid="001E" INFO Notifying CF of device info name="device info" type=cf_notify udid="001E" values="map[info:[{\"ProductVersion\":\"15.5\",\"UniqueDeviceID\":\"00008101-00124C2A0191001E\",\"InternationalMobileEquipmentIdentity\":\"356122167421736\",\"DeviceName\":\"iPhone của Dung\",\"EthernetAddress\":\"e8:a7:30:ae:85:03\",\"ModelNumber\":\"MGJ53\",\"HardwareModel\":\"D53gAP\",\"ProductType\":\"iPhone13,2\",\"ArtworkDeviceProductDescription\":\"iPhone 12\"\n}] udid:[00008101-00124C2A0191001E]]" Starting bin/go-ios with [forward --udid 00008101-00124C2A0191001E 8101 8101] Starting bin/go-ios with [forward --udid 00008101-00124C2A0191001E 8102 8102] INFO Process start - tunnel_8102->8102 binary=bin/go-ios proc="tunnel_8102->8102" type=proc_start INFO Process start - tunnel_8101->8101 binary=bin/go-ios proc="tunnel_8101->8101" type=proc_start tunnel start:{"level":"info","msg":"Start listening on port 8102 forwarding to port 8102 on device","time":"2022-08-17T15:53:50+07:00"} tunnel start:{"level":"info","msg":"Start listening on port 8101 forwarding to port 8101 on device","time":"2022-08-17T15:53:50+07:00"} Starting CFA via bin/go-ios with args runwda --bundleid com.aspireapp.sg.CFAgent.xctrunner --testrunnerbundleid com.aspireapp.sg.CFAgent.xctrunner --xctestconfig CFAgent.xctest --udid 00008101-00124C2A0191001E INFO Process start - cfa binary=bin/go-ios proc=cfa type=proc_start INFO [CFA] successfully started proc=cfa type=cfa_start uuid="001E" INFO [CFA] successfully started nngPort=8101 type=cfa_start udid="001E" INFO Notifying CF of CFA start name="CFA start" type=cf_notify udid="***001E" values="map[udid:[00008101-00124C2A0191001E]]" INFO Created CFA session type=cfa_session_created Starting bin/go-ios with [forward --udid 00008101-00124C2A0191001E 8103 8352] Starting bin/go-ios with [forward --udid 00008101-00124C2A0191001E 8105 8351] Starting bin/go-ios with [forward --udid 00008101-00124C2A0191001E 8104 8353] INFO Process start - tunnel_8104->8353 binary=bin/go-ios proc="tunnel_8104->8353" type=proc_start INFO Process start - tunnel_8105->8351 binary=bin/go-ios proc="tunnel_8105->8351" type=proc_start INFO Process start - tunnel_8103->8352 binary=bin/go-ios proc="tunnel_8103->8352" type=proc_start tunnel start:{"level":"info","msg":"Start listening on port 8105 forwarding to port 8351 on device","time":"2022-08-17T15:53:54+07:00"} tunnel start:{"level":"info","msg":"Start listening on port 8104 forwarding to port 8353 on device","time":"2022-08-17T15:53:54+07:00"} tunnel start:{"level":"info","msg":"Start listening on port 8103 forwarding to port 8352 on device","time":"2022-08-17T15:53:54+07:00"} Sending vid_enable cfa frame provider - enabling Sent vid_enable WDA Method: Process vis line:[application:6179] Setting process visibility to: Foreground

app:com.aspireapp.sg.CFAgent.xctrunner Got request to start video stream for 00008101-00124C2A0191001E self signed option Connecting to CF imgStream Connected CF imgStream Got request to start video stream for 00008101-00124C2A0191001E self signed option Connecting to CF imgStream Connected CF imgStream INFO Swiping:168 684 157 305 0.28
INFO Swiping:254 541 58 458 1.79
Opening control center INFO windowSize
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x58 pc=0x105051650]

goroutine 128 [running]: main.(CFA).WindowSize(0x14000408460) /Users/hienhoang/Documents/ios_remote_provider/cfa.go:572 +0xd0 main.(CFA).OpenControlCenter(0x14000408460) /Users/hienhoang/Documents/ios_remote_provider/cfa.go:726 +0x70 main.(Device).cc(...) /Users/hienhoang/Documents/ios_remote_provider/device.go:801 main.(ControlFloor).openWebsocket.func10() /Users/hienhoang/Documents/ios_remote_provider/controlfloor.go:374 +0x5c created by main.(*ControlFloor).openWebsocket /Users/hienhoang/Documents/ios_remote_provider/controlfloor.go:371 +0x1034

Log controlfloor: hienhoang@ip-xxx-xxx-x-x controlfloor % ./main run Registering user routes Registering provider routes Registering device routes [] 2022/08/17 15:25:59 http: TLS handshake error from 192.168.1.7:52284: remote error: tls: bad certificate uauth checking for ok user fail login ok; user=ok2 Provider login user=first pass=82b5e7a7238e47fc8a2194138b38eba0 provider login ok provider user=first got ws connection provider user=first devStatus request; variant=exists udid=00008101-00124C2A0191001E Notified that device 00008101-00124C2A0191001E exists Adding device: udid:00008101-00124C2A0191001E name:unknown clickWidth:390 clickHegiht:844 provider user=first devStatus request; variant=info udid=00008101-00124C2A0191001E Device info for 00008101-00124C2A0191001E: {"ProductVersion":"15.5","UniqueDeviceID":"00008101-00124C2A0191001E","InternationalMobileEquipmentIdentity":"356122167421736","DeviceName":"iPhone của Dung","EthernetAddress":"e8:a7:30:ae:85:03","ModelNumber":"MGJ53","HardwareModel":"D53gAP","ProductType":"iPhone13,2","ArtworkDeviceProductDescription":"iPhone 12" } provider user=first devStatus request; variant=cfaStarted udid=00008101-00124C2A0191001E CFA started for 00008101-00124C2A0191001E Reserving device 00008101-00124C2A0191001E for ok2 dev video stopped for udid: 00008101-00124C2A0191001E INFO[1709] Deleting device reservation rid=lBzgbaiCMR type=reserve_delete udid="001E" Reserving device 00008101-00124C2A0191001E for ok2 INFO[1737] Image stream connected rid=tcuAxhxKQF type=imgstream_start udid="001E" Response from browser: {"clientTime":"1660726482903","sentTime":"1660726482897"} Client time:1660726482903 Round trip:5 server to client raw: 6 client back to server raw: -1 Client Offset:4 Server Offset:-3 sending startStream to provider sending {id:0,type:"startStream",udid:"00008101-00124C2A0191001E"}

provider user=first connection to provider/imgStream udid=00008101-00124C2A0191001E sending {id:1334,type:"home",udid:"00008101-00124C2A0191001E"}

received {id:1334,text:"done"}

dev video stopped for udid: 00008101-00124C2A0191001E INFO[1767] Deleting device reservation rid=tcuAxhxKQF type=reserve_delete udid="001E" INFO[1771] Image stream connected rid=tcuAxhxKQF type=imgstream_start udid="001E" Response from browser: {"clientTime":"1660726517114","sentTime":"1660726517112"} Client time:1660726517114 Round trip:2 server to client raw: 2 client back to server raw: 0 Client Offset:1 Server Offset:-1 sending startStream to provider sending {id:0,type:"startStream",udid:"00008101-00124C2A0191001E"}

provider user=first connection to provider/imgStream udid=00008101-00124C2A0191001E Error creating outSocket writer: websocket: close sent Frame receive error: read tcp [::1]:8080->[::1]:59713: use of closed network connection sending {id:0,type:"stopStream",udid:"00008101-00124C2A0191001E"}

Frame receive error: websocket: close 1006 (abnormal closure): unexpected EOF Frame sender got CMKick. Aborting sending {id:22146,type:"home",udid:"00008101-00124C2A0191001E"}

sending {id:25131,type:"swipe",udid:"00008101-00124C2A0191001E",x1:168,y1:684,x2:157,y2:305,delay:28}

received {id:25131,text:"done"}

received {id:22146,text:"done"}

sending {id:31019,type:"swipe",udid:"00008101-00124C2A0191001E",x1:254,y1:541,x2:58,y2:458,delay:179}

sending {id:24938,type:"cc",udid:"00008101-00124C2A0191001E"}

received {id:31019,text:"done"}

sending {id:29898,type:"assistiveTouch",udid:"00008101-00124C2A0191001E"}

lost ws connection 2022/08/17 16:01:30 http2: panic serving 192.168.1.7:61390: runtime error: invalid memory address or nil pointer dereference goroutine 248 [running]: net/http.(http2serverConn).runHandler.func1() /opt/homebrew/Cellar/go/1.19/libexec/src/net/http/h2_bundle.go:5901 +0x120 panic({0x10517a6a0, 0x1067e3030}) /opt/homebrew/Cellar/go/1.19/libexec/src/runtime/panic.go:884 +0x204 main.(ProviderConnection).doLongPress(...) /Users/hienhoang/Documents/controlfloor/provider_connection.go:96 main.(DevHandler).handleDevLongPress(0x140005ac038?, 0x140003379a0?) /Users/hienhoang/Documents/controlfloor/device.go:440 +0xfc main.(DevHandler).registerDeviceRoutes.func6(0x14000460700?) /Users/hienhoang/Documents/controlfloor/device.go:59 +0x28 github.com/gin-gonic/gin.(Context).Next(...) /Users/hienhoang/go/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165 main.(UserHandler).NeedUserAuth.func1(0x14000460700) /Users/hienhoang/Documents/controlfloor/user.go:69 +0x190 github.com/gin-gonic/gin.(Context).Next(...) /Users/hienhoang/go/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165 main.(cfSessionManager).Sessions.func1(0x14000460700) /Users/hienhoang/Documents/controlfloor/session.go:53 +0x114 github.com/gin-gonic/gin.(Context).Next(...) /Users/hienhoang/go/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165 github.com/gin-gonic/gin.(Engine).handleHTTPRequest(0x14000003a00, 0x14000460700) /Users/hienhoang/go/pkg/mod/github.com/gin-gonic/gin@v1.7.0/gin.go:489 +0x548 github.com/gin-gonic/gin.(Engine).ServeHTTP(0x14000003a00, {0x105222cd8?, 0x140002e3bb0}, 0x1400060e500) /Users/hienhoang/go/pkg/mod/github.com/gin-gonic/gin@v1.7.0/gin.go:445 +0x1c8 net/http.serverHandler.ServeHTTP({0x140002d1db8?}, {0x105222cd8, 0x140002e3bb0}, 0x1400060e500) /opt/homebrew/Cellar/go/1.19/libexec/src/net/http/server.go:2947 +0x2c4 net/http.initALPNRequest.ServeHTTP({{0x1052236a0?, 0x140005ba2a0?}, 0x14000662380?, {0x140000b0000?}}, {0x105222cd8, 0x140002e3bb0}, 0x1400060e500) /opt/homebrew/Cellar/go/1.19/libexec/src/net/http/server.go:3556 +0x1f4 net/http.(http2serverConn).runHandler(0x0?, 0x10499f484?, 0x140001b2d80?, 0x0?) /opt/homebrew/Cellar/go/1.19/libexec/src/net/http/h2_bundle.go:5908 +0x70 created by net/http.(*http2serverConn).processHeaders /opt/homebrew/Cellar/go/1.19/libexec/src/net/http/h2_bundle.go:5638 +0x514

APOSHAml commented 1 month ago

Has anyone solved this problem?