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

Infinite Call Loop #90

Open
cl0udz opened this issue Jan 30, 2020 · 4 comments
Open

Infinite Call Loop #90

cl0udz opened this issue Jan 30, 2020 · 4 comments

Comments

@cl0udz
Copy link
Contributor

cl0udz commented Jan 30, 2020

Recently I am trying to analyze some modules with ExpoSE. Since ExpoSE is based on jalangi2, I have to use babel to downgrade modules that are not compatible with jalangi2. Then I found the bug. Some test scripts cannot work correctly with ExpoSE.

Take consono as an example. It will infinitely call the following functions when running with ExpoSE.

[?] Entering anonymous near (/home/james/nodejs/ExpoSE/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js:116:7:116:75)
[?] TODO: IsNative Uncached
[?] Entering anonymous near (/home/james/nodejs/ExpoSE/node_modules/core-js/modules/es.string.replace.js:38:3:98:4)
[?] TODO: IsNative Uncached
[?] Entering anonymous near (/home/james/nodejs/ExpoSE/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js:94:41:105

The command I executed is EXPOSE_PRINT_PATHS=1 EXPOSE_LOG_LEVEL=3 ./expoSE target/TestConsono/TestConsono.js.

In case you need the testcase, I've uploaded it to the following repo.
https://github.com/cl0udz/bug-poc

@jawline
Copy link
Member

jawline commented Jan 30, 2020

Thanks for the report.

It looks like the method used to concretize calls to native methods is getting stuck in a loop https://github.com/ExpoSEJS/ExpoSE/blob/master/Analyser/src/Utilities/IsNative.js. Unfortunately, there is no great way we've found of handling concretization in these cases for JS

I'll take a look and see if there's anything I can do for this case.

(One thing to note - we maintain a modified version of Jalangi with Babel built-in. You shouldn't need to manually transpile it.)

@jawline
Copy link
Member

jawline commented Mar 8, 2020

Hi @cl0udz,

I'm taking another look at this bug now (It's been forever, sorry!). I can't seem to reproduce the same error on my system, instead I'm getting a parser failure due to a missing corejs library. Could you tell me which git commit of ExpoSE you used to get this issue.

@cl0udz
Copy link
Contributor Author

cl0udz commented Jul 13, 2020

Sorry for the late reply. I was busy with another project but finally, I've fixed the bug now. Actually the problem is that babel may modify some native functions used by ExpoSE(e.g. JSON.stringify). This will cause infinite recursive calls when analyzing the module. I'll send a pull request in several days.

@jawline
Copy link
Member

jawline commented Jul 13, 2020

Oh awesome, that's great. Thanks!

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