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

Electron Browser mode and instrumentation failure #88

Open
1one-w01f opened this issue Nov 5, 2019 · 1 comment
Open

Electron Browser mode and instrumentation failure #88

1one-w01f opened this issue Nov 5, 2019 · 1 comment

Comments

@1one-w01f
Copy link

Let me begin by congratulating you for the excellent papers.

Was wondering how to use the Browser mode w/ Electron? How to specify symbolic input in that case? I can see the Electron browser showing up but then after closing it I get a bunch of errors in the CLI:

[!] Exception E: SyntaxError: Unexpected end of JSON input of test data on 
[!] Exception E: SyntaxError: Unexpected end of JSON input of coverage data on 
[!] Error extracting final output - a fatal error must have occured
[!] expoSE replay 'https://google.com' '{"_bound":0}'
[!] Stats
[!] Done
[+] Total Lines Of Code 0
[+] Total Coverage: NaN%
[+] EXPOSE_PRINT_COVERAGE=1 for line by line breakdown
[+] ExpoSE Finished. 1 paths, 1 errors

Digging around the log file in /tmp/ it appears to me that it always fails to instrument:

b'Transforming\nFailure during HTML instrumentation: ENOENT: no such file or directory, open ... ...
... ...
... ...
... ...
Exception in processFile() @ proxy.py
Traceback (most recent call last):
  File "node_modules/jalangi2/scripts/proxy.py", line 51, in processFile
    with open (instrumentedFileName, "r") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'cache/www.google.com/e286e6d443be5e0a7f6b1b5381f16203/index_jalangi_.html'

I wrote a very simple page as a test (shown below) but that also results in a similar instrumentation failure. Can you give me some pointers to how to make it work?

<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Parse foo</title>
</head>
<body>
<script>

var s = location.href.substring(document.location.href.indexOf("?a=")+3);

var regex1 = RegExp('foo*','g');
var array1;

while ((array1 = regex1.exec(s)) !== null) {
  document.write(`Found ${array1[0]}. Next starts at ${regex1.lastIndex}.<br>`);
}

</script>
</body>
</html>
@jawline
Copy link
Member

jawline commented Nov 7, 2019

Hi! Our browser support is very experimental, and often a bit finicky to get working. The easiest way to get it working would be to modify our Dockerfile for your needs, as (Unless I've broken something) that should work with browser support out of the box.

I would recommend using this branch https://github.com/ExpoSEJS/ExpoSE/tree/features/browser as we make all experimental changes for the browser here, and I can't remember what is in master.

Second, we require specific versions of nodejs and python (Our dockerfile is pegged to them): https://github.com/ExpoSEJS/ExpoSE/blob/features/browser/scripts/docker_setup, https://github.com/ExpoSEJS/ExpoSE/blob/features/browser/Dockerfile give installation details.

Finally, we currently have only got it working on Ubuntu. I'm pretty sure it will run on other flavours of Linux, especially if you use Xvfb to make a display rather than a real X window, but I doubt it will work on Mac.

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

No branches or pull requests

2 participants