Segmentation fault in couchbase.so

Hello,

I am getting a segfault, not sure how to debug it.

Oct  4 10:32:59 dv-wb01 kernel: traps: AppRefreshConsumer[12323] general protection ip:561db183e317 sp:7fff4e8698f0 error:0
Oct  4 10:32:59 dv-wb01 kernel: traps: AppRefreshConsumer[12396] general protection ip:561db183e317 sp:7fff4e8698f0 error:0
Oct  4 10:32:59 dv-wb01 kernel: in php[561db1538000+475000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: traps: AppRefreshConsumer[12371] general protection ip:561db183e317 sp:7fff4e8698f0 error:0
Oct  4 10:32:59 dv-wb01 kernel: in php[561db1538000+475000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: AppRefreshConsumer[12505]: segfault at d15 ip 00007f1320a000d7 sp 00007fff4e86a4a0 error 4
Oct  4 10:32:59 dv-wb01 kernel: in couchbase.so[7f13209ac000+74000]
Oct  4 10:32:59 dv-wb01 kernel: AppRefreshConsumer[12440]: segfault at 0 ip 0000561db183e2fb sp 00007fff4e8699e0 error 4
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: in php[561db1538000+475000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: AppRefreshConsumer[12591]: segfault at d15 ip 00007f1320a000d7 sp 00007fff4e86a5d0 error 4
Oct  4 10:32:59 dv-wb01 kernel: in couchbase.so[7f13209ac000+74000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: AppRefreshConsumer[12602]: segfault at d15 ip 00007f1320a000d7 sp 00007fff4e86a460 error 4
Oct  4 10:32:59 dv-wb01 kernel: in couchbase.so[7f13209ac000+74000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: traps: AppRefreshConsumer[12618] general protection ip:561db183e317 sp:7fff4e8698f0 error:0
Oct  4 10:32:59 dv-wb01 kernel: in php[561db1538000+475000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: traps: AppRefreshConsumer[12606] general protection ip:561db183e317 sp:7fff4e8698f0 error:0
Oct  4 10:32:59 dv-wb01 kernel: in php[561db1538000+475000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: in php[561db1538000+475000]
Oct  4 10:32:59 dv-wb01 kernel:
Oct  4 10:32:59 dv-wb01 kernel: AppRefreshConsumer[12335]: segfault at d15 ip 00007f1320a000d7 sp 00007fff4e86a5d0 error 4 in couchbase.so[7f13209ac000+74000]

Do you have a core file by chance? You may need to set ulimit to get a core through ulimit -c unlimited. If you have one, it’d be great to file an issue including the specific versions you’re using and attach the core on the issue tracker. Please also include a description of what you were doing in the PHP code.

It’s important for us to know the versions and the platform you’re using so we can resolve the symbols. You’ll note that above, it gives just the address for the function, not the name.

If you want to try to debug it yourself, generally you’d get the stack trace from gdb or the like, and in many cases it’ll show you where something has gone wrong. Depending on the complexity of the issue, if it’s easy to reproduce sometimes you’ll find the specific issue with other tools like valgrind. I’d always start with looking at a stacktrace and the code around there first though, then just go for the bigger tools when needed.

Thanks for your answer,

Unfortunately, I have no experience doing any OS debug, but, I can install/configure anything that may help.

I am running (Centos 7) Linux 3.10.0-1127.19.1.el7.x86_64

rpm -qa | grep couchbase
libcouchbase3-tools-3.0.4-1.el7.x86_64
libcouchbase3-3.0.4-1.el7.x86_64
libcouchbase-devel-3.0.4-1.el7.x86_64

PHP 7.4.9 (cli) (built: Aug 4 2020 08:28:13) ( NTS )

I am not sure how I can trigger the segfault, but I can install the necessary tools to capture this.

Please let me know if I can help with anything

Your libcouchbase version is just one release behind, so that’s pretty good. I don’t know your Couchbase PHP extension version, but if you can please make sure it’s up to date.

Then, if you can, please change the ulimit as indicated above so you’ll get a core file if it happens again. Then, next time, you can install gdb and us it to get a backtrace. There are lots of tutorials on the Internet for this, but I can describe the basics if you hit it again.

Was this triggered with pure PHP code, or was there some other code involved?

Yes, still happening

It looks like your reply was to a bot, as it was updated with a spammy link.

On the issue itself, were you able to get a core file and was it triggered with pure PHP code?