Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraalVM js debug devtools is not accessible in the lasted chrome 118.0.5993.89 #7636

Closed
chenjie100 opened this issue Oct 20, 2023 · 14 comments
Closed
Assignees
Labels

Comments

@chenjie100
Copy link

chenjie100 commented Oct 20, 2023

When debug js in Chrome open: devtools://devtools/bundled/js_app.html?ws=127.0.0.1:61775/1E828627BBFA81AF25EDE97FD2F
No source code appears and cannot be debugged。

@chenjie100 chenjie100 added the bug label Oct 20, 2023
@hamzaGhaissi
Copy link
Member

Hi can you please provide:

  • GraalVm version
  • JDK version
  • OS & architecture
  • A minimal reproducer and steps

@chenjie100
Copy link
Author

GraalVm version: 23.0
JDK version: 17.0.8+9-LTS-jvmci-23.0-b14
OS & architecture:Windows 10 amd64
A minimal reproducer and steps:
1, Write any js and start to debug in chrome devtools.
2, In Chrome open: devtools://devtools/bundled/js_app.html?ws=127.0.0.1:50144/someUrl
3, No source code to display and cannot be debugged。

@martinhiller
Copy link

To make the reproduction more concrete:

  1. Launch the following main class:
import org.graalvm.polyglot.Context;

public class DebugTest {

	public static void main(String[] args) throws Exception {
		try (Context context = Context.newBuilder("js")
				.option("inspect", "4242")
				.option("inspect.Suspend", "false")
				.option("inspect.WaitAttached", "true")
				.option("inspect.Path", "debug")
				.build()) {
			context.eval("js", """
					(function () {
						debugger;
						return 41 + 1;
					})()
					""");
		}
	}
}
  1. Open the DevTools URL (printed by GraalVM to the stderr) in any recent Chromium browser: devtools://devtools/bundled/js_app.html?ws=127.0.0.1:4242/debug

Result:

The DevTools open but no source code is shown, and no debugging is possible. According to the protocol monitor, GraalVM sends the browser 3 events, but no further communication takes place. The Java code blocks until the DevTools page is manually closed again.

image

@zebhlindqvist
Copy link

zebhlindqvist commented Oct 23, 2023

I'm experiencing a similar issue since a few days. Before this it was rock solid for months.

I changed nothing in my implementation, same JDK, only regular updates to OS.

For me everything looks normal, I can create breakpoints etc, but my program won't pause on the breakpoints anymore.

GraalVm version: 22.0.0
JDK version: 11.0.20-tem
OS & architecture:Ubuntu 23.04 amd64
Web browser: Chromium 118.0.5993.88

EDIT:
Tested with Chromium 116.0.5845.96 and everything works as expected.

@hamzaGhaissi hamzaGhaissi self-assigned this Oct 24, 2023
@hamzaGhaissi
Copy link
Member

Thanks @martinhiller issue was found on windows, and we are looking into it

@hamzaGhaissi
Copy link
Member

hamzaGhaissi commented Oct 24, 2023

@zebhlindqvist , I found the original issue with Chromium 118.0.5993.70 ubuntu arm64, can you please provide me with Chromium 116.x that you have used ?

@zebhlindqvist
Copy link

@hamzaGhaissi

I didn't find a way to download an older version of Chrome/Chromium. I just happed to find that version installed on a computer that wasn't updated.

One easy way I found was to use Electron.
See https://github.com/zebhlindqvist/electron-devtools

Electron 26.4.1 has Chromium 116.0.5845.228 built in.

@martinhiller
Copy link

Another way are the Chrome for Testing downloads:

Chrome 117 (still works):

Chrome 117.0.5938.149 for Win64
Chrome 117.0.5938.149 for Linux64

Chrome 118 (not anymore):

Chrome 118.0.5993.70 for Win64
Chrome 118.0.5993.70 for Linux64

@hamzaGhaissi
Copy link
Member

Issue was identified on the latest builds of chrome/chromium, and we are looking into it

@chenjie100
Copy link
Author

I found a possible reason that GraalVM did not send the source code to chrome devtools.

@oghmjos
Copy link

oghmjos commented Nov 10, 2023

Issue is actual for google-chrome-stable-119.0.6045.105-1.x86_64 as well (and perhaps for 120), but works correctly for google-chrome-stable-117.0.5938.132-1.x86_64 (Linux) and releases before.

No info that Chrome devTools changed something in API for source code, looks like there were only cosmetic changes: Streamlined workspace in the Sources panel

Did anyone localize the issue or found a workaround? The last post from @chenjie100 looks encouraging...

@entlicher
Copy link
Contributor

This was fixed by db40984
We will backport the fix to the releases of GraalVM.

@chenjie100
Copy link
Author

@entlicher That's great, where can I download the update patch or completed graalvm please? Thank you.

mergify bot pushed a commit to enso-org/enso that referenced this issue Nov 22, 2023
Adds chrome-inspector tool and Debug Adapter protocol tool for debugging Enso.

# Important Notes
The chrome devtools seems to be broken (tracked in oracle/graal#7636). Even `graalpy --inspect ...` fails (Chrome devtools freezes after connecting to the server). This PR adds Debug adapter protocol tool for debugging as a workaround for chrome inspector. There is docs in [dap.md](https://github.com/enso-org/enso/pull/8344/files#diff-421574b50574cfe546e86d4b3d32d79b8b2087f2fe204f68e5cf2693af43bbe1)
@jkevan
Copy link

jkevan commented Nov 27, 2023

After struggling to install a previous version of Google Chrome ...
To workaround the issue and be able to use the debugger here is what I did:

Edit your host file with:

0.0.0.0 brave-update.brave.com
0.0.0.0 updates.bravesoftware.com

This will block Brave browser update domains (The simplest way I found to disable auto update of Brave...)

Then you can download in the assets of: https://github.com/brave/brave-browser/releases/tag/v1.58.137 A version of Brave browser that match your arch.
This version of Brave is based on Chromium 117 and the debugger is working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants