schollz / find3-cli-scanner

The command-line scanner that supports Bluetooth and WiFi
https://www.internalpositioning.com/doc/tracking_your_computer.md
149 stars 55 forks source link

Segmentation Fault on Raspberry pi #30

Open alexdetrano opened 5 years ago

alexdetrano commented 5 years ago

I am trying to run the scanner on a raspberry pi 3b+ and also a pi0w; in both instances I get a seg fault. I changed the name, family, and server below for privacy reasons.

pi@raspberrypi:~ $ sudo find3-cli-scanner -i wlan0 -d <name> -f <family> -server <server> -scantime 10 -bluetooth
2019-01-15 20:12:36 [INFO] main.go func1:212 scanning bluetooth
2019-01-15 20:12:36 [INFO] main.go func1:218 scanning for 10 seconds
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1c pc=0x397248]

goroutine 1 [running]:
main.postData(0x543797d8, 0x168, 0x7efa4859, 0x6, 0x7efa484d, 0x8, 0x0, 0x0, 0x1cfc100, 0x0, ...)
    /home/pi/go/src/github.com/schollz/find3-cli-scanner/server-main.go:59 +0x220
main.basicCapture(0x4701d9, 0x17)
    /home/pi/go/src/github.com/schollz/find3-cli-scanner/main.go:369 +0x640
main.main.func1(0x1cae370, 0x1cae370, 0x1cc7b40)
    /home/pi/go/src/github.com/schollz/find3-cli-scanner/main.go:219 +0x5e0
github.com/urfave/cli.HandleAction(0x3e05f0, 0x488d1c, 0x1cae370, 0x1c8e600, 0x0)
    /home/pi/go/src/github.com/urfave/cli/app.go:501 +0xac
github.com/urfave/cli.(*App).Run(0x1c01500, 0x1c16060, 0xc, 0xc, 0x0, 0x0)
    /home/pi/go/src/github.com/urfave/cli/app.go:268 +0x400
main.main()
    /home/pi/go/src/github.com/schollz/find3-cli-scanner/main.go:232 +0x920

I should mention that I installed go manually

pi@raspberrypi:~ $ go version
go version go1.11.4 linux/arm

And also followed the instructions at https://www.internalpositioning.com/doc/cli-scanner.md for installing the tool.

I couldn't get docker to run properly on the pi either.

muelli commented 5 years ago

seems the error is not checked there: https://github.com/schollz/find3-cli-scanner/blob/a041b80913a0c23b9f3d6be483e3b7217a1503b9/server-main.go#L58-L59

Can you try whether it crashes when you check for the error like this, maybe?

https://github.com/schollz/find3-cli-scanner/blob/a041b80913a0c23b9f3d6be483e3b7217a1503b9/server-main.go#L55-L57

nash-stokes commented 4 years ago

I am having this issue as well. Mine collects the packets, but when it starts the second scan, it segfaults in the same way. The same device is able to passive scan fine if I set the server to the default cloud.internalpositioning, so I'm wondering if the docker image for find3 server is missing something.

nash-stokes commented 4 years ago

After the most recent commit, mine is working @alexdetrano