Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: prematurely marking CGO pointers as unreachable? #23579

Closed
brknstrngz opened this issue Jan 27, 2018 · 15 comments

Comments

Projects
None yet
4 participants
@brknstrngz
Copy link

commented Jan 27, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.9.3

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

amd64, freebsd (clang 4.0) and darwin (clang-900.0.39.2)

What did you do?

While investigating a crash in the hyperscan Go wrapper it seemed that pointers passed to CGO were marked as unreachable and thus reaped by the GC just before the actual CGO call. We worked around this by explicitly marking them as reachable until after the CGO call.

What did you expect to see?

The CGO wrapper not requiring explicit runtime.KeepAlive() calls.

What did you see instead?

The CGO wrapper requiring explicit runtime.KeepAlive() calls.

If this works as intended, please ignore and close the ticket. Thanks.

@brknstrngz brknstrngz changed the title runtime: GC marking runtime: prematurely marking CGO pointers as unreachable? Jan 27, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2018

You're right: you should not need to add explicit runtime.KeepAlive calls. Can you show us how to replicate the problem ourselves?

@brknstrngz

This comment has been minimized.

Copy link
Author

commented Jan 28, 2018

I don't have a minimal program wrapping C directly that reproduces this, as I am calling into C through two CGO wrapping layers (one is 3rd party and fairly involved), but this program should do the trick. It needs to link against this commit, currently last on the flier/gohs master branch to exhibit the symptom. The commit in flier/gohs that works around the problem is here.

Hope this helps.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2018

Thanks. I compiled that program with tip. After running for a few minutes, I got this crash. Is this the expected failure mode?

panic: runtime error: index out of range

goroutine 150 [running]:
github.com/vgalu/hypermatcher.matchedIdxToPatterns(0xc420acfe00, 0xc420a32000, 0x2710, 0x2710, 0xc420ba0708, 0x4f0428, 0x4bc420)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:181 +0x17a
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200a2280, 0xc4211a9500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:98 +0x1c5
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200a2280, 0xc420b51800, 0x64, 0x80, 0xc421185c00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc4200ac0c0, 0x17)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487
@brknstrngz

This comment has been minimized.

Copy link
Author

commented Jan 28, 2018

Hm, no, that is new (and odd). I don't have tip at had at the moment, I'll get it tomorrow, test again and report back.

The original crash dump with 1.9.3 is here.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2018

Got a different crash:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xc438deee28 pc=0x7f2ab252faa4]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7f2ab252faa4
stack: frame={sp:0x7f2aad7d1ae0, fp:0x7f2aad7d1b30} stack=[0x7f2aacfd22b0,0x7f2aad7d1eb0)
00007f2aad7d19e0:  00007f2aad7d1a50  000000000042a50c <runtime.dopanic_m+540> 
00007f2aad7d19f0:  0000000000429fb1 <runtime.throw+129>  00007f2aad7d1ac0 
00007f2aad7d1a00:  0000000000000000  000000c420362180 
00007f2aad7d1a10:  010000000042aa68  0000000000000004 
00007f2aad7d1a20:  000000000000001f  00007f2ab252faa4 
00007f2aad7d1a30:  000000c438deee28  0000000000000001 
00007f2aad7d1a40:  00000000004ed420  000000c42034f980 
00007f2aad7d1a50:  00007f2aad7d1a78  000000000044fb4c <runtime.dopanic.func1+60> 
00007f2aad7d1a60:  000000c420362180  0000000000429fb1 <runtime.throw+129> 
00007f2aad7d1a70:  00007f2aad7d1ac0  00007f2aad7d1ab0 
00007f2aad7d1a80:  0000000000429eda <runtime.dopanic+74>  00007f2aad7d1a90 
00007f2aad7d1a90:  000000000044fb10 <runtime.dopanic.func1+0>  000000c420362180 
00007f2aad7d1aa0:  0000000000429fb1 <runtime.throw+129>  00007f2aad7d1ac0 
00007f2aad7d1ab0:  00007f2aad7d1ad0  0000000000429fb1 <runtime.throw+129> 
00007f2aad7d1ac0:  0000000000000000  000000000000002a 
00007f2aad7d1ad0:  00007f2aad7d1b20  000000000043c75e <runtime.sigpanic+654> 
00007f2aad7d1ae0: <00000000004eefe8  000000000000002a 
00007f2aad7d1af0:  00007f2aad7d1b80  00007f2ab252faf4 
00007f2aad7d1b00:  0000000000000001  000000c420362180 
00007f2aad7d1b10:  0000000000530f38  0000000000771920 
00007f2aad7d1b20:  00007f2aad7d1b80 !00007f2ab252faa4 
00007f2aad7d1b30: >000000c420c3d5a0  0000000030363100 
00007f2aad7d1b40:  00007f2a94001092  000000000000000c 
00007f2aad7d1b50:  0000000000000000  00007f2ab26161f0 
00007f2aad7d1b60:  00007f2a940008c0  1181de1789355500 
00007f2aad7d1b70:  37326e7265747461  1181de1789355500 
00007f2aad7d1b80:  00007f2aad7d1c00  00007f2ab254d812 
00007f2aad7d1b90:  00007f2ab26161f0  00007f2a940008c0 
00007f2aad7d1ba0:  0000000000000001  00007f2ab254d7e0 
00007f2aad7d1bb0:  000000c420c3d5a0  000000000000000c 
00007f2aad7d1bc0:  00007f2a94001092  0000000000000000 
00007f2aad7d1bd0:  0000000000000000  00007f2a94e28400 
00007f2aad7d1be0:  0000000030363100  00007f2a940008c0 
00007f2aad7d1bf0:  00007f2a94db1840  00007f2a94db1840 
00007f2aad7d1c00:  00007f2aad7d1db0  00007f2ab25fa46e 
00007f2aad7d1c10:  0000000000000001  0000000000411619 <runtime.mallocgc+1145> 
00007f2aad7d1c20:  0000009800010463  0000000000000000 
runtime.throw(0x4eefe8, 0x2a)
	/home/iant/go/src/runtime/panic.go:619 +0x81
runtime: unexpected return pc for runtime.sigpanic called from 0x7f2ab252faa4
stack: frame={sp:0x7f2aad7d1ae0, fp:0x7f2aad7d1b30} stack=[0x7f2aacfd22b0,0x7f2aad7d1eb0)
00007f2aad7d19e0:  00007f2aad7d1a50  000000000042a50c <runtime.dopanic_m+540> 
00007f2aad7d19f0:  0000000000429fb1 <runtime.throw+129>  00007f2aad7d1ac0 
00007f2aad7d1a00:  0000000000000000  000000c420362180 
00007f2aad7d1a10:  010000000042aa68  0000000000000004 
00007f2aad7d1a20:  000000000000001f  00007f2ab252faa4 
00007f2aad7d1a30:  000000c438deee28  0000000000000001 
00007f2aad7d1a40:  00000000004ed420  000000c42034f980 
00007f2aad7d1a50:  00007f2aad7d1a78  000000000044fb4c <runtime.dopanic.func1+60> 
00007f2aad7d1a60:  000000c420362180  0000000000429fb1 <runtime.throw+129> 
00007f2aad7d1a70:  00007f2aad7d1ac0  00007f2aad7d1ab0 
00007f2aad7d1a80:  0000000000429eda <runtime.dopanic+74>  00007f2aad7d1a90 
00007f2aad7d1a90:  000000000044fb10 <runtime.dopanic.func1+0>  000000c420362180 
00007f2aad7d1aa0:  0000000000429fb1 <runtime.throw+129>  00007f2aad7d1ac0 
00007f2aad7d1ab0:  00007f2aad7d1ad0  0000000000429fb1 <runtime.throw+129> 
00007f2aad7d1ac0:  0000000000000000  000000000000002a 
00007f2aad7d1ad0:  00007f2aad7d1b20  000000000043c75e <runtime.sigpanic+654> 
00007f2aad7d1ae0: <00000000004eefe8  000000000000002a 
00007f2aad7d1af0:  00007f2aad7d1b80  00007f2ab252faf4 
00007f2aad7d1b00:  0000000000000001  000000c420362180 
00007f2aad7d1b10:  0000000000530f38  0000000000771920 
00007f2aad7d1b20:  00007f2aad7d1b80 !00007f2ab252faa4 
00007f2aad7d1b30: >000000c420c3d5a0  0000000030363100 
00007f2aad7d1b40:  00007f2a94001092  000000000000000c 
00007f2aad7d1b50:  0000000000000000  00007f2ab26161f0 
00007f2aad7d1b60:  00007f2a940008c0  1181de1789355500 
00007f2aad7d1b70:  37326e7265747461  1181de1789355500 
00007f2aad7d1b80:  00007f2aad7d1c00  00007f2ab254d812 
00007f2aad7d1b90:  00007f2ab26161f0  00007f2a940008c0 
00007f2aad7d1ba0:  0000000000000001  00007f2ab254d7e0 
00007f2aad7d1bb0:  000000c420c3d5a0  000000000000000c 
00007f2aad7d1bc0:  00007f2a94001092  0000000000000000 
00007f2aad7d1bd0:  0000000000000000  00007f2a94e28400 
00007f2aad7d1be0:  0000000030363100  00007f2a940008c0 
00007f2aad7d1bf0:  00007f2a94db1840  00007f2a94db1840 
00007f2aad7d1c00:  00007f2aad7d1db0  00007f2ab25fa46e 
00007f2aad7d1c10:  0000000000000001  0000000000411619 <runtime.mallocgc+1145> 
00007f2aad7d1c20:  0000009800010463  0000000000000000 
runtime.sigpanic()
	/home/iant/go/src/runtime/signal_unix.go:372 +0x28e

goroutine 133 [syscall]:
runtime.cgocall(0x4ade50, 0xc420c98d60, 0x4f0778)
	/home/iant/go/src/runtime/cgocall.go:128 +0x64 fp=0xc420c98cf8 sp=0xc420c98cc0 pc=0x404514
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a94db1800, 0xc420f37500, 0xc420e1e000, 0x64, 0x7f2a940008c0, 0xc420c98db0, 0x0)
	_cgo_gotypes.go:597 +0x50 fp=0xc420c98d60 sp=0xc420c98cf8 pc=0x4a4c60
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a94db1800, 0xc420df8a80, 0x64, 0x64, 0x0, 0x7f2a940008c0, 0x4f0428, 0x4bc420, 0xc4207b0b00, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187 fp=0xc420c98dd8 sp=0xc420c98d60 pc=0x4a7487
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc42000e028, 0xc420df8a80, 0x64, 0x64, 0xc42000e048, 0x4f0428, 0x4bc420, 0xc4207b0b00, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa fp=0xc420c98e40 sp=0xc420c98dd8 pc=0x4a403a
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420df8a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b fp=0xc420c98ed8 sp=0xc420c98e40 pc=0x4abb5b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc420c3f800, 0x64, 0x80, 0xc420ccfc00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f fp=0xc420c98f30 sp=0xc420c98ed8 pc=0x4abd5f
main.main.func2(0xc42000c100, 0x11)
	/home/iant/foo8.go:46 +0x9b fp=0xc420c98fd0 sp=0xc420c98f30 pc=0x4ad3bb
runtime.goexit()
	/home/iant/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420c98fd8 sp=0xc420c98fd0 pc=0x453751
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 1 [sleep]:
time.Sleep(0x989680)
	/home/iant/go/src/runtime/time.go:102 +0x166
main.main()
	/home/iant/foo8.go:53 +0x4aa

goroutine 53 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420f3aa80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc420955800, 0x64, 0x80, 0xc420cd1100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 55 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc421183500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc4209b3800, 0x64, 0x80, 0xc420c62700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 56 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420c53500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc4209b2800, 0x64, 0x80, 0xc420f33c00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x4)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 51 [sleep]:
time.Sleep(0x3b9aca00)
	/home/iant/go/src/runtime/time.go:102 +0x166
main.main.func1()
	/home/iant/foo8.go:35 +0x2e
created by main.main
	/home/iant/foo8.go:33 +0x454

goroutine 54 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a84e7b8c0, 0xc420f26380, 0xc420f101a0, 0x64, 0x7f2a840012c0, 0xc420c0adb0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a84e7b8c0, 0xc420f1d500, 0x64, 0x64, 0x0, 0x7f2a840012c0, 0x4f0428, 0x4bc420, 0xc420b96bc8, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc420592e38, 0xc420f1d500, 0x64, 0x64, 0xc420592e58, 0x4f0428, 0x4bc420, 0xc420b96bc8, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420f1d500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc420954800, 0x64, 0x80, 0xc420f14e00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 52 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421157500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc4206df800, 0x64, 0x80, 0xc421131100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x0)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 57 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc421182000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc42097c800, 0x64, 0x80, 0xc421162e00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x5)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 58 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc420f28000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc4206de800, 0x64, 0x80, 0xc420c72e00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x6)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 59 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421176000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc42055d800, 0x64, 0x80, 0xc42115ae00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x7)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 60 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421171500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc42056a800, 0x64, 0x80, 0xc42117a700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x8)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 61 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420df9500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc42055c800, 0x64, 0x80, 0xc420cd0300, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x9)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 62 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420df8000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc42064d800, 0x64, 0x80, 0xc420f18000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0xa)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 63 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc421168000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc420566800, 0x64, 0x80, 0xc421114a00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0xb)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 64 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420f25500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc42064c800, 0x64, 0x80, 0xc420f32700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0xc)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 65 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc4200aca80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc42057a800, 0x64, 0x80, 0xc420f32700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0xd)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 130 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42118f500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc42057e800, 0x64, 0x80, 0xc420c72700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0xe)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 131 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421151500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc420908800, 0x64, 0x80, 0xc42115a700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0xf)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 132 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421170a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc420c3e800, 0x64, 0x80, 0xc42117a000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x10)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 134 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420df8a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc42062e800, 0x64, 0x80, 0xc420f18700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x12)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 135 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc421149500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc42062f800, 0x64, 0x80, 0xc421114300, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x13)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 136 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a80db1800, 0xc42116ea80, 0xc421152820, 0x64, 0x7f2a800008c0, 0xc4209dfdb0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a80db1800, 0xc420f24a80, 0x64, 0x64, 0x0, 0x7f2a800008c0, 0x4f0428, 0x4bc420, 0xc4209acb08, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc4207b1d88, 0xc420f24a80, 0x64, 0x64, 0xc4207b1da8, 0x4f0428, 0x4bc420, 0xc4209acb08, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420f24a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc420640800, 0x64, 0x80, 0xc420f32000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x14)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 137 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc421155500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc420641800, 0x64, 0x80, 0xc421162700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x15)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 138 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42114ea80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc420c31800, 0x64, 0x80, 0xc420c6f800, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x16)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 139 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc420f1c000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc420c41800, 0x64, 0x80, 0xc420c5a000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x17)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 140 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421186000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc420636800, 0x64, 0x80, 0xc42117ae00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x18)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 141 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420f3b500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc420c40800, 0x64, 0x80, 0xc420cd1800, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x19)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 142 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420f43500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc420637800, 0x64, 0x80, 0xc420f16300, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1a)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 143 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc420f20000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc4206e2800, 0x64, 0x80, 0xc420c62000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1b)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 144 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420c52a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc420671800, 0x64, 0x80, 0xc420f33500, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1c)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 145 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc421154a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc420756800, 0x64, 0x80, 0xc421162000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1d)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 146 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42118ea80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc420757800, 0x64, 0x80, 0xc420c72000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1e)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 147 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a80f09850, 0xc420c66000, 0xc4211ce000, 0x64, 0x7f2a80f08d40, 0xc420882db0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a80f09850, 0xc421135500, 0x64, 0x64, 0x0, 0x7f2a80f08d40, 0x4f0428, 0x4bc420, 0xc4202f8b50, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc4207b0008, 0xc421135500, 0x64, 0x64, 0xc4207b0028, 0x4f0428, 0x4bc420, 0xc4202f8b50, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421135500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc420856800, 0x64, 0x80, 0xc420c5d100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x1f)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 148 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421156a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc420857800, 0x64, 0x80, 0xc421130a00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x20)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 149 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420c77500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc420968800, 0x64, 0x80, 0xc420c72e00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x21)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 150 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420f42000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc420969800, 0x64, 0x80, 0xc420f15500, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x22)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 151 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a98daa5d0, 0xc420c7a380, 0xc420c701a0, 0x64, 0x7f2a98000a40, 0xc4208a8db0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a98daa5d0, 0xc421148a80, 0x64, 0x64, 0x0, 0x7f2a98000a40, 0x4f0428, 0x4bc420, 0xc42000ed18, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc4202f91b8, 0xc421148a80, 0x64, 0x64, 0xc4202f91d8, 0x4f0428, 0x4bc420, 0xc42000ed18, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc421148a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc4206da800, 0x64, 0x80, 0xc421113c00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x23)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 152 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420e08000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc4206db800, 0x64, 0x80, 0xc420f34300, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x24)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 153 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc420f12000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc4206f8800, 0x64, 0x80, 0xc420f32000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x25)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 154 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42117e000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc4206f9800, 0x64, 0x80, 0xc42116a700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x26)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 155 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421177500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc420670800, 0x64, 0x80, 0xc42115bc00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x27)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 156 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc420f22000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc4207fe800, 0x64, 0x80, 0xc420c6c000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x28)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 157 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420f3a000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc420b67800, 0x64, 0x80, 0xc420cd0a00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x29)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 158 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420c78a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc4205c0800, 0x64, 0x80, 0xc420f17100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2a)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 159 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc421169500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc4205c1800, 0x64, 0x80, 0xc421115800, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2b)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 160 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420c52000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc4205ca800, 0x64, 0x80, 0xc420f32e00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2c)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 161 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc421154000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc4205cb800, 0x64, 0x80, 0xc420c65800, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2d)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 162 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42114f500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc420b66800, 0x64, 0x80, 0xc42116a000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2e)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 163 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421176a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc420b5d800, 0x64, 0x80, 0xc42115b500, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x2f)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 164 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200941c8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200941c4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421170000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc4205b8800, 0x64, 0x80, 0xc421131800, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x30)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 165 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420c76a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc4205b9800, 0x64, 0x80, 0xc420c72700, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x31)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 166 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420f42a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc4205c2800, 0x64, 0x80, 0xc420f15c00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x32)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 167 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc42118e000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc4205c3800, 0x64, 0x80, 0xc42118a000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x33)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 168 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420e08a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc420b5c800, 0x64, 0x80, 0xc420f34a00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x34)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 169 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a88db1800, 0xc420c5e380, 0xc4211c01a0, 0x64, 0x7f2a88000a40, 0xc420884db0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a88db1800, 0xc42113b500, 0x64, 0x64, 0x0, 0x7f2a88000a40, 0x4f0428, 0x4bc420, 0xc42070ad58, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc42070b3f0, 0xc42113b500, 0x64, 0x64, 0xc42070b410, 0x4f0428, 0x4bc420, 0xc42070ad58, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc42113b500, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc420509800, 0x64, 0x80, 0xc420c65100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x35)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 170 [semacquire]:
sync.runtime_SemacquireMutex(0xc4206140d8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4206140d4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42117ea80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc420511800, 0x64, 0x80, 0xc42116ae00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x36)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 171 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421150a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc420510800, 0x64, 0x80, 0xc42115a000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x37)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 172 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x7f2a84cb2df0, 0xc421161180, 0xc421146b60, 0x64, 0x7f2a840008c0, 0xc420beddb0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x7f2a84cb2df0, 0xc421156000, 0x64, 0x64, 0x0, 0x7f2a840008c0, 0x4f0428, 0x4bc420, 0xc4209acd28, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc42000edf8, 0xc421156000, 0x64, 0x64, 0xc42000ee18, 0x4f0428, 0x4bc420, 0xc4209acd28, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094190, 0xc421156000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094190, 0xc420514800, 0x64, 0x80, 0xc421130300, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x38)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 173 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094128, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094124)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094124)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200940f0, 0xc420c76000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200940f0, 0xc420515800, 0x64, 0x80, 0xc420c72000, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x39)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 174 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094218, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094214)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094214)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4200941e0, 0xc420c78000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4200941e0, 0xc420508800, 0x64, 0x80, 0xc420f16a00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3a)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 175 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614038, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614034)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614034)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614000, 0xc421168a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614000, 0xc420c30800, 0x64, 0x80, 0xc421115100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3b)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 176 [semacquire]:
sync.runtime_SemacquireMutex(0xc420614088, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420614084)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420614084)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420614050, 0xc420f24000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420614050, 0xc420521800, 0x64, 0x80, 0xc420096e00, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3c)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 177 [semacquire]:
sync.runtime_SemacquireMutex(0xc420094268, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc420094264)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc420094264)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094230, 0xc421182a80, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094230, 0xc420520800, 0x64, 0x80, 0xc421163500, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3d)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 178 [runnable, locked to thread]:
github.com/flier/gohs/hyperscan._Cfunc_hs_scan_vector_cgo(0x2ed94d0, 0xc420f36700, 0xc420c68340, 0x64, 0x21a2180, 0xc4208c1db0, 0x0)
	_cgo_gotypes.go:597 +0x50
github.com/flier/gohs/hyperscan.hsScanVector(0x2ed94d0, 0xc42114e000, 0x64, 0x64, 0x0, 0x21a2180, 0x4f0428, 0x4bc420, 0xc420592b88, 0x462f7d, ...)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/internal.go:946 +0x187
github.com/flier/gohs/hyperscan.(*vectoredScanner).Scan(0xc4209ac468, 0xc42114e000, 0x64, 0x64, 0xc4209ac488, 0x4f0428, 0x4bc420, 0xc420592b88, 0x0, 0x0)
	/home/iant/gopath/src/github.com/flier/gohs/hyperscan/runtime.go:231 +0xaa
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc4206140a0, 0xc42114e000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:82 +0x10b
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc4206140a0, 0xc420567800, 0x64, 0x80, 0xc420c6f100, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3e)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487

goroutine 179 [semacquire]:
sync.runtime_SemacquireMutex(0xc4200942b8, 0x411c00)
	/home/iant/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/mutex.go:134 +0x108
sync.(*RWMutex).Lock(0xc4200942b4)
	/home/iant/go/src/sync/rwmutex.go:93 +0x2d
github.com/vgalu/hypermatcher.(*SimpleEngine).Match(0xc420094280, 0xc421150000, 0x64, 0x64, 0x64, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:81 +0x9c
github.com/vgalu/hypermatcher.(*SimpleEngine).MatchStrings(0xc420094280, 0xc42056b800, 0x64, 0x80, 0xc420c5d800, 0x64, 0x64, 0x0, 0x0)
	/home/iant/gopath/src/github.com/vgalu/hypermatcher/simpleengine.go:106 +0x6f
main.main.func2(0xc42000c100, 0x3f)
	/home/iant/foo8.go:46 +0x9b
created by main.main
	/home/iant/foo8.go:42 +0x487
@brknstrngz

This comment has been minimized.

Copy link
Author

commented Jan 28, 2018

Yes, that's the one we've been seeing without the KeepAlive trick. I have managed to get 1.10rc1 installed on my laptop and can confirm it still occurs.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2018

The escape analysis reported by the compiler looks correct. cgo converts the function in question to this:

func hsDeserializeDatabaseAt(data []byte, db hsDatabase) error {
	if ret := func(_cgo0 *_Ctype_char, _cgo1 _Ctype_size_t, _cgo2 *_Ctype_struct_hs_database) _Ctype_hs_error_t {;	_cgoCheckPointer(_cgo2);	return (_Cfunc_hs_deserialize_database_at)(_cgo0, _cgo1, _cgo2);}((*_Ctype_char)(unsafe.Pointer(&data[0])), _Ctype_size_t(len(data)), db); ret != (_Ciconst_HS_SUCCESS) {
		return HsError(ret)
	}

	return nil
}

Compiling that with -m reports

../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:592: &data[0] escapes to heap
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:591: leaking param: data
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:591: leaking param: db
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:592: _cgo2 escapes to heap
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:592: leaking param: _cgo2
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:592: leaking param: _cgo0
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:593: HsError(ret) escapes to heap
../../gopath/src/github.com/flier/gohs/hyperscan/internal.go:592: hsDeserializeDatabaseAt func literal does not escape
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2018

The function _Cfunc_hs_deserialize_database_at looks like this:

//go:cgo_unsafe_args
func _Cfunc_hs_deserialize_database_at(p0 *_Ctype_char, p1 _Ctype_size_t, p2 *_Ctype_struct_hs_database) (r1 _Ctype_hs_error_t) {
	_cgo_runtime_cgocall(_cgo_676e1442a9c2_Cfunc_hs_deserialize_database_at, uintptr(unsafe.Pointer(&p0)))
	if _Cgo_always_false {
		_Cgo_use(p0)
		_Cgo_use(p1)
		_Cgo_use(p2)
	}
	return
}

For that the compiler reports

/tmp/go-build087061982/b001/_cgo_gotypes.go:433:11: p0 escapes to heap
/tmp/go-build087061982/b001/_cgo_gotypes.go:430:110: leaking param: p0
/tmp/go-build087061982/b001/_cgo_gotypes.go:434:11: p1 escapes to heap
/tmp/go-build087061982/b001/_cgo_gotypes.go:435:11: p2 escapes to heap
/tmp/go-build087061982/b001/_cgo_gotypes.go:430:110: leaking param: p2
/tmp/go-build087061982/b001/_cgo_gotypes.go:431:98: _Cfunc_hs_deserialize_database_at &p0 does not escape
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2018

I guess what matters here is the liveness, but that also looks OK:

/tmp/go-build020900335/b001/_cgo_gotypes.go:430:110: live at entry to _Cfunc_hs_deserialize_database_at: p0 p2
/tmp/go-build020900335/b001/_cgo_gotypes.go:431:22: live at call to cgocall: p0 p2 .autotmp_4
/tmp/go-build020900335/b001/_cgo_gotypes.go:433:11: live at call to cgoUse: p0 p2
/tmp/go-build020900335/b001/_cgo_gotypes.go:434:11: live at call to convT2E64: p0 p2
/tmp/go-build020900335/b001/_cgo_gotypes.go:434:11: live at call to cgoUse: p0 p2
/tmp/go-build020900335/b001/_cgo_gotypes.go:435:11: live at call to cgoUse: p0
@flier

This comment has been minimized.

Copy link

commented Jan 29, 2018

@ianlancetaylor You may check hsScanVector which cause the crash and it is using two layers pointer array.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2018

@flier Thanks for the pointer. That code is not safe and breaks the rule of unsafe.Pointer. Specifically this line:

cdata[i] = uintptr(unsafe.Pointer(&d[0]))

is not permitted. See https://golang.org/pkg/unsafe/#Pointer , which lists all the valid ways that an unsafe.Pointer may be used. A Go program may convert an unsafe.Pointer to a uintptr if you are going to do something like print it, but it may not use that uintptr as a pointer. But that is exactly what the code is doing: it is passing that uintptr to C code that is going to try to use it as a pointer. That is not valid.

Also the call to C.hs_scan_vector_cgo is converting several pointers to uintptr values. Pointers should be passed to C code as pointers. While there is a special exception that applies to passing a uintptr to syscall.Syscall, that exception does not exist for cgo.

I recommend fixing the code and seeing whether the problem still occurs.

@flier

This comment has been minimized.

Copy link

commented Jan 30, 2018

I have to use those not valid code because cgo always report runtime error: cgo argument has Go pointer to Go pointer if I direct use an array of pointer as you said, and the cost is too high if I copy all the data to a new allocated C memory. Any suggestion about it?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2018

The runtime error cgo argument has Go pointer to Go pointer is not there just to be annoying. It's because trying to pass C code a Go pointer that points to a Go pointer will not work reliably. As you can see. Your code succeeds in avoiding the error, but it replaces a reliable error with an unpredictable program crash. That's not a good tradeoff.

Unfortunately I don't know the problem domain well enough to know what to suggest. Perhaps you could provide an API to aggregate the bytes in C memory, rather than taking a [][]byte. Perhaps the function is normally called with just a few slices of slices, and you can enumerate the possibilities.

@flier

This comment has been minimized.

Copy link

commented Jan 30, 2018

I think the problem is the Go slice of slices using different memory layout to the C array of array, the trick is dirty but works and efficient, thanks anyway

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2018

The trick doesn't work. In the absence of other information, I'm going to assume that it is causing the program crashes reported here. Closing this issue.

@golang golang locked and limited conversation to collaborators Jan 30, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.