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

malloc error #304

Open
p3k opened this issue Mar 21, 2016 · 2 comments
Open

malloc error #304

p3k opened this issue Mar 21, 2016 · 2 comments

Comments

@p3k
Copy link

p3k commented Mar 21, 2016

When I try to do something like this (i.e. basic stuff)…

var java = require("java");
var list = java.newInstanceSync("java.util.ArrayList");
list.size();

…I get an error like this:

node(53013,0x7fff7bf5e000) malloc: *** error for object 0x10c329420: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

My setup:

→ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.3
BuildVersion:   15D21

→ node -v
v4.3.2

→ node ./node_modules/java/findJavaHome.js
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/

→ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/

→ cat /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Info.plist | grep JNI -3
                <key>JVMCapabilities</key>
                <array>
                        <string>CommandLine</string>
                        <string>JNI</string>
                </array>
                <key>JVMMinimumFrameworkVersion</key>
                <string>13.2.9</string>

→ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

→ echo ${#CXX}
0

→ gcc --version
gcc (MacPorts gcc49 4.9.3_0) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Any idea what’s going wrong? Please let me know if I should add further information to pin down the issue.

@p3k
Copy link
Author

p3k commented Mar 21, 2016

Oh, and if I am using export CXX=gcc (see version info above) I am getting the same errors as here for the three lines:

dyld: lazy symbol binding failed: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_
  Referenced from: ./node_modules/java/build/Release/nodejavabridge_bindings.node
  Expected in: dynamic lookup

dyld: Symbol not found: __ZNSt8__detail15_List_node_base7_M_hookEPS0_
  Referenced from: ./node_modules/java/build/Release/nodejavabridge_bindings.node
  Expected in: dynamic lookup

Trace/BPT trap: 5

@joeferner
Copy link
Owner

I'm not really an OSX guy but how did you install gcc? When I did have access to OSX I tested it with the gcc that comes with Xcode.

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

2 participants