[libjvm.so+0x977f94] Unsafe_GetObject+0xc4 with gatling stable version

Hi guys,

I am working on a cometd gatling extension and I have couple of unit tests using akka and mockito.
After changing gatling version from 2.0.0-RC6 to 2.0.1 I was given the message below from one of my unit tests.
I am using 1.7.0_72-b14 on linux mint 17 (ubuntu)
Everything was fine using any of the previous release candidate versions.

Any idea, suggestion?
Thanks,
Krisztian

22:10:50.802 [GatlingSystem-akka.actor.default-dispatcher-2] INFO i.g.c.r.writer.ConsoleDataWriter - Initializing
22:10:50.799 [GatlingSystem-akka.actor.default-dispatcher-3] INFO i.g.c.result.writer.FileDataWriter - Initializing
22:10:50.818 [GatlingSystem-akka.actor.default-dispatcher-2] INFO i.g.c.r.writer.ConsoleDataWriter - Initialized

You somehow managed to mock Strings, but there’s places where we perform unsafe operations with them.

I’m betting on https://github.com/lachatak/gatling-cometd/blob/master/http-cometd/src/test/scala/org/kaloz/gatling/http/action/cometd/CometDActorITest.scala#L49, that really looks like mock abuse (case class mocking, really???).

Good catch.
I am going to look into it.

Thx,

k

Hi,

I am still straggling with my test (V [libjvm.so+0x977f94] Unsafe_GetObject+0xc4). I replaced the mock with a real case class as you pointed out but I am not closer to the solution.
I was curious how are you testing your websocket actor and I found that the WebSocketActorSpec is commented out in 2.0.1. What is the reason for this?

https://github.com/gatling/gatling/blob/master/gatling-http/src/test/scala/io/gatling/http/action/WebSocketActorSpec.scala#L89

I am interested in this test as I would like to have a pull request later for supporting eventStream publishing from the OnTextMessage in the WebsocketActor so I will need it in the future anyway.

Thank you for any further help.
Krisztian

That’s not very complicated to fix :slight_smile:

You’re still passing some null references to writeRequestData, causing a null pointer in Unsafe (nothing more than C code).
This probably happens because you’re still mocking some case classes where you forgot to mock some accessors. I suspect WsTx.requestName.

Best fix is to stop mocking case classes.

PR sent (lazy/busy mode, fixed the symptom and not the cause).

Really thx Stephane!
It is working.

k

You’re very welcome :slight_smile: