You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 2 uses of the call wa->cb() that don't appear to be equivalent....
The "normal" one that happens at line 143: wa->cb(loop, wa, n);
and the "special" one above it at line 138: wa->cb(loop, wa, val);
The two different ways of calling wa->cb() don't seem to be doing the same thing. The "normal" one is using the size of the buffer in n, while the "special" one is sending what looks like part of a buffer copy.
I see the comment shows it is trying to fix a byte-alignment issue, but why is it copying the received buffer into val instead of the value of n ?
On linux, the file descriptor is an eventfd. Reading from an eventfd should always return 8 bytes: it's a 64 bits counter, the number of writes since the last read.
This is the problem... I don't know where the code is dying since I am just running a node express app that does many different things... It runs daemonized, and randomly just stops running without anything in any log file.
The only time I see the error is if I happen to still be in the console I started the process from when it dies.
I don't know the value of "n" since that is INSIDE libuv
For the alignment issue that code is trying to avoid, why isn't it copying n into val, so that the call wa->cb(loop, wa, val); would be equivalent to the one below it?
Ugh. File finally core dumped, but the core file might not be helpful. I'm a lot more familiar with C than the workings of gdb, but here is what I have at the moment:
# gdb node core.27902
...
Program terminated with signal 6, Aborted.
#0 0x00007f27f80075f7 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install nodejs-4.6.2-1nodesource.el7.centos.x86_64
(gdb) bt full
#0 0x00007f27f80075f7 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007f27f8008ce8 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007f27f8000566 in __assert_fail_base () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007f27f8000612 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#4 0x0000000000ece71e in uv__async_io ()
No symbol table info available.
#5 0x0000000000edd8e8 in uv__io_poll ()
No symbol table info available.
#6 0x0000000000ecefb9 in uv_run ()
No symbol table info available.
#7 0x0000000000d73e50 in node::Start(int, char**) ()
No symbol table info available.
#8 0x00007f27f7ff3b15 in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#9 0x0000000000728109 in _start ()
No symbol table info available.
(gdb) frame 4
#4 0x0000000000ece71e in uv__async_io ()
(gdb) list
No symbol table is loaded. Use the "file" command.
You will want to run that debuginfo-install command to obtain the debug symbols. Once you have them installed, select the uv__async_io frame with frame 4, then info locals.
Could this problem be a combination of the EOF on read() and how the "deasync" node module operates? I happen to be using deasync in places in the application, and note the deasync project also has an issue open similar to this title: abbr/deasync#34
@rgagnon24 Sorry for bringing up this up again, but how did you go about debugging this? I am writing an express app and have encountered this issue as well.
Note I have very weak knowledge of C and was wondering if you or someone could point me in the write direction
Activity
cjihrig commentedon Dec 16, 2016
Do you happen to have code to reproduce the problem? Also, can you try with the latest version of Node?
bnoordhuis commentedon Dec 16, 2016
On linux, the file descriptor is an eventfd. Reading from an eventfd should always return 8 bytes: it's a 64 bits counter, the number of writes since the last read.
What value does
nhave when you hit the assert?rgagnon24 commentedon Dec 16, 2016
This is the problem... I don't know where the code is dying since I am just running a node express app that does many different things... It runs daemonized, and randomly just stops running without anything in any log file.
The only time I see the error is if I happen to still be in the console I started the process from when it dies.
I don't know the value of "n" since that is INSIDE libuv
rgagnon24 commentedon Dec 16, 2016
For the alignment issue that code is trying to avoid, why isn't it copying
nintoval, so that the callwa->cb(loop, wa, val);would be equivalent to the one below it?bnoordhuis commentedon Dec 16, 2016
If you turn on core dumps (
ulimit -c unlimited), you'll get a core dump that you can inspect in gdb.They're not the same thing.
nis the number of bytes that are available for reading,valis the actual bytes.rgagnon24 commentedon Dec 16, 2016
Correct... They are not the same thing... which is why I was wondering why the call to wa->cb() is using different things.
I will setup to get core dumps and see what happens
rgagnon24 commentedon Dec 19, 2016
Ugh. File finally core dumped, but the core file might not be helpful. I'm a lot more familiar with C than the workings of gdb, but here is what I have at the moment:
bnoordhuis commentedon Dec 19, 2016
You will want to run that debuginfo-install command to obtain the debug symbols. Once you have them installed, select the
uv__async_ioframe withframe 4, theninfo locals.rgagnon24 commentedon Dec 19, 2016
Thanks for the information....
here's the result:
and the content of the troublesome frame:
Interestingly enough, I was kind of expecting
nto be a multiple ofsizeof(val)instead of 0rgagnon24 commentedon Dec 19, 2016
It looks to me as if the
read()call is returning0forEOF, the#ifdefsection is not built to expect thatrgagnon24 commentedon Dec 19, 2016
Probably should have also included the content of
wandwaat the time:rgagnon24 commentedon Dec 20, 2016
Could this problem be a combination of the EOF on read() and how the "deasync" node module operates? I happen to be using deasync in places in the application, and note the deasync project also has an issue open similar to this title: abbr/deasync#34
rgagnon24 commentedon Dec 28, 2016
Any comments about my suggested patch above?
rgagnon24 commentedon Feb 1, 2017
Pull request #1214 created for review/comment
unix: simplify async watcher dispatch logic
GummyDonut commentedon May 31, 2018
@rgagnon24 Sorry for bringing up this up again, but how did you go about debugging this? I am writing an express app and have encountered this issue as well.
Note I have very weak knowledge of C and was wondering if you or someone could point me in the write direction