Cassandra crashes java (segmentation fault)

We are using Cassandra on our Ubuntu servers and when starting 1.1.4 or 1.1.5 we have an issue where the Java interpreter crashes with a segmentation fault.

The problem is that it tries to start javaagent and that makes use of more stack than is allocated by Cassandra to the java engine. The result is a hard crash with a segmentation fault from the OpenJDK environment.

The bug is described in this issue: Cassandra crashes with segmentation fault on Debian 5.0 and Ubuntu 10.10

To fix the problem I had to edit the conf/cassandra-env.sh and replace the 180 by 256 on line 188. (It should say something like: JVM_OPTS="$JVM_OPTS -Xss256k")

I suppose that the stack limit could also be removed from the command line, but they use it to limit the stack size used by Thrift so it's probably a good idea to keep it somewhat limited.

if [ "`uname`" = "Linux" ] ; then
    # reduce the per-thread stack size to minimize the impact of Thrift
    # thread-per-client.  (Best practice is for client connections to
    # be pooled anyway.) Only do so on Linux where it is known to be
    # supported.
    # u34 and greater need 180k
    JVM_OPTS="$JVM_OPTS -Xss256k"
fi

 

Comments

Replied

Re: Cassandra crashes java (segmentation fault)

Thanks! Valid advice for 1.2.8 as well...

 

Replied

Re: Cassandra crashes java (segmentation fault)

Thank you very very very much..solved my problem and saved lot of time.

Replied

Re: Cassandra crashes java (segmentation fault)

Thanx for the help..!!

Replied

Re: Cassandra crashes java (segmentation fault)

you saved my life!!!...thank you.

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly