{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5353","repository_url":"https://api.github.com/repos/Microsoft/ChakraCore","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5353/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5353/comments","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5353/events","html_url":"https://github.com/Microsoft/ChakraCore/issues/5353","id":335024403,"node_id":"MDU6SXNzdWUzMzUwMjQ0MDM=","number":5353,"title":"JsCreateExternalObject returns ArgumentNotObject","user":{"login":"dennis-yemelyanov","id":10681271,"node_id":"MDQ6VXNlcjEwNjgxMjcx","avatar_url":"https://avatars3.githubusercontent.com/u/10681271?v=4","gravatar_id":"","url":"https://api.github.com/users/dennis-yemelyanov","html_url":"https://github.com/dennis-yemelyanov","followers_url":"https://api.github.com/users/dennis-yemelyanov/followers","following_url":"https://api.github.com/users/dennis-yemelyanov/following{/other_user}","gists_url":"https://api.github.com/users/dennis-yemelyanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dennis-yemelyanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennis-yemelyanov/subscriptions","organizations_url":"https://api.github.com/users/dennis-yemelyanov/orgs","repos_url":"https://api.github.com/users/dennis-yemelyanov/repos","events_url":"https://api.github.com/users/dennis-yemelyanov/events{/privacy}","received_events_url":"https://api.github.com/users/dennis-yemelyanov/received_events","type":"User","site_admin":false},"labels":[{"id":307793015,"node_id":"MDU6TGFiZWwzMDc3OTMwMTU=","url":"https://api.github.com/repos/Microsoft/ChakraCore/labels/Question","name":"Question","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-22T21:28:21Z","updated_at":"2018-06-22T22:19:22Z","closed_at":null,"author_association":"NONE","body":"We have some code that calls JsCreateExternalObject (through the .NET wrapper) to get a reference to external C# objects. It works fine most of the time, but it looks like one time it returned ArgumentNotObject. Is there any valid scenario where this error would be returned from this method?\r\n\r\nI looked at the [implementation](https://github.com/Microsoft/ChakraCore/blob/6c2c8a78420e9bcc0b126ea05a6f17237aff3415/lib/Jsrt/Jsrt.cpp#L1331), and it seems this error can be returned from [VALIDATE_INCOMING_OBJECT](https://github.com/Microsoft/ChakraCore/blob/6c2c8a78420e9bcc0b126ea05a6f17237aff3415/lib/Jsrt/Jsrt.cpp#L1331) in `JsCreateExternalObjectWithPrototype`, but the `prototype` value should be JS_INVALID_REFERENCE, and this check shouldn't be executed. Could the error be related to the `data` parameter that we are passing in?\r\n\r\nThe version of ChakraCore is 1.8.4."},"comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments/399597510","html_url":"https://github.com/Microsoft/ChakraCore/issues/5353#issuecomment-399597510","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/5353","id":399597510,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTU5NzUxMA==","user":{"login":"dennis-yemelyanov","id":10681271,"node_id":"MDQ6VXNlcjEwNjgxMjcx","avatar_url":"https://avatars3.githubusercontent.com/u/10681271?v=4","gravatar_id":"","url":"https://api.github.com/users/dennis-yemelyanov","html_url":"https://github.com/dennis-yemelyanov","followers_url":"https://api.github.com/users/dennis-yemelyanov/followers","following_url":"https://api.github.com/users/dennis-yemelyanov/following{/other_user}","gists_url":"https://api.github.com/users/dennis-yemelyanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dennis-yemelyanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennis-yemelyanov/subscriptions","organizations_url":"https://api.github.com/users/dennis-yemelyanov/orgs","repos_url":"https://api.github.com/users/dennis-yemelyanov/repos","events_url":"https://api.github.com/users/dennis-yemelyanov/events{/privacy}","received_events_url":"https://api.github.com/users/dennis-yemelyanov/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T22:19:22Z","updated_at":"2018-06-22T22:19:22Z","author_association":"NONE","body":"I don't think there is a race condition since the `Prototype` is basically initialized at application startup and `CreateJsObject` calls are made later. I'm also checking if there could be some garbage collection happening leading to this state (unlikely)... I'll also add some logging to get `Prototype.ValueType` right before using it."}}
{"actor":{"display_login":"dennis-yemelyanov"}}