-
Notifications
You must be signed in to change notification settings - Fork 7.3k
malloc error under OS X when installed from source #3165
Comments
Cannot reproduce.
Can you post the output of
|
My compiler appears to be identical:
Here's the output from |
Is the compiled binary 32 or 64 bits? |
64, same as yours. On Apr 24, 2012, at 11:52 AM, Ben Noordhuisreply@reply.github.com wrote:
|
Okay, in that case it must be something with your local setup because it works for me. Valgrind is not complaining either. |
Alright, but it's not just me; Googling the exact error message yields several other reports. Here's what gdb gives me when I
I hope that helps. |
By the way, additional testing finds that the error is not deterministic. Running my simple Also, the error appears to occur only in node 0.6.12+. |
Trevor, is that the whole backtrace?
I ran it 100 times in a loop (added a one second timeout). It never segfaults or aborts. |
Yes, that's the entire backtrace corresponding to the "incorrect checksum for freed object" error. Running it a few more times, here's another one:
|
Okay, that's odd because
I speculate that something corrupts the free list some time before the parser allocates scratch space. |
Sorry, could you tell me precisely how you want me to do the build?
Done, check it out. |
Run configure with --debug (you'll probably have to hack the brew formula for that).
I think you have a busted valgrind install because it's failing inside valgrind itself.... That illegal opcode it's complaining about is an IRET (interrupt return), the address (0x1000) is conspicuous too. |
Hmm, well it does report problems for even |
OK, I did a |
Trevor, I believe brew installs a node_g binary (that's the one with debug symbols) if you run the formula with |
Huh, so it looks like there's a bug in Node's build script: the In any event, once I found |
Thanks, Trevor. I've been going over the code but I can't find anything that could reasonably explain the behavior that you're seeing. Does it also happen when you build 0.6.15 from source yourself (i.e. from the nodejs.org tarball or the repository)? |
Yes. I just tried cloning the repo, checking out 0.6.16, and running
Then I copied
Would you like another gdb backtrace? |
Yes please. Is this version of node built with the same compiler? |
No, I found my way to Xcode 4.3.2's command line tools installer, which means my LLVM build is slightly newer than previously reported:
Here's the gdb backtrace for the malloc error: https://gist.github.com/2603860 And here's another that (I think) corresponds to the segmentation fault error: https://gist.github.com/2603829 |
This is something of a long shot but does -fno-strict-aliasing resolve the issue? Here is a patch: diff --git a/deps/v8/SConstruct b/deps/v8/SConstruct
index fc67dc5..22e2242 100644
--- a/deps/v8/SConstruct
+++ b/deps/v8/SConstruct
@@ -928,6 +928,7 @@ def GuessVisibility(env):
def GuessStrictAliasing(env):
+ return 'off'
# There seems to be a problem with gcc 4.5.x.
# See http://code.google.com/p/v8/issues/detail?id=884
# It can be worked around by disabling strict aliasing. Make sure you do a |
Interestingly, it does not happen on master (0.7.x), but it is still happening under 0.6.17. Trying the patch now... |
The patch had no apparent effect. Any other ideas? |
Just encountered the same issue with node v.8.1 installing from source (via Homebrew). Uninstalled it and used the OS X installer from nodejs.org and it works fine. Any word as to what could have caused this? |
I can speculate (different compilers, different compiler flags, etc.) but frankly, I've stopped second-guessing what brew does. Second-guessing and supporting, really. I used to get a lot of bug reports from brew users whose problems went away the moment they started using the official build. |
@bnoordhuis But we've established that Homebrew isn't doing anything special; it just runs Having said that, I'm unable to replicate the issue as of 0.8.x. I've installed it via Homebrew with no apparent problems. @jcrugzz, can you be more specific about what you're encountering? It may be a separate issue. |
@TrevorBurnham Yes I did speak to soon as the problem did not go away as I wished it did hah. I believe I found the root of my problem. I was doing the following:
All i needed to add was a |
I experienced the exact error described here recently:
Steps to replicate:
brew install node
(as of Node 0.6.15); this just does a simple install from sourcenode -e "(require('fs')).watch('a.txt', function(){});"
(in a folder where a.txt exists)When Node is installed via the Mac installer, the error does not occur and
fs.watch
operates normally.Related: #2061. Pinging @bnoordhuis.
The text was updated successfully, but these errors were encountered: