Incorrect checksum for freed object

When sending data to my expressjs application, this is what I get:

node(58287,0x7fff771ad960) malloc: *** error for object 0x7ff8a8600c58: incorrect
    checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Any idea why?

Update:

Here is the code:

Client side:

$.ajax({
 url: 'user/' + id,
 type: 'POST',
 dataType:'JSON',
 data: JSON.stringify(data),
 success: function(response){
  console.log(response);
 }      
});

Server side:

app.post('/user/:id', function(req,res){
  var id = req.params.id;
  console.log(data);
});

When I use JSON.stringify on the client side, I push this strange error:

node (58461,0x7fff771ad960) malloc: * error for object 0x7fa861d00e28: incorrect checksum for the freed object - the object was probably changed after it was released. * set breakpoint in malloc_error_break to debug interrupt trap: 6

When I do not use JSON.stringify on the client side, I get "null" strings on the server side.

, ?

+5
5

. :

Node.js , - OS X (., , issue 2061). , . , Node, http://nodejs.org/#download Macintosh.

Node .

+2

nodejs . (, expressjs - , , expressjs.)

JavaScript. , , , . , .

+2

, Node.js MacPorts 0.8.9_0 0.8.10_1 .
, , , (http://blog.nodejs.org/2012/09/25/ node-v0-8-10-stable/).

+1

( - , - - jquery, node, express), :

, , , malloc ( № 1), , , jquery json .

# 2 null --> "null" . , , , (.. , json), - . , /.

, , , :

:

$.post({
   url: 'user/' + id,
   data: {workaround: JSON.stringify(data)}, // no null strings this way
   success: function(response){
      console.log(response);
   }      
});

:

app.post('/user/:id', function(req,res){
   var id = req.params.id;
   var data = JSON.parse(req.body.workaround); // unwrap
   console.log(data);
});

If I find time, I will investigate and try to publish a bug report somewhere (this is a problem when you do not know whose error it is ...), try to do this as well.

0
source

You invoke the server console console.log on "data" that is not defined in the scope of your example.

0
source

All Articles