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

Node.js does not run under DynamoRIO on AArch64 #2425

Open
egrimley opened this issue May 10, 2017 · 0 comments
Open

Node.js does not run under DynamoRIO on AArch64 #2425

egrimley opened this issue May 10, 2017 · 0 comments

Comments

@egrimley
Copy link
Contributor

Node.js does not run under DynamoRIO on AArch64, probably because it is multi-threaded and self-modifying:

$ nodejs -e 'console.log("saluton");'
saluton
$ bin64/drrun -- nodejs -e 'console.log("saluton");'
<Application /usr/bin/nodejs (29513).  DynamoRIO internal crash at PC 0x0000007f97f10d6c.  Please report this at http://dynamorio.org/issues/.  Program aborted.
Received SIGSEGV at unknown pc 0x0000007f838dcd6c in thread 29521

(That was on Debian Stretch. On some distros the command is node instead of nodejs.)

This example works, however, after this tiny change to the source:

--- a/core/synch.c
+++ b/core/synch.c
@@ -1621,8 +1621,8 @@ translate_from_synchall_to_dispatch(thread_record_t *tr, thread_synch_state
             "\ttranslation pc = "PFX"\n", mc->pc);
         ASSERT(!is_dynamo_address((app_pc)mc->pc) &&
                !in_fcache((app_pc)mc->pc));
-        IF_ARM({
-            if (INTERNAL_OPTION(steal_reg_at_reset) != 0) {
+        IF_AARCHXX({
+            if (true || INTERNAL_OPTION(steal_reg_at_reset) != 0) {
                 /* XXX: do we need this?  Will signal.c will fix it up prior
                  * to sigreturn from suspend handler?
                  */
$ bin64/drrun -- nodejs -e 'console.log("saluton");'                                     
saluton
$ 

The change from IF_ARM to IF_AARCHXX is obvious, and there is another use of IF_ARM in the same function that should presumably be updated likewise. The apparent need to remove if (INTERNAL_OPTION(steal_reg_at_reset) != 0) is less obvious to me (here and perhaps also 29 lines earlier).

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

No branches or pull requests

2 participants