apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
7.94k stars 2.01k forks source link

in building JMeter source meet EXCEPTION_STACK_OVERFLOW (Execution failed for task ':src:dist:runGui'.)) #6262

Closed ibingdian closed 3 weeks ago

ibingdian commented 1 month ago

Steps to reproduce the problem

the jmeter source get by git,the jmeter version is lastest.

when execute ./gradlew.bat runGui meet EXCEPTION_STACK_OVERFLOW .

how to fix the problem? i modify DEFAULT_JVM_OPTS in gradlew.bat ,but it not work. what the jvm_args should set to?

Getting Build Failed with exception while building using ./gradlew.bat runGui:

PS D:\xxx\jmeter> ./gradlew.bat runGui
Type-safe project accessors is an incubating feature.

Configure project : Building JMeter 6.0.0-SNAPSHOT

Configure project :src:components RenderInBrowser is excluded from compilation. If you want to compile it, add -PenableJavaFx

Configure project :src:dist-check Certain tests will be skipped as they depend on external services and fail too often. Please add -PenableFlaky to enable them: [batchHttp4ImplDigestAuth, batchHttp4ImplPreemptiveBasicAuthJava, batchHttp4ImplPreemptiveBasicAuth, batc hSlowCharsFeatureHttpClient4, batchSlowCharsFeatureJava, batchTCP_TESTS, batchTestKeepAlive, batchTestRedirectionPolicies, batchJDBC_TESTS, batchResponseDecompression]

Task :src:dist:runGui WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release WARN StatusConsoleListener The use of package scanning to locate plugins is deprecated and will be removed in a future release

Don't use GUI mode for load testing !, only for Test creation and Test debugging. For load testing, use CLI Mode (was NON GUI): jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder] & increase Java Heap to meet your test requirements: Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file Check : https://jmeter.apache.org/usermanual/best-practices.html

An unrecoverable stack overflow has occurred.

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

EXCEPTION_STACK_OVERFLOW (0xc00000fd) at pc=0x00007ff89b91c5b7, pid=17424, tid=15452

JRE version: Java(TM) SE Runtime Environment (17.0.10+11) (build 17.0.10+11-LTS-240) Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.10+11-LTS-240, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) Problematic frame: C [awt.dll+0xec5b7]

No core dump will be written. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as: D:\2024\source\jmeter\bin\hs_err_pid17424.log

If you would like to submit a bug report, please visit: https://bugreport.java.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug.

Task :src:dist:runGui FAILED checksum-dependency elapsed time: 2340ms, configurations processed: 69 (add -PchecksumTimingsPrint to print detailed timings) checksum-dependency elapsed time: 2623ms, configurations processed: 219 (add -PchecksumTimingsPrint to print detailed timings)

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 13s 161 actionable tasks: 18 executed, 143 up-to-date

JMeter Version

JMeter 6.0.0-SNAPSHOT

Java Version

17

kotlin Version

1.9.20

gradle Version

8.5

OS Version

windows

ibingdian commented 1 month ago

hs_err_pid17424.log

vlsi commented 1 month ago

Have you tried increasing -Xss here: https://github.com/apache/jmeter/blob/09c3f810dda7efaf1510ac062454d978d90a0741/src/dist/build.gradle.kts#L643 ?

It says there was "free space=243k" in stack, however, it is hard to tell what is wrong here. Have you tried Java 21 or a Java from a different vendor?

ibingdian commented 3 weeks ago

1. i modify jvmArgs("-Xss512k") in jmeter/src/dist/build.gradle.kts, but hava the same problem as above, …… An error report file with more information is saved as: D:\xxx\jmeter\bin\hs_err_pid20116.log ……

2. i change the jdk to Java 21(21.0.2), i meet the problem as below, It seems that I can only use java 17 ? :

10:17:08: Executing 'runGui'...

Starting Gradle Daemon... Gradle Daemon started in 2 s 495 ms Type-safe project accessors is an incubating feature.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

BUILD FAILED in 28s 10:17:40: Execution finished 'runGui'.

the java version as below: C:\Users\Administrator>java -version java version "21.0.2" 2024-01-16 LTS Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58) Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

the jdk download link i used is : https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.zip https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.zip the os is Windows 10 the idea is IntelliJ IDEA 2023.3.6

ibingdian commented 3 weeks ago

hs_err_pid20116.log

vlsi commented 3 weeks ago

I forgot that Java version should be configured with parameters (see ./gradlew parameters)

For instance:

./gradlew runGui -PjdkTestVersion=21
vlsi commented 3 weeks ago

It looks you hit https://bugs.openjdk.org/browse/JDK-8277299 here, so going with Java 21 or increasing the stack size from 256k to 1m would likely resolve the issue.

ibingdian commented 3 weeks ago

Thank you for answering my question.

1. in java 17, i set the stack size from 256k to 1m is ok, and after execute ./gradlew.bat runGui , the jmeter can open.

2. in java 21 , execute ./gradlew.bat runGui -PjdkTestVersion=21, hava error as below:

D:\xxx\jmeter> ./gradlew.bat runGui -PjdkTestVersion=21 Type-safe project accessors is an incubating feature.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

BUILD FAILED in 2s

ibingdian commented 3 weeks ago

i hava another question : jmeter freeze when open a jmx with a Big request param. in the jmx, i have a httpsample , and it's request param is a big json ,about 600k, when load the file ,the jmeter hangs up. how to solve the problem.

I don't want to use CSV to deliver the request param.

jmx_slow.zip

vlsi commented 3 weeks ago

{languageVersion=17, vendor=any, implementation=vendor-specific} for WINDOWS on x86_64. No locally installed toolchains match and toolchain download repositories have not been configured.

That means Gradle can't detect Java 17 on your machine. By default JMeter uses Java 17 for the build, and you could use ./gradlew -PjdkBuildVersion=21 -PjdkTestVersion=21 runGui to use 21 for both build and test.

ibingdian commented 3 weeks ago

in jdk 21, i try ./gradlew.bat -PjdkBuildVersion=21 -PjdkTestVersion=21 runGui , but some error happen as front: jdk21

ibingdian commented 3 weeks ago

when use ./gradlew.bat runGui , how to pass a jmx file path?

vlsi commented 3 weeks ago

"jmeter freeze" is caused by https://github.com/bobbylight/RSyntaxTextArea/issues/41:

A workaround is to disable line wrapping (see jsyntaxtextarea.linewrap in jmeter.properties)

"AWT-EventQueue-0" #36 [67591] prio=6 os_prio=31 cpu=155639,07ms elapsed=209,99s tid=0x000000013be47c00 nid=67591 runnable  [0x000000016ecdd000]
   java.lang.Thread.State: RUNNABLE
    at org.fife.ui.rsyntaxtextarea.TokenImpl.getWidthUpTo(TokenImpl.java:601)
    at org.fife.ui.rsyntaxtextarea.TokenUtils.getSubTokenList(TokenUtils.java:132)
    at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView$WrappedLine.calculateLineCount(WrappedSyntaxView.java:1188)
    at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView$WrappedLine.handleDocumentEvent(WrappedSyntaxView.java:1439)
    at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView$WrappedLine.insertUpdate(WrappedSyntaxView.java:1463)
    at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView.insertUpdate(WrappedSyntaxView.java:706)
    at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(java.desktop@21.0.2/BasicTextUI.java:1711)
    at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(java.desktop@21.0.2/BasicTextUI.java:1978)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(java.desktop@21.0.2/AbstractDocument.java:227)
    at org.fife.ui.rsyntaxtextarea.RSyntaxDocument.fireInsertUpdate(RSyntaxDocument.java:187)
    at javax.swing.text.AbstractDocument.handleInsertString(java.desktop@21.0.2/AbstractDocument.java:781)
    at javax.swing.text.AbstractDocument.insertString(java.desktop@21.0.2/AbstractDocument.java:740)
    at javax.swing.text.PlainDocument.insertString(java.desktop@21.0.2/PlainDocument.java:131)
    at javax.swing.text.AbstractDocument.replace(java.desktop@21.0.2/AbstractDocument.java:699)
    at javax.swing.text.JTextComponent.setText(java.desktop@21.0.2/JTextComponent.java:1725)
    at org.apache.jmeter.gui.util.JSyntaxTextArea.setInitialText(JSyntaxTextArea.java:305)
    at org.apache.jmeter.protocol.http.config.gui.UrlConfigGui.configure(UrlConfigGui.java:291)
    at org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui.configure(HttpTestSampleGui.java:134)
    at org.apache.jmeter.gui.tree.JMeterTreeModel.addComponent(JMeterTreeModel.java:162)
    at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:131)
    at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:131)
    at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:123)
    at org.apache.jmeter.gui.GuiPackage.addSubTree(GuiPackage.java:555)
    at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:201)
    at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:132)
    at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:103)
    at org.apache.jmeter.gui.action.Load.doActionAfterCheck(Load.java:90)
    at org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest.doAction(AbstractActionWithNoRunningTest.java:44)
    at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:83)
    at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:65)
    at org.apache.jmeter.gui.action.ActionRouter$$Lambda/0x000000e0015201f8.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(java.desktop@21.0.2/InvocationEvent.java:318)
vlsi commented 3 weeks ago

in jdk 21, i try ./gradlew.bat -PjdkBuildVersion=21 -PjdkTestVersion=21 runGui , but some error happen as front: https://github.com/apache/jmeter/issues/6262#issuecomment-2029438219

It looks like the build requires Java 17 anyway, so you need to have both Java 17 and 21. See https://docs.gradle.org/current/userguide/toolchains.html regarding the automatic toolchain search and download.

ibingdian commented 3 weeks ago

https://github.com/apache/jmeter/issues/6262#issuecomment-2029446617

i primary want to debug Jmeter source with a jmx file, how to dubug in GUI mode with a given jmx file?

in org.apache.jmeter.JMeterTest, i see many runNonGui test case , is there any runGui test case ?

jmeter/src/core/test/JMeterTest

vlsi commented 3 weeks ago

how to dubug in GUI mode with a given jmx file?

Launch GUI in debug mode, in GUI click "file -> open" and so on.

ibingdian commented 3 weeks ago

thank you very much , i think There are probably no more questions about this issue