Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 278 by [email protected]: Memcached 1.4.13 segfaults (error 4) when SASL enabled
http://code.google.com/p/memcached/issues/detail?id=278

What steps will reproduce the problem?
1.  Build the memcached code with the --enable-sasl switch to enable SSL
2. Start memcached with SASL enabled (memcached -d -u nobody -m 1024 -p 11211 -S) 3. Make a call to memcached using spymemcached client to do a set operation via a java class). After running the java class a couple times, the memcached process on the server will crash.
4.  A segfault error will be present in /var/log/messages file.

What is the expected output? What do you see instead?
Here is the output when the java class runs successfully:
2012-06-25 15:15:02.007 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=/<IP_ADDRESS>:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue 2012-06-25 15:15:02.038 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@1e157985 2012-06-25 15:15:02.147 INFO net.spy.memcached.auth.AuthThread: Authenticated to /<IP_ADDRESS>:11211
About to set(<VALUE>)
DONE!!


Here is the output when the java class runs unsuccessfully:
2012-06-25 15:13:24.074 INFO net.spy.memcached.MemcachedConnection: Added {QA sa=/<IP_ADDRESS>:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue 2012-06-25 15:13:24.074 INFO net.spy.memcached.MemcachedConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@13dd1a31
About to set(<VALUE>)
2012-06-25 15:13:24.308 WARN net.spy.memcached.auth.AuthThread: Authentication failed to /<IP_ADDRESS>:11211 2012-06-25 15:13:24.324 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Discarding partially completed op: SASL steps operation 2012-06-25 15:13:24.324 INFO net.spy.memcached.MemcachedConnection: Reconnecting due to exception on {QA sa=/<IP_ADDRESS>:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=1}
java.io.IOException: Disconnected unexpected, will reconnect.
at net.spy.memcached.MemcachedConnection.handleReads(MemcachedConnection.java:452) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:380) at net.spy.memcached.MemcachedConnection.handleIO(MemcachedConnection.java:242)
        at 
net.spy.memcached.MemcachedConnection.run(MemcachedConnection.java:833)
2012-06-25 15:13:24.324 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening {QA sa=/<IP_ADDRESS>:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=1}, attempt 0. 2012-06-25 15:13:24.433 WARN net.spy.memcached.auth.AuthThread: Authentication failed to /<IP_ADDRESS>:11211
2012-06-25 15:13:25.197 DONE!!
WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Operation canceled because authentication or reconnection and authentication has taken more than one second to complete.

What version of the product are you using? On what operating system?
memcached 1.4.13. The operating system is Linux 2.6.18-194.11.1.0.1.el5 x86_64 GNU/Linux.

Please provide any additional information below.

The messages in the log will look something like this:
Jun 25 14:56:08 b57734e849 kernel: memcached[5556]: segfault at 0000000000000010 rip 0000003abc80eea8 rsp 00000000428e4ed0 error 4 Jun 25 15:01:02 b57734e849 kernel: memcached[5737]: segfault at 0000000000000010 rip 0000003abc80eea8 rsp 0000000044598ed0 error 4 Jun 25 15:13:23 b57734e849 kernel: memcached[6174]: segfault at 0000000000000010 rip 0000003abc80eea8 rsp 00000000428cbed0 error 4 Jun 25 15:13:49 b57734e849 kernel: memcached[6199]: segfault at 0000000000000010 rip 0000003abc80eea8 rsp 0000000040f81ed0 error 4 Jun 25 15:14:13 b57734e849 kernel: memcached[6228]: segfault at 0000000000000010 rip 0000003abc80eea8 rsp 0000000040bd4ed0 error 4 Jun 25 15:14:19 b57734e849 kernel: memcached[6237]: segfault at 0000000000000010 rip 0000003abc80eea8 rsp 0000000042610ed0 error 4

Here is how the MemcacheClient object is configured:

MemcachedClient memcachedClient = new MemcachedClient(new ConnectionFactoryBuilder()
                                        .setProtocol(Protocol.BINARY)
                                        .setTranscoder(new 
SerializingTranscoder(1024))
                                        .setOpTimeout(100)
                                        .setTimeoutExceptionThreshold(1998)
                                        
.setHashAlg(DefaultHashAlgorithm.KETAMA_HASH)
                                        .setLocatorType(Locator.CONSISTENT)
                                        
.setFailureMode(FailureMode.Redistribute)
                                        .setUseNagleAlgorithm(false)
                        //  USE SASL
                                        .setAuthDescriptor(new AuthDescriptor(new 
String[]{"PLAIN"},
                                                new PlainCallbackHandler("memcached", 
"memcached")))

                                        .build(),
                                        
AddrUtil.getAddresses("<IP_ADDRESS>:11211"));



Reply via email to