Compiling on the Windows 2012 VM

Hi, I've been trying to compile and run the packetbeat source on the win2012 vm that is on the repository but I can't seem to get it right. It compiles ok with the go build command but when I try to run packetbeat.exe -devices I get the following exception.

PS C:\dev\LogStack\beats\packetbeat> .\packetbeat.exe -devices Exception 0xc0000005 0x0 0x2781566 0x10f7c98 PC=0x10f7c98 signal arrived during external code execution github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap._Cfunc_pcap_findalldevs(0xc082028038,0x19b7160, 0x0) ??:0 +0x3c github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap.FindAllDevs(0x0, 0x0, 0x0, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap.go:518 +0xf1 github.com/elastic/beats/packetbeat/sniffer.ListDeviceNames(0xc083233201, 0x0, 0x0, 0x0, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/packetbeat/sniffer/sniffer.go:79 +0x7c github.com/elastic/beats/packetbeat/beater.init.1.func1(0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/packetbeat/beater/devices.go:21 +0x6c github.com/elastic/beats/libbeat/beat.FlagsHandlerCallback.HandleFlags(0xc082f0fc30, 0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/flags.go:35 +0x39 github.com/elastic/beats/libbeat/beat.handleFlags(0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/flags.go:26 +0xb5 github.com/elastic/beats/libbeat/beat.(*Beat).handleFlags(0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/beat.go:230 +0x4ca github.com/elastic/beats/libbeat/beat.(*Beat).launch(0xc08247c780, 0xe2fef8, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/beat.go:150 +0x4c github.com/elastic/beats/libbeat/beat.Run(0xce4ca0, 0xa, 0x0, 0x0, 0xe2fef8, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/beat.go:133 +0x6e main.main() C:/Gopath/src/github.com/elastic/beats/packetbeat/main.go:26 +0x4e

I'm compiling and running inside the VM.

Which golang version did you use?

I'm using the one in the VM, I think is 1.5.3.

I think there is an issue with the winpcap developer pack. IIRC, it only contains a 32-bit lib. We had to perform some workarounds to build it for 64-bit. So if you set GOARCH=386 before running go build it might work. This will build a 32-bit binary.

Hi,
Thanks for the fast reply.

Will try later today and post back the results.

It is working now, following the work around.

Thanks

This topic was automatically closed after 21 days. New replies are no longer allowed.