PhoenicisOrg / scripts

Phoenicis scripts
GNU Lesser General Public License v3.0
64 stars 49 forks source link

vcrun6sp6 crash #1162

Closed Zemogiter closed 4 years ago

Zemogiter commented 4 years ago

When attempting to remove stdole2.dll file the verb crashes

Extracting to: /home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/vcrun6sp6/
Extracting cabinet: /home/jonasz/.Phoenicis/resources///Vs6sp6.exe
  extracting vcredist.exe

All done, no errors.
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/stdole2.dll" does not exist
    at org.phoenicis.tools.files.FileUtilities.remove(FileUtilities.java:165)
    at <js> remove(Unnamed:101:2143-2172)
    at <js> go(Unnamed:38:1348-1389)
    at <js> install(Unnamed:52:1766-1789)
    at org.graalvm.polyglot.Value.invokeMember(Value.java:459)
    at org.phoenicis.engines.VerbsManager.lambda$installVerb$0(VerbsManager.java:71)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by host exception: java.lang.IllegalArgumentException: Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/stdole2.dll" does not exist

[WARNING] 
org.graalvm.polyglot.PolyglotException: Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/stdole2.dll" does not exist
    at org.phoenicis.tools.files.FileUtilities.remove (FileUtilities.java:165)
    at <js>.remove (Unnamed:101)
    at <js>.go (Unnamed:38)

I've looked and there really is no such file.

plata commented 4 years ago

Could it be that the file was part of Wine before? Or is it stdole2.tlb?

@Gcenx do you maybe know something about this?

plata commented 4 years ago

Actually, winetricks is using stdole2.tlb. See https://github.com/Winetricks/winetricks/issues/1154 and https://github.com/Winetricks/winetricks/blob/94edaddc039c205a98c2a620399a741c7a70ce02/src/winetricks#L11789. I think we simply should change the Verb such that it matches winetricks again.

Gcenx commented 4 years ago

I don’t recognize the file but winetricks is listing it as a fakedll, so I’m assuming it is part of wine these days

Zemogiter commented 4 years ago

Please reopen because it still crashes but this time it complains about comcat.dll not existing and when browsed the system32 directory I confirm it really isn't there.

[WARNING] 
org.graalvm.polyglot.PolyglotException: Path "/home/jonasz/.Phoenicis/containers//wineprefix//Shogo//drive_c/windows/system32/comcat.dll" does not exist
    at org.phoenicis.tools.files.FileUtilities.remove (FileUtilities.java:165)
    at <js>.remove (Unnamed:101)
    at <js>.go (Unnamed:34)
    at <js>.install (Unnamed:52)
    at org.graalvm.polyglot.Value.invokeMember (Value.java:459)
    at org.phoenicis.engines.VerbsManager.lambda$installVerb$0 (VerbsManager.java:71)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)
plata commented 4 years ago

This is weird. It complained about stdole2 first so comcat must have existed (otherwise it would not even have reached this point).

ImperatorS79 commented 4 years ago

winetricks use w_try rm, so you should check the file exists before trying to remove it. I would suggest adding the fileExistscheck inside remove to get rid of this permanently.

Zemogiter commented 4 years ago

Please reopen (again) I got a error:

Extracting to: /home/jonasz/.Phoenicis/containers//wineprefix//Heroes of Might  Magic IV//drive_c/vcrun6sp6/
Extracting cabinet: /home/jonasz/.Phoenicis/resources///Vs6sp6.exe
  extracting vcredist.exe

All done, no errors.
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - TypeError: Cannot read property 'split' of undefined
    at <js> run(Unnamed:387:14404-14419)
    at <js> run(Unnamed:172:5961-6051)
    at <js> go(Unnamed:42:1481-1529)
    at <js> install(Unnamed:52:1766-1789)
    at org.graalvm.polyglot.Value.invokeMember(Value.java:459)
    at org.phoenicis.engines.VerbsManager.lambda$installVerb$0(VerbsManager.java:71)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

[WARNING] 
org.graalvm.polyglot.PolyglotException: TypeError: Cannot read property 'split' of undefined
    at <js>.run (Unnamed:387)
    at <js>.run (Unnamed:172)
    at <js>.go (Unnamed:42)
    at <js>.install (Unnamed:52)
    at org.graalvm.polyglot.Value.invokeMember (Value.java:459)
    at org.phoenicis.engines.VerbsManager.lambda$installVerb$0 (VerbsManager.java:71)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)
plata commented 4 years ago

It's in https://github.com/PhoenicisOrg/scripts/blob/07185465bec2abf292123af8f9f80e608a29cd77/Engines/Wine/Engine/Implementation/script.js#L387 Can you check the value of setupFile before https://github.com/PhoenicisOrg/scripts/blob/07185465bec2abf292123af8f9f80e608a29cd77/Engines/Wine/Verbs/vcrun6sp6/script.js#L42?

Zemogiter commented 4 years ago

I forgot how. But I tried the setupFile in plain wine and it failed:

002c:fixme:ole:DllRegisterServer stub
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0
0009:fixme:setupapi:SetupDefaultQueueCallbackW notification 262144 params 32f3d0,0

Update: I've replaced setupFile in run with a directory path and it solved the problem.

plata commented 4 years ago

Update: I've replaced setupFile in run with a directory path and it solved the problem.

This doesn't make sense for me.

Just:

print("setupFile: " + setupFile);
this.wine.run(setupFile, "/q", null, false, true); 
Zemogiter commented 4 years ago

@plata print reports setupFile as undefined. Dosen't make sense to me.

plata commented 4 years ago

I kinda expected this. Seems that something's going wrong with CabExtract.

plata commented 4 years ago

Ok, CabExtract does not return anything. It's used wrongly: https://github.com/PhoenicisOrg/scripts/blob/07185465bec2abf292123af8f9f80e608a29cd77/Engines/Wine/Verbs/vcrun6sp6/script.js#L28 Should be (untested):

const setupDir = `${prefixDirectory}/drive_c/vcrun6sp6/`;
new CabExtract()
      .wizard(wizard)
      .archive(toBeCabExtracted)
      .to(setupDir)
      .extract(["-L", "-F", "vcredist.exe"]);
const setupFile = setupDir + "vcredist.exe";
Zemogiter commented 4 years ago

I've tested it and it works.

madoar commented 4 years ago

Does it maybe make sense to change the contract of CabExtract#extract to return an array of path strings? I.e. the extracted files/folders? Is this possible?

plata commented 4 years ago

I don't think it's possible. At least not easily. You could use the "-l" parameter of cabextract to list the files but then you would have to parse the cabextract output.