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

fix go-mysql-transfer running on osx crash problem #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chinaestone
Copy link

@chinaestone chinaestone commented Nov 27, 2023

Upgrade json-iterator to v1.1.12, avoid running on mac osx running crash problem .

github.com/json-iterator/go v1.1.12

upgrade 	json-iterator to v1.1.12, avoid running on mac osx running crash problem .

`github.com/json-iterator/go v1.1.12`
@chinaestone
Copy link
Author

chinaestone commented Nov 27, 2023

Using json-iterator 1.1.9 will throw blew exception on osx .

➜  web git:(1.0.5) ✗ ./main --config=./app.yml
2023-11-27 16:13:53.712782 I | process id: 96321
2023-11-27 16:13:53.712807 I | GOMAXPROCS :8
2023-11-27 16:13:53.712811 I | source  mysql(127.0.0.1:3306)
2023-11-27 16:13:53.712815 I | destination redis(127.0.0.1:6379)
2023-11-27 16:13:53.746794 I | transfer run from position(binlog.000001 7870)
unexpected fault address 0xb01dfacedebac1e
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x106b6df]

goroutine 83 [running]:
runtime.throw({0x2351447?, 0xc00006ed80?})
	/Users/FreePixel/Documents/go1214/src/runtime/panic.go:1077 +0x5c fp=0xc0005b77a8 sp=0xc0005b7778 pc=0x103a7dc
runtime.sigpanic()
	/Users/FreePixel/Documents/go1214/src/runtime/signal_unix.go:875 +0x285 fp=0xc0005b7808 sp=0xc0005b77a8 pc=0x1050d25
aeshashbody()
	/Users/FreePixel/Documents/go1214/src/runtime/asm_amd64.s:1422 +0x39f fp=0xc0005b7810 sp=0xc0005b7808 pc=0x106b6df
runtime.mapiternext(0xc0005c6680)
	/Users/FreePixel/Documents/go1214/src/runtime/map.go:937 +0x2bc fp=0xc0005b7880 sp=0xc0005b7810 pc=0x101341c
runtime.mapiterinit(0x101749c?, 0xc00006ed80?, 0xc0001ee410?)
	/Users/FreePixel/Documents/go1214/src/runtime/map.go:864 +0x252 fp=0xc0005b78a0 sp=0xc0005b7880 pc=0x1013112
reflect.mapiterinit(0x1012a15?, 0xd0?, 0x21f6040?)
	/Users/FreePixel/Documents/go1214/src/runtime/map.go:1392 +0x13 fp=0xc0005b78c8 sp=0xc0005b78a0 pc=0x1067293
github.com/modern-go/reflect2.(*UnsafeMapType).UnsafeIterate(...)
	/Users/FreePixel/Documents/GoPath/extern_pkg/pkg/mod/github.com/modern-go/[email protected]/unsafe_map.go:112
github.com/json-iterator/go.(*sortKeysMapEncoder).Encode(0xc00037f9b0, 0xc000132148, 0xc00009d2c0)
	/Users/FreePixel/Documents/GoPath/extern_pkg/pkg/mod/github.com/json-iterator/[email protected]/reflect_map.go:291 +0x1f4 fp=0xc0005b7a18 sp=0xc0005b78c8 pc=0x1af9674
github.com/json-iterator/go.(*onePtrEncoder).Encode(0xc00034b180, 0xc00037f7a0, 0xc0005c6680?)
	/Users/FreePixel/Documents/GoPath/extern_pkg/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:219 +0x75 fp=0xc0005b7a50 sp=0xc0005b7a18 pc=0x1af2155
github.com/json-iterator/go.(*Stream).WriteVal(0xc00009d2c0, {0x211b8e0, 0xc00037f7a0})
	/Users/FreePixel/Documents/GoPath/extern_pkg/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:98 +0x14e fp=0xc0005b7ac0 sp=0xc0005b7a50 pc=0x1af152e
github.com/json-iterator/go.(*frozenConfig).Marshal(0xc0003026e0, {0x211b8e0, 0xc00037f7a0})
	/Users/FreePixel/Documents/GoPath/extern_pkg/pkg/mod/github.com/json-iterator/[email protected]/config.go:299 +0xb8 fp=0xc0005b7b58 sp=0xc0005b7ac0 pc=0x1ae90d8
go-mysql-transfer/service/endpoint.encodeValue(0xc000146d80?, 0xc000372280?)
	/Users/Estone/Downloads/go-mysql-transfer/service/endpoint/endpoint.go:234 +0x143 fp=0xc0005b7c78 sp=0xc0005b7b58 pc=0x1ece1e3
go-mysql-transfer/service/endpoint.(*RedisEndpoint).ruleRespond(0x23527b8?, 0xc000146d80, 0xc000372280)
	/Users/Estone/Downloads/go-mysql-transfer/service/endpoint/redis.go:205 +0x19f fp=0xc0005b7cb8 sp=0xc0005b7c78 pc=0x1ed613f
go-mysql-transfer/service/endpoint.(*RedisEndpoint).Consume(0xc00040c2c0, {{0xc00007dec4?, 0x3565820?}, 0x0?}, {0xc000130e00, 0xb, 0xc000058500?})
	/Users/Estone/Downloads/go-mysql-transfer/service/endpoint/redis.go:133 +0x2fb fp=0xc0005b7e00 sp=0xc0005b7cb8 pc=0x1ed543b
go-mysql-transfer/service.(*handler).startListener.func1()
	/Users/Estone/Downloads/go-mysql-transfer/service/handler.go:174 +0x57c fp=0xc0005b7fe0 sp=0xc0005b7e00 pc=0x1eda4fc
runtime.goexit()
	/Users/FreePixel/Documents/go1214/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0005b7fe8 sp=0xc0005b7fe0 pc=0x106e101
created by go-mysql-transfer/service.(*handler).startListener in goroutine 1
	/Users/Estone/Downloads/go-mysql-transfer/service/handler.go:136 +0x4f

goroutine 1 [sleep]:
runtime.gopark(0x7de8965fcbab?, 0xc00058fd70?, 0xa0?, 0x58?, 0xc00037e2d0?)
	/Users/FreePixel/Documents/go1214/src/runtime/proc.go:398 +0xce fp=0xc00058fd60 sp=0xc00058fd40 pc=0x103d5ce
time.Sleep(0x3b9aca00)
	/Users/FreePixel/Documents/go1214/src/runtime/time.go:195 +0x125 fp=0xc00058fda0 sp=0xc00058fd60 pc=0x106b0c5
go-mysql-transfer/service.(*TransferService).run(0xc0004a9c70)
	/Users/Estone/Downloads/go-mysql-transfer/service/transfer_service.go:132 +0x111 fp=0xc00058fde0 sp=0xc00058fda0 pc=0x1ede0f1
go-mysql-transfer/service.(*TransferService).StartUp(0xc0004a9c70)
	/Users/Estone/Downloads/go-mysql-transfer/service/transfer_service.go:145 +0x156 fp=0xc00058fe38 sp=0xc00058fde0 pc=0x1ede6b6
go-mysql-transfer/service.StartUp()
	/Users/Estone/Downloads/go-mysql-transfer/service/service.go:55 +0x53 fp=0xc00058fe50 sp=0xc00058fe38 pc=0x1edac53
main.main()
	/Users/Estone/Downloads/go-mysql-transfer/main.go:136 +0x133 fp=0xc00058ff40 sp=0xc00058fe50 pc=0x1fb3c33
runtime.main()
	/Users/FreePixel/Documents/go1214/src/runtime/proc.go:267 +0x2bb fp=0xc00058ffe0 sp=0xc00058ff40 pc=0x103d15b
runtime.goexit()
	/Users/FreePixel/Documents/go1214/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00058ffe8 sp=0xc00058ffe0 pc=0x106e101

@chinaestone
Copy link
Author

go offical issue: golang/go#14631

@chinaestone chinaestone changed the title fix go-mysql-transfer crash problem fix go-mysql-transfer running on osx crash problem Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant