apache / rocketmq-client-go

Apache RocketMQ go client
https://rocketmq.apache.org/
Apache License 2.0
1.31k stars 423 forks source link

sync.map panic #887

Closed lampnick closed 1 year ago

lampnick commented 2 years ago

BUG REPORT

  1. Please describe the issue you observed:

    • What did you do (The steps to reproduce)?
image
- What did you expect to see?
  Don't panic.

- What did you see instead?
   Program exited because the SDK cause fatal error. so can't recover it.
  unexpected fault address 0x1cf114c0
  fatal error: fault
  [signal SIGSEGV: segmentation violation code=0x1 addr=0x1cf114c0 pc=0x4113a1]

  goroutine 25972 [running]:
  runtime.throw(0x167f0a5, 0x5)
      /usr/local/go/src/runtime/panic.go:1117 +0x72 fp=0xc006045870 sp=0xc006045840 pc=0x439f32
  runtime.sigpanic()
      /usr/local/go/src/runtime/signal_unix.go:741 +0x268 fp=0xc0060458a8 sp=0xc006045870 pc=0x451548
  runtime.evacuated(...)
      /usr/local/go/src/runtime/map.go:203
  runtime.mapaccess2(0x1468000, 0x192f540, 0xc006045948, 0x7f2b1c07ccc0, 0x10)
      /usr/local/go/src/runtime/map.go:480 +0xc1 fp=0xc0060458e8 sp=0xc0060458a8 pc=0x4113a1
  sync.(*Map).Load(0xc008f0d7c8, 0x13fc2a0, 0xc0060459c0, 0x53acec, 0xc012fee070, 0xc008157440)
      /usr/local/go/src/sync/map.go:104 +0xaf fp=0xc006045968 sp=0xc0060458e8 pc=0x4891ef
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).connect(0xc008f0d7a0, 0x194cf88, 0xc012fee060, 0xc005e174a7, 0x43, 0x0, 0x0, 0x0)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/remote/remote_client.go:123 +0xc5 fp=0xc0060459f0 sp=0xc006045968 pc=0x1250725
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).InvokeSync(0xc008f0d7a0, 0x194cf88, 0xc012fee060, 0xc005e174a7, 0x43, 0xc00839d100, 0x0, 0x0, 0x0)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/remote/remote_client.go:72 +0x9d fp=0xc006045a88 sp=0xc0060459f0 pc=0x124ff9d
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).queryTopicRouteInfoFromServer(0xc0056538c0, 0xc007e590e0, 0x55, 0x1659f00, 0xc009315c80, 0x4f8201)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/route.go:355 +0x1c2 fp=0xc006045b98 sp=0xc006045a88 pc=0x125c802
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).UpdateTopicRouteInfoWithDefault(0xc0056538c0, 0xc007e590e0, 0x55, 0x0, 0x0, 0x0, 0x0, 0xc006a05e00, 0x0, 0x0)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/route.go:132 +0xd0 fp=0xc006045c78 sp=0xc006045b98 pc=0x125aef0
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).UpdateTopicRouteInfo(...)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/route.go:116
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).UpdateTopicRouteInfo(0xc0070e5040)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/client.go:581 +0x32e fp=0xc006045f08 sp=0xc006045c78 pc=0x1254dae
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).Start.func1.2.1(...)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/client.go:323
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).Start.func1.2()
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/client.go:333 +0xb1 fp=0xc006045fb8 sp=0xc006045f08 pc=0x1263671
  myrepo/vendor/github.com/apache/rocketmq-client-go/v2/primitive.WithRecover(0xc008291450)
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/primitive/base.go:96 +0x49 fp=0xc006045fd8 sp=0xc006045fb8 pc=0x1246249
  runtime.goexit()
      /usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc006045fe0 sp=0xc006045fd8 pc=0x473981
  created by myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).Start.func1
      /usr/local/go/src/myrepo/vendor/github.com/apache/rocketmq-client-go/v2/internal/client.go:320 +0x10e
  1. Please tell us about your environment:

    • What is your OS?

      / # cat /etc/issue 
      Welcome to Alpine Linux 3.7
      Kernel \r on an \m (\l)
      
      / # uname -a
      Linux  4.19.91-24.1.al7.x86_64 #1 SMP Wed Jul 21 17:40:23 CST 2021 x86_64 Linux
      / # 
    • What is your client version?

      • RocketMQ SDK : v2.1.0
      • golang 1.16.7
    • What is your RocketMQ version? 阿里云铂金版 RocketMQ,和开源不一样。

  2. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):

    This is another panic log from another client.
    
    unexpected fault address 0x192f540
    fatal error: fault
    [signal SIGSEGV: segmentation violation code=0x2 addr=0x192f540 pc=0x192f540]
    
    goroutine 3269108 [running]:
    runtime.throw(0x167f0a5, 0x5)
        /usr/local/go/src/runtime/panic.go:1117 +0x72 fp=0xc009d68fa8 sp=0xc009d68f78 pc=0x439f32
    runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:741 +0x268 fp=0xc009d68fe0 sp=0xc009d68fa8 pc=0x451548
    runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1372 +0x1 fp=0xc009d68fe8 sp=0xc009d68fe0 pc=0x473981
    created by time.goFunc
        /usr/local/go/src/time/sleep.go:180 +0x45
    
francisoliverlee commented 1 year ago

it may be casued by Alpine linux and golang runtime, try on macos or centos