GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — NAN 2.0 support (done) by unbornchikken · Pull Request #221 · node-ffi/node-ffi

Conversation

@unbornchikken

@unbornchikken unbornchikken commented Aug 1, 2015

Copy link
Copy Markdown
Member

This is an in-progress PR. There is an issue that have to be resolved before merge.

When callback queue items gets processed in CallbackInfo::WatcherCallback which is invoked by libuv uv_async_send(&g_async) in callback_info.cc 192, the control flow eventually reaches CallbackInfo::DispatchToV8 at line 71, and there is a Nan::NewBuffer call. But v8 crashes there by raising the following error:

FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope

Which is odd because there is a Nan::HandleScope on top of DispatchToV8 definitely (at line 53).

io.js 1.x is not affected, I'm getting this with 2.5. I believe that there is some magic required to make a bare libuv callback v8 GC compatible that is not present in the new Nan::HandleScope.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Gabor Mezo and others added 29 commits March 17, 2015 09:30
Gabor Mezo
Readme and package.json updated for ability to ceate the temporary ff…
1241054
…i-io package.
Gabor Mezo
creadits updated in the readme
af08337
Gabor Mezo
credits fixed in the readme
cdada31
Gabor Mezo
(Hopefully) Final Readme changes
ea625ee
@unbornchikken
Update README.md
64997c1
@unbornchikken
Update package.json
d645744
1.0.3
@unbornchikken
Merge branch 'ffi-pr'
27b4a9a
@unbornchikken
Merge branch 'ffi-pr'
392ce56
@unbornchikken
1.0.4, fixes from the PR
e603940
@unbornchikken
readme fixd
f65bf41
@unbornchikken
obsolete
d70e9a5
@unbornchikken
new release
4fdb5cf
@unbornchikken
libuv vs windows thread id fix
e0e6d5b
@unbornchikken
libuv vs windows thread if fixed
f99e23c
@unbornchikken
mistake fixed
14ea40a
@unbornchikken
1.0.7
aa50a72
@unbornchikken
1.0.6
d266eee
@unbornchikken
mistake fixed
60ec310
@unbornchikken
Update callback_info.cc
7b455a6
On Windows we don't need self_thread, so it has moved to Unix only code.
@unbornchikken
Merge remote-tracking branch 'Upstream/master' into ffi-pr2
3a5171d
Conflicts:
	src/callback_info.cc
	src/ffi.h
@unbornchikken
master is at node-ffi/master
b38fb9a
@unbornchikken
HandleScope issue fix for iojs v1.7+
718aeaf
@unbornchikken
test case for #199 that covers callback and error propagation
0033711
@unbornchikken
New test case works with POSIC threading.
0d0361c
@unbornchikken
Lame synchronization issue fixed.
642c79b
@unbornchikken
nan2 support impl begin
6031bf6
@unbornchikken
nan2 ok
647fe3e
@unbornchikken
handle scope crash
4b7f6c9
@unbornchikken
Merge master
9b70d6a
@unbornchikken unbornchikken mentioned this pull request Aug 1, 2015
NAN 2.0 and io.js 3.0 support #219
Closed
@unbornchikken

unbornchikken commented Aug 1, 2015

Copy link
Copy Markdown
Member Author

@TooTallNate Do you know someone in the NAN team who might willing to help us? I think the solution have to be pretty obvious for someone with a good internal knowledge of NAN. If you could summon someone there, I'm gonna lead him to the issue if the above description is too sparse.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TooTallNate

TooTallNate commented Aug 1, 2015

Copy link
Copy Markdown
Member

/cc @rvagg @kkoopa

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TooTallNate

TooTallNate commented Aug 1, 2015

Copy link
Copy Markdown
Member

It's like V8 all over again 😨

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kkoopa
Fix errors
95a660a
@kkoopa

kkoopa commented Aug 2, 2015

Copy link
Copy Markdown

https://github.com/unbornchikken/node-ffi/pull/1

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken
Merge pull request #1 from kkoopa/nan2
40e1039
Fix errors
@unbornchikken

unbornchikken commented Aug 2, 2015

Copy link
Copy Markdown
Member Author

Ok, that helped, thanks a lot. However 0.10 is still failing, but I'm gonna fix it later today or tomorrow. The main issue was the recent v8 compatibility.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken
ffi_test.cc wrap pointer fixd
4f14f2a
@unbornchikken

unbornchikken commented Aug 3, 2015

Copy link
Copy Markdown
Member Author

@kkoopa I think there is and issue with the new Nan::NewBuffer on 0.10.40. It looks like its free callback never gets invoked after doing a gc.

Here we create a Buffer with a GC callback:
https://github.com/unbornchikken/node-ffi/blob/nan2/src/callback_info.cc#L153 callback function is at https://github.com/unbornchikken/node-ffi/blob/nan2/src/callback_info.cc#L39

There is an unit test, where we nullify the reference of the above Buffer followed by a gc() call:

https://github.com/unbornchikken/node-ffi/blob/nan2/test/callback.js#L82

This should invoke that free callback, but it never happens on 0.10.40. 0.12 and io.js is OK.

Is this really a NAN issue or am I screwing up something?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kkoopa

kkoopa commented Aug 3, 2015

Copy link
Copy Markdown

Likely fixed in nodejs/nan@bc45db2. Try the memleak branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken

unbornchikken commented Aug 3, 2015

Copy link
Copy Markdown
Member Author

I can confirm that this commit fixes the above Buffer issue. Cool. Now, we gotta wait while this gets released then ffi's NAN 2.0.x support gets completed.

Thank you again!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

unbornchikken added 2 commits August 3, 2015 12:26
@unbornchikken
whitespace fixes
d528142
@unbornchikken
done
b00a6fb
@unbornchikken

unbornchikken commented Aug 6, 2015

Copy link
Copy Markdown
Member Author

@TooTallNate now ffi's side is completed, you could merge this. But unfortunately install gets failed with io.js 3.0.0 because ref doesn't have NAN 2.0 support implemented.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken unbornchikken changed the title NAN 2.0 support (in-progress) NAN 2.0 support (done) Aug 6, 2015
@jbergstroem jbergstroem mentioned this pull request Aug 10, 2015
Support iojs 3.0.0 kelektiv/node.bcrypt.js#322
Closed
@unbornchikken unbornchikken mentioned this pull request Aug 18, 2015
Io.js 3.0 support TooTallNate/ref#35
Merged
@Mitko-Kerezov

Mitko-Kerezov commented Aug 26, 2015

Copy link
Copy Markdown

As of TooTallNate/ref@563af1a ref does have support for NAN 2.0 so I assume this PR can safely be merged, @TooTallNate ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken

unbornchikken commented Aug 26, 2015

Copy link
Copy Markdown
Member Author

Refer to the PR's title: Io.js 3.0 support -(blocked, waiting for nodejs/node#2487 gets released)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken

unbornchikken commented Aug 26, 2015

Copy link
Copy Markdown
Member Author

But I can see that commit has been deployed in io.js 3.2. I'll have to check it later.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken

unbornchikken commented Aug 27, 2015

Copy link
Copy Markdown
Member Author

I'm closing this. Gonna open up an other PR for this with a corrected commit history. @kkoopa thank you for your help again!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unbornchikken unbornchikken closed this Aug 27, 2015
unbornchikken added a commit that referenced this pull request Aug 31, 2015
@unbornchikken @TooTallNate
Update to "nan" v2, adds io.js v3 support
34879e6
Squashed commit of the following:

commit 9418dd7
Author: unbornchikken <[email protected]>
Date:   Sat Aug 29 21:13:45 2015 +0200

    license extended to current year

commit 72eed31
Author: unbornchikken <[email protected]>
Date:   Thu Aug 27 09:04:18 2015 +0200

    references fixed

commit a4b74e3
Author: unbornchikken <[email protected]>
Date:   Thu Aug 6 21:49:33 2015 +0200

    done

commit 6f024fa
Author: unbornchikken <[email protected]>
Date:   Mon Aug 3 12:26:22 2015 +0200

    whitespace fixes

commit a6d494e
Author: unbornchikken <[email protected]>
Date:   Mon Aug 3 10:26:54 2015 +0200

    ffi_test.cc wrap pointer fixd

commit 01ea563
Author: Benjamin Byholm <[email protected]>
Date:   Sun Aug 2 15:25:10 2015 +0300

    Fix errors

commit 99b4983
Author: unbornchikken <[email protected]>
Date:   Thu Aug 27 08:49:14 2015 +0200

    Merge master
    Fix errors
    Merge pull request #1 from kkoopa/nan2

    Fix errors
    ffi_test.cc wrap pointer fixd
    whitespace fixes
    done

commit dc0e555
Author: unbornchikken <[email protected]>
Date:   Sat Aug 1 12:48:51 2015 +0200

    handle scope crash

commit 66f877d
Author: unbornchikken <[email protected]>
Date:   Fri Jul 31 21:50:15 2015 +0200

    nan2 ok

commit 8ae22da
Author: unbornchikken <[email protected]>
Date:   Thu Aug 27 09:14:17 2015 +0200

    nan2 support impl begin

Fixes #219.
Refs #221.
Closes #231.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@unbornchikken @TooTallNate @kkoopa @Mitko-Kerezov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.