All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump)
@ 2015-08-17 17:13 bugzilla at busybox.net
  2015-12-01 21:41 ` [Buildroot] [Bug 8296] " bugzilla at busybox.net
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-08-17 17:13 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

           Summary: nodejs 0.12.7 - npm crashes (seg core dump)
           Product: buildroot
           Version: unspecified
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
        AssignedTo: unassigned at buildroot.uclibc.org
        ReportedBy: pfriedland at gmail.com
                CC: buildroot at uclibc.org
   Estimated Hours: 0.0


tested with  (armv7 and x86_64)
using a clone from git repository today 8/17/2015

npm built with nodejs 0.12.7 core dumps
nodejs 0.12.7 starts ok

npm built with nodejs 0.10.40 works fine
nodejs 0.10.40 works fine

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
@ 2015-12-01 21:41 ` bugzilla at busybox.net
  2015-12-01 21:42 ` bugzilla at busybox.net
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-01 21:41 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

Martin <martin@barkynet.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin at barkynet.com
         AssignedTo|unassigned at buildroot.uclibc |martin at barkynet.com
                   |.org                        |

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
  2015-12-01 21:41 ` [Buildroot] [Bug 8296] " bugzilla at busybox.net
@ 2015-12-01 21:42 ` bugzilla at busybox.net
  2015-12-01 21:49 ` bugzilla at busybox.net
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-01 21:42 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #1 from Martin <martin@barkynet.com> 2015-12-01 21:42:25 UTC ---
I have managed to reproduce this issue using qemu_x86_64_defconfig in the
2015.11 release.  My initial tests seem to show it's related to using uclibc.

To reproduce the npm crash do the following:

1) start with qemu_x86_64_defconfig
2) add the C++ compiler
3) enable node.js version 0.12.7
4) enable npm for the target
5) build and run in qemu as per the instructions in
board/qemu/x86_64/readme.txt
6) login and type npm -v, it will crash.

Changing the toolchain from uclibc to glibc causes npm to start working. So as
a work around use glibc.  I'll try and narrow down the issue further.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
  2015-12-01 21:41 ` [Buildroot] [Bug 8296] " bugzilla at busybox.net
  2015-12-01 21:42 ` bugzilla at busybox.net
@ 2015-12-01 21:49 ` bugzilla at busybox.net
  2015-12-01 22:04 ` bugzilla at busybox.net
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-01 21:49 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #2 from Martin <martin@barkynet.com> 2015-12-01 21:49:49 UTC ---
Created attachment 6236
  --> https://bugs.busybox.net/attachment.cgi?id=6236
qemu_x86_64_npm_crash_defconfig

qemu_x86_64_npm_crash_defconfig is modified from qemu_x86_64_defconfig.  It has
the C++ compiler added, node.js and npm for the target.  Running npm on the
target will crash.

Set BR2_TOOLCHAIN_BUILDROOT_GLIBC=y to test using glibc where npm will work.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2015-12-01 21:49 ` bugzilla at busybox.net
@ 2015-12-01 22:04 ` bugzilla at busybox.net
  2015-12-01 23:02   ` Martin Bark
  2015-12-02 20:00 ` bugzilla at busybox.net
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-01 22:04 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #3 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2015-12-01 22:04:34 UTC ---
Thanks for the investigation. Can you rebuild with debugging symbols, and get a
core dump, to see where we are crashing?

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-12-01 22:04 ` bugzilla at busybox.net
@ 2015-12-01 23:02   ` Martin Bark
  2015-12-02  8:12     ` Thomas Petazzoni
  2015-12-02 21:50     ` Mike Frysinger
  0 siblings, 2 replies; 14+ messages in thread
From: Martin Bark @ 2015-12-01 23:02 UTC (permalink / raw)
  To: buildroot

Thomas,

On 1 December 2015 at 22:04,  <bugzilla@busybox.net> wrote:
> https://bugs.busybox.net/show_bug.cgi?id=8296
>
> --- Comment #3 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2015-12-01 22:04:34 UTC ---
> Thanks for the investigation. Can you rebuild with debugging symbols, and get a
> core dump, to see where we are crashing?

https://bugs.busybox.net just died :(  I was in the middle of posting
a back trace form the core dump and bugzilla stopped working.  It
gives a perl error about DateTime.pm missing.

Any ideas?

Thanks

Martin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-12-01 23:02   ` Martin Bark
@ 2015-12-02  8:12     ` Thomas Petazzoni
  2015-12-02 21:50     ` Mike Frysinger
  1 sibling, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2015-12-02  8:12 UTC (permalink / raw)
  To: buildroot

Dear Martin Bark,

On Tue, 1 Dec 2015 23:02:21 +0000, Martin Bark wrote:

> On 1 December 2015 at 22:04,  <bugzilla@busybox.net> wrote:
> > https://bugs.busybox.net/show_bug.cgi?id=8296
> >
> > --- Comment #3 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2015-12-01 22:04:34 UTC ---
> > Thanks for the investigation. Can you rebuild with debugging symbols, and get a
> > core dump, to see where we are crashing?
> 
> https://bugs.busybox.net just died :(  I was in the middle of posting
> a back trace form the core dump and bugzilla stopped working.  It
> gives a perl error about DateTime.pm missing.

Can you try again?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (3 preceding siblings ...)
  2015-12-01 22:04 ` bugzilla at busybox.net
@ 2015-12-02 20:00 ` bugzilla at busybox.net
  2015-12-02 20:58 ` bugzilla at busybox.net
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-02 20:00 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #4 from Martin <martin@barkynet.com> ---
Created attachment 6241
  --> https://bugs.busybox.net/attachment.cgi?id=6241&action=edit
backtrace from npm core dump

I have attached a back trace from the npm crash.  I see
node::os::GetInterfaceAddresses is called so as an experiment i tried the
following javascript

    var os = require('os');
    var ifaces = os.networkInterfaces();
    console.log(ifaces);

This produces the same back trace as running npm.  Running this code using
glibc works.  So it seems the issues is npm is using os.networkInterfaces()
which works with glibc but not uclibc.

You can find the code for node::os::GetInterfaceAddresses in node.js v0.12.7
here
https://github.com/nodejs/node/blob/d3492aa7b386946e3a156440cad346e5b0a82838/src/node_os.cc#L225-L300.

The back trace shows the crash is in OneByteString which is called in several
places in node::os::GetInterfaceAddresses.  The data it's operating on comes
from a call to uv_interface_addresses() which is part libuv that's in node.js. 
The code for uv_interface_addresses() is here
https://github.com/nodejs/node/blob/d3492aa7b386946e3a156440cad346e5b0a82838/deps/uv/src/unix/linux-core.c#L786-L878.

I suspect uv_interface_addresses() is where the issue lies.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151202/48523521/attachment.html>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (4 preceding siblings ...)
  2015-12-02 20:00 ` bugzilla at busybox.net
@ 2015-12-02 20:58 ` bugzilla at busybox.net
  2015-12-02 21:51 ` bugzilla at busybox.net
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-02 20:58 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #5 from Arnout Vandecappelle <arnout@mind.be> ---
(In reply to Martin from comment #4)
> Created attachment 6241 [details]
> backtrace from npm core dump
> 
> I have attached a back trace from the npm crash.  I see
> node::os::GetInterfaceAddresses is called so as an experiment i tried the
> following javascript
> 
>     var os = require('os');
>     var ifaces = os.networkInterfaces();
>     console.log(ifaces);
> 
> This produces the same back trace as running npm.  Running this code using
> glibc works.  So it seems the issues is npm is using os.networkInterfaces()
> which works with glibc but not uclibc.
> 
> You can find the code for node::os::GetInterfaceAddresses in node.js v0.12.7
> here
> https://github.com/nodejs/node/blob/d3492aa7b386946e3a156440cad346e5b0a82838/
> src/node_os.cc#L225-L300.
> 
> The back trace shows the crash is in OneByteString which is called in
> several places in node::os::GetInterfaceAddresses.  The data it's operating
> on comes from a call to uv_interface_addresses() which is part libuv that's
> in node.js.  The code for uv_interface_addresses() is here
> https://github.com/nodejs/node/blob/d3492aa7b386946e3a156440cad346e5b0a82838/
> deps/uv/src/unix/linux-core.c#L786-L878.
> 
> I suspect uv_interface_addresses() is where the issue lies.

 Can you check if libuv's config.h has HAVE_IFADDRS_H ? If not, there is an
obvious bug in node::os::GetInterfaceAddresses: it will loop using the
uninitialized count variable when err == UV_ENOSYS. There's a missing return in
that condition.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-12-01 23:02   ` Martin Bark
  2015-12-02  8:12     ` Thomas Petazzoni
@ 2015-12-02 21:50     ` Mike Frysinger
  1 sibling, 0 replies; 14+ messages in thread
From: Mike Frysinger @ 2015-12-02 21:50 UTC (permalink / raw)
  To: buildroot

On 01 Dec 2015 23:02, Martin Bark wrote:
> https://bugs.busybox.net just died :(  I was in the middle of posting
> a back trace form the core dump and bugzilla stopped working.  It
> gives a perl error about DateTime.pm missing.

it's fine now.  i was in the middle of updating a lot of software and
forgot about the immediate impact on bugzilla.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151202/ec4e0e6e/attachment.asc>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (5 preceding siblings ...)
  2015-12-02 20:58 ` bugzilla at busybox.net
@ 2015-12-02 21:51 ` bugzilla at busybox.net
  2015-12-02 22:01 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-02 21:51 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #6 from Martin <martin@barkynet.com> ---
(In reply to Arnout Vandecappelle from comment #5)
> (In reply to Martin from comment #4)
> > Created attachment 6241 [details]
> > backtrace from npm core dump
> > 
> > I have attached a back trace from the npm crash.  I see
> > node::os::GetInterfaceAddresses is called so as an experiment i tried the
> > following javascript
> > 
> >     var os = require('os');
> >     var ifaces = os.networkInterfaces();
> >     console.log(ifaces);
> > 
> > This produces the same back trace as running npm.  Running this code using
> > glibc works.  So it seems the issues is npm is using os.networkInterfaces()
> > which works with glibc but not uclibc.
> > 
> > You can find the code for node::os::GetInterfaceAddresses in node.js v0.12.7
> > here
> > https://github.com/nodejs/node/blob/d3492aa7b386946e3a156440cad346e5b0a82838/
> > src/node_os.cc#L225-L300.
> > 
> > The back trace shows the crash is in OneByteString which is called in
> > several places in node::os::GetInterfaceAddresses.  The data it's operating
> > on comes from a call to uv_interface_addresses() which is part libuv that's
> > in node.js.  The code for uv_interface_addresses() is here
> > https://github.com/nodejs/node/blob/d3492aa7b386946e3a156440cad346e5b0a82838/
> > deps/uv/src/unix/linux-core.c#L786-L878.
> > 
> > I suspect uv_interface_addresses() is where the issue lies.
> 
>  Can you check if libuv's config.h has HAVE_IFADDRS_H ? If not, there is an
> obvious bug in node::os::GetInterfaceAddresses: it will loop using the
> uninitialized count variable when err == UV_ENOSYS. There's a missing return
> in that condition.

HAVE_IFADDRS_H is defined at the top of the linux-core.c file.  I spotted this
code yesterday but a second look today and I see the issue.  The following snip
is from 

#define HAVE_IFADDRS_H 1

#ifdef __UCLIBC__
# if __UCLIBC_MAJOR__ < 0 || __UCLIBC_MINOR__ < 9 || __UCLIBC_SUBLEVEL__ < 32
#  undef HAVE_IFADDRS_H
# endif
#endif


I think this is trying to say if uclibc version is < 0.9.32 but the logical or
is wrong, it should be and.  It means HAVE_IFADDRS_H is indeed undefined.  If i
change this to logical and then npm works.

Also, this code is not in node.js 0.10.40 which is why it works.

I'll work on a patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (6 preceding siblings ...)
  2015-12-02 21:51 ` bugzilla at busybox.net
@ 2015-12-02 22:01 ` bugzilla at busybox.net
  2015-12-14 15:40 ` bugzilla at busybox.net
  2015-12-23 17:48 ` bugzilla at busybox.net
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-02 22:01 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #7 from Arnout Vandecappelle <arnout@mind.be> ---
Preferably make two patches for upstream: one that fixes the SEGV in
node::os::GetInterfaceAddresses by adding the missing return (that's a patch we
don't really need in buildroot), and one patch that adds support for uClibc-ng.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (7 preceding siblings ...)
  2015-12-02 22:01 ` bugzilla at busybox.net
@ 2015-12-14 15:40 ` bugzilla at busybox.net
  2015-12-23 17:48 ` bugzilla at busybox.net
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-14 15:40 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

--- Comment #8 from Martin <martin@barkynet.com> ---
I have submitted 2 patches upsteam:

1) https://github.com/nodejs/node/pull/4272 - Fixes the crash in node.js
2) https://github.com/libuv/libuv/pull/653 - Fixes the underlying issues of
uClibc-ng support in libuv

I have tested these patches for node.js 0.12.9, 4.2.3 and 5.2.0 and it fixes
the issues.  I'll submit patches to buildroot tonight.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [Bug 8296] nodejs 0.12.7 - npm crashes (seg core dump)
  2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
                   ` (8 preceding siblings ...)
  2015-12-14 15:40 ` bugzilla at busybox.net
@ 2015-12-23 17:48 ` bugzilla at busybox.net
  9 siblings, 0 replies; 14+ messages in thread
From: bugzilla at busybox.net @ 2015-12-23 17:48 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=8296

Thomas Petazzoni <thomas.petazzoni@free-electrons.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---
Fixed by
https://git.busybox.net/buildroot/commit/?id=5bba3ca130249a2557f250095ccfccb6aadb8576.
Thanks Martin!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-12-23 17:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-17 17:13 [Buildroot] [Bug 8296] New: nodejs 0.12.7 - npm crashes (seg core dump) bugzilla at busybox.net
2015-12-01 21:41 ` [Buildroot] [Bug 8296] " bugzilla at busybox.net
2015-12-01 21:42 ` bugzilla at busybox.net
2015-12-01 21:49 ` bugzilla at busybox.net
2015-12-01 22:04 ` bugzilla at busybox.net
2015-12-01 23:02   ` Martin Bark
2015-12-02  8:12     ` Thomas Petazzoni
2015-12-02 21:50     ` Mike Frysinger
2015-12-02 20:00 ` bugzilla at busybox.net
2015-12-02 20:58 ` bugzilla at busybox.net
2015-12-02 21:51 ` bugzilla at busybox.net
2015-12-02 22:01 ` bugzilla at busybox.net
2015-12-14 15:40 ` bugzilla at busybox.net
2015-12-23 17:48 ` bugzilla at busybox.net

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.