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

Webworkers #87

Open
infra-0-0 opened this issue Mar 2, 2016 · 6 comments
Open

Webworkers #87

infra-0-0 opened this issue Mar 2, 2016 · 6 comments

Comments

@infra-0-0
Copy link

Possibly a bug in Jalangi2.

Expected behavior:

  • counter increments

Actual behavior:

  • webworker code is not instrumented with Jalangi2 code available in the main session as 'window.J$'
  • counter does not increment
  • "ReferenceError: J$ is not defined"
@stroucki
Copy link

Webworkers are isolated from the main context. I'm looking to somehow bridge it to allow the code to run, though I'm pretty sure I have no hope of getting data out.
@msridhar any comment on this issue?

@msridhar
Copy link
Contributor

@stroucki what is your goal exactly? As you note, webworkers are isolated and can only communicate via message passing. You could probably move data around by creating appropriate message handlers via your analysis and then passing data around in the endExecution() callback. But it would be some work.

@stroucki
Copy link

@msridhar I would like to instrument the javascript of a large commercial site, using jalangi via a proxy. The proxy instruments the code, but if it is running in a worker, it dies immediately from the undefined reference.

The site renders without the worker working, but I'm trying to be as complete as I can be.

@msridhar
Copy link
Contributor

Thanks for the details. This seems tricky to fix. One solution would be to load the core Jalangi runtime scripts (and the analysis scripts) within each worker. But, in the proxy, I don't think you can tell whether a script will be loaded in the main context or within a worker. If there were some way to tell, that would be useful. Otherwise, I don't immediately have an idea on how to solve this.

@stroucki
Copy link

I am currently thinking of adding a check for J$ being undefined at the beginning of a script, and trying to set up J$ accordingly if so.

@msridhar
Copy link
Contributor

msridhar commented Oct 14, 2021 via email

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

3 participants