[GitHub] [pulsar] lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer
lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer URL: https://github.com/apache/pulsar/issues/5695#issuecomment-566190061 Just tried in a Debian VM with 4GB RAM with openjdk-11-jre, 2.4.2, still segfault :/ . But I also installed the deb dev library and ran the go program from the Linux: it is working without issues. So it's likely the libpulsar lib on Mac OS. :( Sorry I thought it would be the Go API. Is there something I can do to troubleshoot more the libpulsar brew package? ``` $ brew info libpulsar libpulsar: stable 2.4.1 (bottled) Apache Pulsar C++ library https://pulsar.apache.org/ /usr/local/Cellar/libpulsar/2.4.1_1 (50 files, 14.0MB) * Poured from bottle on 2019-11-16 at 19:13:31 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libpulsar.rb ==> Dependencies Build: cmake ✔, pkg-config ✔ Required: boost ✔, openssl@1.1 ✔, protobuf ✘, zstd ✘ ==> Analytics install: 126 (30 days), 404 (90 days), 1,246 (365 days) install-on-request: 126 (30 days), 404 (90 days), 1,247 (365 days) build-error: 0 (30 days) ``` ``` $ brew list libpulsar /usr/local/Cellar/libpulsar/2.4.1_1/include/pulsar/ (42 files) /usr/local/Cellar/libpulsar/2.4.1_1/lib/libpulsar.2.4.1.dylib /usr/local/Cellar/libpulsar/2.4.1_1/lib/ (2 other files) ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [pulsar] lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer
lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer URL: https://github.com/apache/pulsar/issues/5695#issuecomment-566095147 @wolfstudy thanks a lot. This code is also giving me the segfault. I realize the only variable in our setups is I'm using a Pulsar docker-container. ``` version: '3' services: pulsar: image: 'apachepulsar/pulsar:2.4.2' ports: - '6650:6650' - '8080:8080' command: bin/pulsar standalone ``` (either 2.4.1 or 2.4.2, there's no 2.5.0 yet on Docker Hub). ``` $ docker inspect apachepulsar/pulsar:2.4.2 [ { "Id": "sha256:08287f8732ada886938e1cad6a635f74ec3d55e2386488839928ec95a1c3baea ``` My hunch is: on Mac OS, Docker is in a VM, for heavy tasks, they are usually slowed down. Would it be possible that the broker does not reply with the ID fast enough to the client? Will try with non VM pulsar and let you know. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [pulsar] lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer
lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer URL: https://github.com/apache/pulsar/issues/5695#issuecomment-562997510 Up @jiazhai / @wolfstudy ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [pulsar] lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer
lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer URL: https://github.com/apache/pulsar/issues/5695#issuecomment-561059864 I created a branch with more debug: https://github.com/lspgn/pulsar/commit/7d1c0f4c2074f2240b888306822d81092042a490 The following C prints more information about the messageId structure: ``` static void myprint(pulsar_message_id_t* messageId) { printf(" messageId: %x\n", messageId); char *a = messageId; printf(" strlen: %d\n", strlen(a)); printf(" "); for(int i = 0; i < strlen(a);i++) { printf("0x%x ", a[i]); } printf("\n"); } ``` The output of this is: ``` getMessageId messageID String &{} messageId: a401c60 strlen: 0 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: a401c60 strlen: 0 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: a401c60 strlen: 0 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: a300fa0 strlen: 0 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: 6e032f0 strlen: 3 0xff93 0x2 0x6e The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: 6f16380 strlen: 4 0xfff8 0x63 0xfff1 0x6 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: 6f165c0 strlen: 0 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: 6e035a0 strlen: 4 0xffc8 0x76 0xffe0 0x6 The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: a402770 strlen: 4 0xffe8 0x2c 0x40 0xa The message Id value is: [6e6f6e65] getMessageId messageID String &{} messageId: 6f16380 strlen: 4 0x48 0x67 0xfff1 0x6 The message Id value is: [6e6f6e65] ``` Quite a few messages have a length of zero? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [pulsar] lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer
lspgn commented on issue #5695: Go: Segfault on messageId serialize after getting it from producer URL: https://github.com/apache/pulsar/issues/5695#issuecomment-561032305 @wolfstudy sorry to re-open (was on vacations), I ran tests with the example file: I'm getting the following: It rarely manages to display a message Id (maybe a race condition?), most of the time, it just panic at the first one. ``` The message Id value is: [(4294967295,140734859843417,57,0)] The message Id value is: [(75552472,0,2433,36)] fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x470fafa] runtime stack: runtime.throw(0x434b363, 0x2a) /usr/local/Cellar/go/1.13.3/libexec/src/runtime/panic.go:774 +0x72 runtime.sigpanic() /usr/local/Cellar/go/1.13.3/libexec/src/runtime/signal_unix.go:378 +0x47c goroutine 1 [syscall]: runtime.cgocall(0x42932a0, 0xc000109800, 0x40) /usr/local/Cellar/go/1.13.3/libexec/src/runtime/cgocall.go:128 +0x5b fp=0xc0001097d0 sp=0xc000109798 pc=0x400519b github.com/apache/pulsar/pulsar-client-go/pulsar._Cfunc_pulsar_message_id_str(0x6e003b0, 0x0) _cgo_gotypes.go:1279 +0x4a fp=0xc000109800 sp=0xc0001097d0 pc=0x4279c3a github.com/apache/pulsar/pulsar-client-go/pulsar.(*messageID).String.func1(0xca8080, 0x4037e80) /Users/me/go/pkg/mod/github.com/apache/pulsar/pulsar-client-go@v0.0.0-20191203033040-9137065ffcac/pulsar/c_message.go:199 +0x5e fp=0xc000109840 sp=0xc000109800 pc=0x428906e github.com/apache/pulsar/pulsar-client-go/pulsar.(*messageID).String(0xca8080, 0x0, 0x0) /Users/me/go/pkg/mod/github.com/apache/pulsar/pulsar-client-go@v0.0.0-20191203033040-9137065ffcac/pulsar/c_message.go:199 +0x37 fp=0xc0001098a8 sp=0xc000109840 pc=0x4280ba7 fmt.(*pp).handleMethods(0xc00012, 0x76, 0x1) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:630 +0x302 fp=0xc000109ab8 sp=0xc0001098a8 pc=0x40bc262 fmt.(*pp).printArg(0xc00012, 0x42e3bc0, 0xca8080, 0xc00076) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:713 +0x206 fp=0xc000109b50 sp=0xc000109ab8 pc=0x40bc826 fmt.(*pp).doPrintf(0xc00012, 0x4346be0, 0x1f, 0xc000109e20, 0x1, 0x1) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:1030 +0x15b fp=0xc000109c38 sp=0xc000109b50 pc=0x40c01eb fmt.Fprintf(0x43a5ce0, 0xca8008, 0x4346be0, 0x1f, 0xc000109e20, 0x1, 0x1, 0x0, 0x0, 0x0) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:204 +0x72 fp=0xc000109ca0 sp=0xc000109c38 pc=0x40b9092 fmt.Printf(...) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:213 main.main() /Users/me/repos/pulsar-test/producer.go:61 +0x2ee fp=0xc000109f60 sp=0xc000109ca0 pc=0x4291d1e runtime.main() /usr/local/Cellar/go/1.13.3/libexec/src/runtime/proc.go:203 +0x21e fp=0xc000109fe0 sp=0xc000109f60 pc=0x4030cae runtime.goexit() /usr/local/Cellar/go/1.13.3/libexec/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000109fe8 sp=0xc000109fe0 pc=0x405b561 exit status 2 ``` ``` The message Id value is: [(75552472,0,2433,36)] fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x470fafa] runtime stack: runtime.throw(0x434b363, 0x2a) /usr/local/Cellar/go/1.13.3/libexec/src/runtime/panic.go:774 +0x72 runtime.sigpanic() /usr/local/Cellar/go/1.13.3/libexec/src/runtime/signal_unix.go:378 +0x47c goroutine 1 [syscall]: runtime.cgocall(0x42932a0, 0xc000109800, 0xa0) /usr/local/Cellar/go/1.13.3/libexec/src/runtime/cgocall.go:128 +0x5b fp=0xc0001097d0 sp=0xc000109798 pc=0x400519b github.com/apache/pulsar/pulsar-client-go/pulsar._Cfunc_pulsar_message_id_str(0x7001240, 0x0) _cgo_gotypes.go:1279 +0x4a fp=0xc000109800 sp=0xc0001097d0 pc=0x4279c3a github.com/apache/pulsar/pulsar-client-go/pulsar.(*messageID).String.func1(0xca8078, 0x4037e80) /Users/me/go/pkg/mod/github.com/apache/pulsar/pulsar-client-go@v0.0.0-20191203033040-9137065ffcac/pulsar/c_message.go:199 +0x5e fp=0xc000109840 sp=0xc000109800 pc=0x428906e github.com/apache/pulsar/pulsar-client-go/pulsar.(*messageID).String(0xca8078, 0x0, 0x0) /Users/me/go/pkg/mod/github.com/apache/pulsar/pulsar-client-go@v0.0.0-20191203033040-9137065ffcac/pulsar/c_message.go:199 +0x37 fp=0xc0001098a8 sp=0xc000109840 pc=0x4280ba7 fmt.(*pp).handleMethods(0xc00011e000, 0x76, 0x1) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:630 +0x302 fp=0xc000109ab8 sp=0xc0001098a8 pc=0x40bc262 fmt.(*pp).printArg(0xc00011e000, 0x42e3bc0, 0xca8078, 0x76) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:713 +0x206 fp=0xc000109b50 sp=0xc000109ab8 pc=0x40bc826 fmt.(*pp).doPrintf(0xc00011e000, 0x4346be0, 0x1f, 0xc000109e20, 0x1, 0x1) /usr/local/Cellar/go/1.13.3/libexec/src/fmt/print.go:1030