Skip to content

Conversation

@obastemur
Copy link
Collaborator

No description provided.

@obastemur obastemur force-pushed the pal_fix_double_init branch 2 times, most recently from 9d5640d to 5e9ca6a Compare December 29, 2016 17:09
@obastemur
Copy link
Collaborator Author

Second part of this work requires #2288 is merged.

memcpy(path, msg, (size_t)str_len); \
path[str_len] = char(0)

void GetBinaryLocation(char *path, const unsigned size)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size [](start = 50, length = 4)

Specify type for size explicitly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had discussed on this when it was implemented for the first time. It should be reachable from the blame part.

@obastemur
Copy link
Collaborator Author

Adding additional [ Android / ARMv7 / iOS ] related commits straight to this PR. Fixes are related.

A full review on this PR is highly appreciated.

@obastemur
Copy link
Collaborator Author

moved custom trace support to this PR and added Android LogCat output support.

@obastemur obastemur force-pushed the pal_fix_double_init branch from 9be3130 to b33e26f Compare January 6, 2017 08:36

LLVM_VERSION="3.9.1"

CC_URL="git://sourceware.org/git/binutils-gdb.git\nhttp://llvm.org/releases/${LLVM_VERSION}/\n"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dilijev
Copy link
Contributor

dilijev commented Jan 6, 2017

You can now resolve the CI issues as described here: #2332 (comment)

@obastemur obastemur force-pushed the pal_fix_double_init branch from b33e26f to ef987bb Compare January 9, 2017 23:19
@obastemur obastemur requested a review from jianchun January 9, 2017 23:20
@jianchun
Copy link

"Fix PAL double initialize" -- Could you document in comment or commit message in more details, how previously PAL double initializes and now does not? From the surface it looks we have 3+ places calling PAL_InitializeChakraCore().


__attribute__((no_instrument_function))
static void
GetBinaryLocation()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple copies of this function...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional. See comments, this file shouldn't take dependencies

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was aware of that. Questionable though if it is worth duplicating code for that goal.

Also, is this only useful for diagnostics builds and can be excluded form "release"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already excluded for any configuration with no --trace. -> #ifdef ENABLE_CC_XPLAT_TRACE

// All args are right after ReturnAddress by custom calling convention
Js::Var* pArgs = reinterpret_cast<Js::Var*>(addrOfReturnAddress) + 1;
#ifdef _ARM_
n += 2; // ip + fp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please document more details for this "+ 2"? Android ARM stores "ip + fp" in between return address and args?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Not just Android ARM, so ifdef _ARM_. Still work in progress here though.

Copy link

@jianchun jianchun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@obastemur
Copy link
Collaborator Author

Could you document in comment or commit message in more details, how previously PAL double initializes and now does not? From the surface it looks we have 3+ places calling PAL_InitializeChakraCore().

Previously we were calling 2 sep. methods and those were ending up calling the same final initializer multiple times. ATM, we have multiple entry points (Shared / CH / Static) and we trigger base initializer only once.

@obastemur
Copy link
Collaborator Author

@ThomsonTan @jianchun Thanks for the review

@chakrabot chakrabot merged commit ef987bb into chakra-core:master Jan 11, 2017
chakrabot pushed a commit that referenced this pull request Jan 11, 2017
Merge pull request #2296 from obastemur:pal_fix_double_init
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

Successfully merging this pull request may close these issues.

6 participants