Os x segfault running example simulation

Hello!

I was trying to run the example simulation using the latest Gatling bundle (gatling-charts-highcharts-bundle-3.9.0) on OS X Catalina and encountered a segfault in libnetty.

Some more detail:

gatling-charts-highcharts-bundle-3.9.0 $ bin/gatling.sh

GATLING_HOME is set to /opt/gatling/gatling-charts-highcharts-bundle-3.9.0

Do you want to run the simulation locally, on Gatling Enterprise, or just package it?

Type the number corresponding to your choice and press enter

[0]

[1] Run the Simulation locally

[2] Package and upload the Simulation to Gatling Enterprise Cloud, and run it there

[3] Package the Simulation for Gatling Enterprise

[4] Show help and exit

1

computerdatabase.ComputerDatabaseSimulation is the only simulation, executing it.

Select run description (optional)

none

#

# A fatal error has been detected by the Java Runtime Environment:

#

# SIGSEGV (0xb) at pc=0x000000013cb28fe2, pid=37732, tid=5635

#

# JRE version: OpenJDK Runtime Environment (11.0.2+9) (build 11.0.2+9)

# Java VM: OpenJDK 64-Bit Server VM (11.0.2+9, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)

# Problematic frame:

# C [libnetty_tcnative_osx_x86_6415937797279062715942.dylib+0x171fe2] __isPlatformOrVariantPlatformVersionAtLeast.cold.1+0x152

#

# No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again

#

# An error report file with more information is saved as:

# /opt/gatling/gatling-charts-highcharts-bundle-3.9.0/hs_err_pid37732.log

#

# If you would like to submit a bug report, please visit:

# Crash Report

# The crash happened outside the Java Virtual Machine in native code.

# See problematic frame for where to report the bug.

#

Thanks,
Phil

Hi,

Pretty sure this is a JVM bug.
Your Java version is pretty old (11.0.2, 2 years ago), and more importantly, it’s one of the earliest releases of Java 11. Those were pretty buggy.

If you want to stick to Java 11, you should upgrade to 11.0.17: Java Download | Java 7, Java 8, Java 11, Java 13, Java 15, Java 17, Java 19 - Linux, Windows & macOS

Or upgrade to Java 17.

Thanks for the response and suggestion. No joy with either 11.0.17 or 17.0.5. Appears to be the same SIGSEGV.

gatling-charts-highcharts-bundle-3.9.0 $ bin/gatling.sh

GATLING_HOME is set to /opt/gatling/gatling-charts-highcharts-bundle-3.9.0

Do you want to run the simulation locally, on Gatling Enterprise, or just package it?

Type the number corresponding to your choice and press enter

[0]

[1] Run the Simulation locally

[2] Package and upload the Simulation to Gatling Enterprise Cloud, and run it there

[3] Package the Simulation for Gatling Enterprise

[4] Show help and exit

1

computerdatabase.ComputerDatabaseSimulation is the only simulation, executing it.

Select run description (optional)

none

#

# A fatal error has been detected by the Java Runtime Environment:

#

# SIGSEGV (0xb) at pc=0x000000010a646fe2, pid=1467, tid=10243

#

# JRE version: Java™ SE Runtime Environment (17.0.5+9) (build 17.0.5+9-LTS-191)

# Java VM: Java HotSpot™ 64-Bit Server VM (17.0.5+9-LTS-191, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)

# Problematic frame:

# C [libnetty_tcnative_osx_x86_646962911747011302131.dylib+0x171fe2] __isPlatformOrVariantPlatformVersionAtLeast.cold.1+0x152

You’re running on a Mac with an x86 processor, right? Not the new M1 or M2?

That’s right. 8-core Intel Core i9.

Do you compile and run other Java projects?

Can you try to create, compile and run Hellow World as describe here
https://introcs.cs.princeton.edu/java/11hello/

First, please understand that AFAIK this only happens on your computer. I also have an Intel Mac with no issue, and no one else has complained about this.

Then, the crash happens in a netty native library accessed with JNI. There’s nothing we’ll be able to do about it.

Here’s what I suggest:

  1. Make sure you have the proper libraries versions

All netty modules should be 4.1.86.Final.
All netty-tcnative modules should be 2.0.54.Final.

Make sure you have a fresh copy of gatling-charts-highcharts-bundle and haven’t merged with a different version, resulting in multiple versions of the same libraries in the lib directory.

  1. Try upgrading netty tcnative modules

The latest version is 2.0.56.Final. You can download them from maven central: Central Repository: io/netty/netty-tcnative-boringssl-static/2.0.56.Final

  • Make sure to upgrade all of them.
  • Make sure to remove the old ones
  1. Report an issue to the netty project

As explained above, this crash happens in code we don’t own, and honestly don’t have the skills to contribute to this specific piece of code.
Please open an issue directly there: Issues · netty/netty · GitHub

Make sure to provide them with all the necessary informations, in particular:

  • your MacOS version
  • your processor kind
  • your Java exact version
  • the netty version: 4.1.86.Final
  • the netty-tcnative version: 2.0.54.Final
  • the above segfault stack

I’d rather have you directly open the issue there to streamline communication between netty maintainers and you, in particular if they need extra information.

  1. Disable openssl

This is a last resort workaround. It would be great the fix the root cause instead.

In gatling.conf, you can disable the usage of this native library and use Java’s SSLEngine, see gatling/gatling-defaults.conf at main · gatling/gatling · GitHub

Thanks for the suggestions!

I was able to resolve by removing netty-tcnative-classes-2.0.54.Final.jar from the gatling-charts-highcharts-bundle-3.9.0/lib directory.

I tried this once I observed a successful simulation after upgrading to the 2.0.56.Final versions and noting that neither of the 2.0.54.Final and 2.0.56.Final artifact listings include that particular file.

For IDE usage I added an exclusion and observed success there as well:

            <dependency>
                <groupId>io.gatling.highcharts</groupId>
                <artifactId>gatling-charts-highcharts</artifactId>
                <version>${gatling.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>io.netty</groupId>
                        <artifactId>netty-tcnative-classes</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

Thanks again for the suggestions. Off to the races!

I was able to resolve by removing netty-tcnative-classes-2.0.54.Final.jar from the gatling-charts-highcharts-bundle-3.9.0/lib directory.

Nah, what you’ve done is actually disabling the feature to use the more performance SSLEngine (classes are not available, falling back to Java’s SSLEngine instead).

noting that neither of the 2.0.54.Final and 2.0.56.Final artifact listings include that particular file.

It’s a different maven artifact, so it’s in a different directory on the repository: Central Repository: io/netty/netty-tcnative-classes/2.0.56.Final

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.