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

Failed assert in AsyncWrap::MakeCallback(uint32_t, int, Handle) from test-timers-unref.js on ARM #13

Closed
rvagg opened this issue Nov 29, 2014 · 3 comments
Assignees
Milestone

Comments

@rvagg
Copy link
Member

rvagg commented Nov 29, 2014

Only seen on ARMv7 and goes away when you comment out this line (which does t.unref.bind(t)).

node: ../src/async-wrap-inl.h:245: v8::Handle<v8::Value> node::AsyncWrap::MakeCallback(uint32_t, int, v8::Handle<v8::Value>*): Assertion `cb->IsFunction()' failed.

https://jenkins-node-forward.nodesource.com/job/iojs+v0.12+multi/nodes=node-forward-nodesource-armv7-ubuntu1404/13/console

Could this be a libuv thing perhaps?

ARMv7 machine now hooked up to the CI cluster and will run with the rest of them.

@bnoordhuis
Copy link
Member

It's at least partially a bug in async-wrap-inl.h because the code first casts to v8::Function before checking whether the object is really a function.

That's not the root cause, though. The error message suggests that timer[0] (that's where JS land stores the timeout callback) is not a function. Can I get access to that machine? I probably have to do some printf-style debugging to figure out where things go wrong.

@rvagg
Copy link
Member Author

rvagg commented Nov 29, 2014

will privmsg on irc

@bnoordhuis
Copy link
Member

Short status update: the callback field is undefined, hence the assert.

(gdb) call (*('v8::internal::Object'**) 0x11ed4a8)->Print()
0x5b079385: [JSObject]
 - map = 0x5f20fb01 [FAST_HOLEY_ELEMENTS]
 - prototype = 0x5b0639d9
 {
   #domain: 0x47e08091 <undefined> (field at offset 0)
   0: 0x47e08091 <undefined>
   1: 0x47e080a1 <the hole>
   2: 0x47e080a1 <the hole>
   3: 0x47e080a1 <the hole>
   4: 0x47e080a1 <the hole>
   5: 0x47e080a1 <the hole>
   6: 0x47e080a1 <the hole>
   7: 0x47e080a1 <the hole>
   8: 0x47e080a1 <the hole>
   9: 0x47e080a1 <the hole>
   10: 0x47e080a1 <the hole>
   11: 0x47e080a1 <the hole>
   12: 0x47e080a1 <the hole>
   13: 0x47e080a1 <the hole>
   14: 0x47e080a1 <the hole>
   15: 0x47e080a1 <the hole>
   16: 0x47e080a1 <the hole>
 }

Now to figure out why.

@bnoordhuis bnoordhuis self-assigned this Dec 9, 2014
@bnoordhuis bnoordhuis added this to the v1.0.0 milestone Dec 9, 2014
bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Dec 18, 2014
Fixes the following assertion on slow systems, like our ARM buildbot:

    $ out/Debug/node test/simple/test-timers-unref.js
    node: ../src/async-wrap-inl.h:101: v8::Handle<v8::Value>
    node::AsyncWrap::MakeCallback(uint32_t, int,
    v8::Handle<v8::Value>*): Assertion `cb_v->IsFunction()' failed.
    Aborted

The reason it only manifests on slow systems is that the test starts
a 1 ms interval timer, then defers timer.unref.bind({}) to the next
tick.  On fast systems, the test completes in under a millisecond,
before the callback is called.

This commit makes timer.unref() check that the receiver actually has
a timeout callback property.

Fixes nodejs#13.

PR-URL: nodejs#165
Reviewed-By: Rod Vagg <rod@vagg.org>
mmarchini pushed a commit to mmarchini/node that referenced this issue Nov 30, 2017
danbev added a commit to danbev/node that referenced this issue Sep 19, 2019
This commit removes the addition of a void* cast ptr_arg_cmd. The
motivation of this is that currently the jlh command does not work. For
example:
(lldb) jlh env()->quic_on_socket_ready_function()

With this change the jlh command works as expected:

(lldb) (lldb) jlh env()->quic_on_socket_ready_function()
0x3d6bd6c81c29: [Function]
 - map: 0x3d6babdc0751 <Map(HOLEY_ELEMENTS)> [FastProperties]
 - prototype: 0x3d6b6f140979 <JSFunction (sfi = 0x3d6ba9988179)>
 - elements: 0x3d6bbfe00bf9 <FixedArray[0]> [HOLEY_ELEMENTS]
 - function prototype:
 - initial_map:
 - shared_info: 0x3d6b45e48011 <SharedFunctionInfo onSocketReady>
 - name: 0x3d6b45e48069 <String[nodejs#13]: onSocketReady>
 - builtin: CompileLazy
 - formal_parameter_count: 1
 - kind: NormalFunction
 - context: 0x3d6bd6ca1e51 <FunctionContext[144]>
 - code: 0x1c1635244721 <Code BUILTIN CompileLazy>
 - source code: (fd) {
  this[owner_symbol][kReady](fd);
}
 - properties: 0x3d6bbfe00bf9 <FixedArray[0]> {
    #length: 0x3d6ba9980491 <AccessorInfo> (const accessor descriptor)
    #name: 0x3d6ba9980421 <AccessorInfo> (const accessor descriptor)
    #prototype: 0x3d6ba9980501 <AccessorInfo> (const accessor descriptor)
 }

 - feedback vector: feedback metadata is not available in SFI

I'm not sure yet how the other commands that use ptr_arg_cmd are
affected but thought I'd bring this up as a WIP incase others are seeing
the same issue.
StefanStojanovic added a commit to JaneaSystems/node that referenced this issue Jan 30, 2024
* Nightly patch

* v12.1 patch

* v12.2 patch
StefanStojanovic pushed a commit to JaneaSystems/node that referenced this issue Jan 30, 2024
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

4 participants