Memcached Crash / 4.5 / java sdk

Hi,

how are you all doing ?
when using couchbase 4.5 + the last version of the java sdk, I see crashes of the memcached daemon.

Looks like it is related to SCRAM, because when I disable it, using the -Dcom.couchbase.scramEnabled=false parameter, it works.

Step to reproduce:

  • Try to authenticate on a couchbase bucket that does not yet exist, or was just created.

  • Make sure it is using the new SASL authentication.

  • After the list of mechs have been exchanged, when the nonce is sent to the couchbase server, memcached core dumps immediately.

    2017-03-28 13:07:38 [cb-io-1-1] TRACE c.c.c.d.i.n.h.logging.LoggingHandler - [id: 0x02f39588, L:/192.168.99.162:63198 - R:couchbase.stg.ps/xx.xx.xx.xx:11210] WRITE: 36B
    ±------------------------------------------------+
    | 0 1 2 3 4 5 6 7 8 9 a b c d e f |
    ±-------±------------------------------------------------±---------------+
    |00000000| 80 22 00 0c 00 00 00 00 00 00 00 9c 00 00 00 00 |."…|
    |00000010| 00 00 00 00 00 00 00 00 53 43 52 41 4d 2d 53 48 |…SCRAM-SH|
    |00000020| 41 35 31 32 |A512 |
    ±-------±------------------------------------------------±---------------+
    2017-03-28 13:07:38 [cb-io-1-1] TRACE c.c.c.d.i.n.h.logging.LoggingHandler - [id: 0x02f39588, L:/192.168.99.162:63198 - R: couchbase.stg.ps/xx.xx.xx.xx:11210] WRITE: 144B
    ±------------------------------------------------+
    | 0 1 2 3 4 5 6 7 8 9 a b c d e f |
    ±-------±------------------------------------------------±---------------+
    |00000000| 63 3d 62 69 77 73 2c 72 3d 48 52 46 51 4c 48 56 |c=biws,r=HRFQLHV|
    |00000010| 49 69 45 59 79 6a 58 43 36 66 42 42 75 41 36 47 |IiEYyjXC6fBBuA6G|
    |00000020| 6d 35 67 76 55 39 33 61 35 38 33 38 38 32 39 37 |m5gvU93a58388297|
    |00000030| 35 32 66 35 36 2c 70 3d 6d 4d 44 6e 69 56 49 76 |52f56,p=mMDniVIv|
    |00000040| 35 4b 6d 73 77 49 45 41 78 38 48 6a 2f 67 34 70 |5KmswIEAx8Hj/g4p|
    |00000050| 4a 6a 2f 51 61 6f 38 4d 74 79 41 68 31 50 68 4b |Jj/Qao8MtyAh1PhK|
    |00000060| 62 79 68 6c 68 55 38 6c 4e 70 38 66 74 48 32 55 |byhlhU8lNp8ftH2U|
    |00000070| 6d 6e 37 30 33 33 35 38 7a 65 5a 6f 51 6d 57 41 |mn703358zeZoQmWA|
    |00000080| 42 65 62 66 51 38 58 74 6d 42 55 66 41 51 3d 3d |BebfQ8XtmBUfAQ==|
    ±-------±------------------------------------------------±---------------+

I can give core dumps and dmp files, on request.

Can anyone help me ?

Laurent

Hi Laurent,

First of all, thank you for your feedback!

Can you please send me the core dumps for the error you are hitting and exact repro steps?

Thank you and regards,
Don Pinto
Couchbase Server PM

Hello Laurent,

Please also confirm the OS platform you are using on the server and client side.

Thanks,
Don

Hi Don,

thank you for your help :wink:

As I said yesterday, trying to connect on bucket that does not exist, which SCRAM activated, is sufficient to crash memcached.
Therefore here is the steps:

  1. Try to connect on a bucket that does not exist (using SCRAM-512 authentication)
  2. Then, when AUTH is sent to the server by the java driver, memcached crashes.

Meanwhile, I have two kind of core dumps.

  1. The dmp core dump which is some KB
  2. The main big core dump which is 11 GB and contains some private information.

If you really need me to send you that core dumps, can you give me a private mail, instead of posting it on the forum.

Also, the backtrace is:

Also it was reproduced on:
CLIENT CONFIG:

Mac OS X 10.12.3 / Java 8 1.8.0_121-b13 / javalib: com.couchbase.client | java-client | 2.4.3
OR
Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 x86_64 GNU/Linux / javalib: com.couchbase.client | java-client | 2.4.3

SERVER CONFIG:

Linux 3.14.32-xxxx-grs-ipv6-64 #9 SMP Thu Oct 20 14:53:52 CEST 2016 x86_64 GNU/Linux
Kernel config: ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production//config-3.14.32-xxxx-grs-ipv6-64

Processor:

vendor_id	: GenuineIntel
cpu family	: 6
model		: 86
model name	: Intel(R) Xeon(R) CPU D-1520 @ 2.20GHz
stepping	: 2
microcode	: 0xa
cpu MHz		: 2521.578
cache size	: 6144 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 7
initial apicid	: 7
fpu		: yes
fpu_exception	: yes
cpuid level	: 20
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap
bogomips	: 4400.03
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

Is that sufficient for you ? Can you give me a mail if you need to analyse the core dumps ?

Best regards,
Laurent.

Hi,

Did you download a package built for your version of Debian, or are you
using one for a previous version of Debian. The reason I ask is because I
suspect it is crashing when I’m using some of the OpenSSL functions/macros
in there.

Cheers,

Trond

Hi trond,

I’m using the following package:

couchbase-server-community_4.5.0-debian8_amd64.deb

Best regards,
Laurent.