szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
212 stars 57 forks source link

Error in version 1.4.0 with Gradle 4.10 #221

Closed armeris closed 3 years ago

armeris commented 4 years ago

Hi,

I'm getting this error when launching pitest with gradle and I cannot find any solution. The execution never ends and the output looks like a bug:

13:02:18 PIT >> FINE : Maximum available memory is 736 mb
13:02:20 PIT >> FINE : MINION : Installing PIT agent

13:02:21 PIT >> INFO : MINION : Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 190
Exception Details:
  Location:
    org/pitest/coverage/execute/CoverageMinion.ma
13:02:21 PIT >> INFO : MINION : in([Ljava/lang/String;)V @11: aload_0
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: b800 1db2 0023 4c01 4d01 4e2a 0332 b800
    0x0000010: 2936 04bb 002b 5912 2d15 04b7 0030 4dbb
    0x0000020: 0032 592c b600 36b7 0039 
13:02:21 PIT >> INFO : MINION : 3a05 1905 123b
    0x0000030: b600 3fc0 003b 3a06 1906 b600 43b8 0049
    0x0000040: bb00 4b59 bb00 4d59 2cb6 0051 b700 54b7
    0x0000050: 0055 4e2d b800 5bbb 005d 5919 06b6 0061
    0x0000060: b800 65b7 0068 b800 6e19 0519 06b8 0072
    0x0000070: 3a07 b
13:02:21 PIT >> INFO : MINION : 200 74bb 0076 59b7 0077 1907 b900
    0x0000080: 7d01 00b6 0081 1283 b600 86b6 008a b600
    0x0000090: 90bb 0092 592d 1907 b700 953a 0819 08b6
    0x00000a0: 0098 2dc6 0008 2d2b b600 9c2c c600 072c
    0x00000b0: b600 9fa7 0093 3a04 1904 b800 a5bf 3a04

13:02:21 PIT >> INFO : MINION :   0x00000c0: b200 74b2 00ab 1904 b600 aeb6 00b2 b200
    0x00000d0: b54c 2dc6 0008 2d2b b600 9c2c c600 072c
    0x00000e0: b600 9fa7 0063 3a04 1904 b800 a5bf 3a04
    0x00000f0: 1904 b200 bbb6 00bf b200 74b2 00ab 12c1
    0x0000100: 1904 b600 c4b2 00c7 4c2
13:02:21 PIT >> INFO : MINION : d c600 082d 2bb6
    0x0000110: 009c 2cc6 0007 2cb6 009f a700 2c3a 0419
    0x0000120: 04b8 00a5 bf3a 092d c600 082d 2bb6 009c
    0x0000130: 2cc6 0007 2cb6 009f a700 0b3a 0a19 0ab8
    0x0000140: 00a5 bf19 09bf 2bb6 00ca b800 ceb1     
  Exception Handler
13:02:21 PIT >> INFO : MINION :  Table:
    bci [171, 179] => handler: 182
    bci [11, 162] => handler: 190
    bci [219, 227] => handler: 230
    bci [11, 162] => handler: 238
    bci [274, 282] => handler: 285
    bci [11, 162] => handler: 293
    bci [190, 210] => handler: 293
    bc
13:02:21 PIT >> INFO : MINION : i [238, 265] => handler: 293
    bci [304, 312] => handler: 315
    bci [293, 295] => handler: 293

        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRe
13:02:21 PIT >> INFO : MINION : cursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelp
13:02:21 PIT >> INFO : MINION : er.java:526)
szpak commented 3 years ago

What Java and PIT versions do you use?

Do you have a simple project to reproduce the issue?

szpak commented 3 years ago

@armeris do you still have that problem?

armeris commented 3 years ago

Yes, I'm still having the same problem. I'm using JDK 1.8.0-171 What do you mean with PIT?

szpak commented 3 years ago

Do you - by any chance - use any extra instrumentalization tool in your project (which may affect generated .class files)?

szpak commented 3 years ago

PIT - pitest version (if you override the default one). I've just realized that you probably use gradle-pitest-plugin 1.4.0 which by default uses PIT 1.4.3 which is very old - May 1, 2018. Please update GPP to the latest version and try again.

armeris commented 3 years ago

It is a Grails project (writeen in Groovy). Could this be the problem?

-- Rubén Salinas

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, August 4, 2020 11:02 AM, Marcin Zajączkowski notifications@github.com wrote:

Do you - by any chance - use any extra instrumentalization tool in your project (which may affect generated .class files)?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

szpak commented 3 years ago

Definitely. PIT doesn't support mutating production code written in Groovy (but testing Java production code with tests in Groovy with Spock is fine).

armeris commented 3 years ago

Okk, thanks for the help!

-- Rubén Salinas

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, August 4, 2020 11:08 AM, Marcin Zajączkowski notifications@github.com wrote:

Definitely. PIT doesn't support mutating production code written in Groovy (but testing Java production code with tests in Groovy with Spock is fine).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.