eclipse-rcptt / org.eclipse.rcptt

Eclipse Public License 2.0
6 stars 11 forks source link

exec-process fails with: error 13 permission denied since 2.5.5-M2 #73

Closed Mailaender closed 6 months ago

Mailaender commented 7 months ago

To reproduce, run the following ECL script

exec-process "date" | show-alert

which will work inside the IDE but fail in the runner:

 Cause: Cannot run program "date": error=13, permission denied

This does not happen when starting the test within the IDE. It also works fine with rcptt.runner-2.5.5-M0 and rcptt.runner-2.5.5-M1.

Mailaender commented 7 months ago

Diff of the runner logs. Changes since M1.

basilevs commented 7 months ago

What is the error? Steps to reproduce? Stacktrace? Attach AUT's log, if error happens in AUT. Have you tried on 2.5.5-M3? Try recreating AUT anew in IDE.

Mailaender commented 7 months ago

New workspace does not help. It also happens in M3 and it only happens using the runner. I believe it is some configuration flag that gives Java more permissions, but I haven't found it yet.

basilevs commented 7 months ago

Runner works fine on Linux and Windows in my projects (which start a lot of external processes), so this is not reproducible. I'm closing this until we have more information to work on.

basilevs commented 7 months ago

BTW, in the attached runner log I see a failure to discover AUT's JRE. This should be fixed in M3. Also, the log is terminated before the AUT has started. Are you sure you've attached the appropriate log?

Mailaender commented 7 months ago

To reproduce, run the following ECL script

exec-process "date" | show-alert

which will work inside the IDE but fail in the runner:

Cause: Cannot run program "date": error=13, permission denied

Mailaender commented 7 months ago

I used your runner.sh as a template:

#*******************************************************************************
# Copyright (c) Xored Inc.
#
# All rights reserved.
#
#
# Contributors:
# Matthias Mailänder, Lablicate GmbH
#*******************************************************************************/

#! /bin/sh

runnerPath=./rcptt.runner-2.5.5/eclipse
project=../../../
autPath=./openchrom.demo-1.0.x

testResults=$project/../results/demo/$tests
runnerWorkspace=$testResults/runner-workspace
autWorkspace=$testResults/aut-workspace-
autOut=$testResults/aut-out-
autArgs="-eclipse.password;$(pwd)/master"
javaVM=$JAVA_HOME
junitReport=$testResults/results.xml
htmlReport=$testResults/results.html

rm -rf $testResults
mkdir -p $testResults

java -jar $runnerPath/plugins/org.eclipse.equinox.launcher_*.jar \
     -application org.eclipse.rcptt.runner.headless \
     -data $runnerWorkspace \
     -aut $autPath \
     -autArgs ${autArgs} \
     -autWsPrefix $autWorkspace \
     -autConsolePrefix $autOut \
     -autVM $javaVM \
     -htmlReport $htmlReport \
     -junitReport $junitReport \
     -import $project \
     -tests StartDate.test
basilevs commented 7 months ago

What is the Java version? Could you try to reproduce on Eclipse Platform as AUT?

Mailaender commented 7 months ago

I use /usr/lib/jvm/java-17-temurin both as system and bundled with the application.

Mailaender commented 7 months ago

It runs fine using https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-java-2024-03-R-linux-gtk-x86_64.tar.gz&mirror_id=1285 as AUT.

Mailaender commented 7 months ago

Skimming through the code I noticed this

https://github.com/eclipse/org.eclipse.rcptt/blob/b51d48801138eb299516faa49bc7faf4f0e3d495/launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/launching/ext/Q7ExternalLaunchDelegate.java#L606-L616

basilevs commented 7 months ago

As in runner.log I see a symptom that was supposed to be fixed in M3, could you please attach M3 runner log, which reproduces the problem?

Mailaender commented 7 months ago

Updated https://gist.github.com/Mailaender/a607110ec92674bb204b5ad9e2b03533#file-rcptt-log

progress: Resolving null

looks fishy

basilevs commented 6 months ago

I've downloaded OpenChrom and failed to reproduce the problem as described. I get permission denied errors in Runner (and not in AUT) due to invalid permissions of OpenChrom's embedded JRE:

vasiligulevich@Vasilis-MacBook-Pro exec-process %  /private/tmp/Eclipse.app/Contents/Eclipse/features/net.openchrom.jre.macosx.cocoa.aarch64.feature_17.0.11/jre/jdk-17.0.11+9-jre/Contents/Home/bin/java 
zsh: permission denied: /private/tmp/Eclipse.app/Contents/Eclipse/features/net.openchrom.jre.macosx.cocoa.aarch64.feature_17.0.11/jre/jdk-17.0.11+9-jre/Contents/Home/bin/java

exec-process works fine if a proper JRE is forced via Runner's arguments.

@Mailaender please fix your AUT and retry.

basilevs commented 6 months ago

I've struggled on MacOS due to spurious errors caused by invalid detection of AUT's JVM, so fixed that in #75.

basilevs commented 6 months ago

@Mailaender have you managed to fix the problem?

Mailaender commented 6 months ago

Not yet :(

basilevs commented 6 months ago

Please update me once AUT has correct permissions for embedded JRE.

Mailaender commented 6 months ago

Seems to be a problem with the .dmg repackaging.

Mailaender commented 6 months ago

On Linux I see another long-standing RCPTT bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=515501

Unknown file system layout of Java VM from ini file

Not sure if that is related.

basilevs commented 6 months ago

On Linux I see another long-standing RCPTT bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=515501

Try #75

Mailaender commented 6 months ago

Please update me once AUT has correct permissions for embedded JRE.

https://share.lablicate.com/index.php/s/A8pzgQHAfZa7gfK

basilevs commented 6 months ago

https://share.lablicate.com/index.php/s/A8pzgQHAfZa7gfK

Yep, still can't reproduce. Attaching a sample project and a runner startup script. The runner was downloaded from PR.

exec-process.zip

The archive also includes runner's console output. At least auto-detection of JRE via shared library on MacOS is fixed.

Mailaender commented 6 months ago

Using https://www.eclipse.org/downloads/download.php?file=/rcptt/nightly/2.5.5/202405081020/runner/rcptt.runner-2.5.5-N202405081020.zip I can confirm that this issue is gone. The error message

Unknown file system layout of Java VM from ini file

is no longer displayed. I think you fixed it and I guess it was https://github.com/eclipse/org.eclipse.rcptt/pull/75.

basilevs commented 6 months ago

I have no further ideas how to diagnose exec-process problem. Have you tried scripts from my archive above?

Mailaender commented 6 months ago

You already fixed it in the latest nightly.