It is very unlikely that there is a bug in the malloc code, so this is probably either a memory corruption bug or incorrect use of malloc. Try to build with assertions and safe heap, see https://github.com/kripken/emscripten/wiki/Debugging for more info.
On Wed, Apr 23, 2014 at 6:10 AM, Ed Costello <[email protected]>wrote: > > After rechecking it seems there is another malloc function in the file, so > it probably is calling the correct one. > > > On Wednesday, April 23, 2014 11:46:25 AM UTC+2, Ed Costello wrote: >> >> Hi, >> >> I have compiled Csound using the latest sdk, it all seems to run fine >> until there is a call to malloc. Here is the stack trace: >> >> abort@file:///Volumes/Data/Dropbox/Programming/csound/ >> emscripten/build/libcsound.js:575298 >> _abort@file:///Volumes/Data/Dropbox/Programming/csound/ >> emscripten/build/libcsound.js:8247 >> _malloc@file:///Volumes/Data/Dropbox/Programming/csound/ >> emscripten/build/libcsound.js:563314 >> _calloc@file:///Volumes/Data/Dropbox/Programming/csound/ >> emscripten/build/libcsound.js:566728 >> _mcalloc@file:///Volumes/Data/Dropbox/Programming/csound/ >> emscripten/build/libcsound.js:104770 >> _alloc_channel@file:///Volumes/Data/Dropbox/ >> Programming/csound/emscripten/build/libcsound.js:40455 >> _create_new_channel@file:///Volumes/Data/Dropbox/ >> Programming/csound/emscripten/build/libcsound.js:35994 >> _csoundGetChannelPtr@file:///Volumes/Data/Dropbox/ >> Programming/csound/emscripten/build/libcsound.js:34928 >> _csoundSetControlChannel@file:///Volumes/Data/Dropbox/ >> Programming/csound/emscripten/build/libcsound.js:56186 >> _CsoundObj_setControlChannel@file:///Volumes/Data/Dropbox/ >> Programming/csound/emscripten/build/libcsound.js:9609 >> ccallFunc@file:///Volumes/Data/Dropbox/Programming/ >> csound/emscripten/build/libcsound.js:612 >> cwrap/<@file:///Volumes/Data/Dropbox/Programming/csound/ >> emscripten/build/libcsound.js:627 >> CsoundObj/this.setNamedControlChannelValue@file:///Volumes/Data/Dropbox/ >> Programming/csound/emscripten/src/CsoundObj.js:69 >> OSC/this.connect/socket.onmessage@file:///Volumes/ >> Data/Dropbox/Programming/LACDemo/javascripts/OSCHelper.js:30 >> >> I have noticed that it says that the malloc implementation in the source >> file is only a dummy implementation: >> >> function _malloc(bytes) { >> /* Over-allocate to make sure it is byte-aligned by 8. >> * This will leak memory, but this is only the dummy >> * implementation (replaced by dlmalloc normally) so >> * not an issue. >> */ >> var ptr = Runtime.dynamicAlloc(bytes + 8); >> return (ptr+8) & 0xFFFFFFF8; >> } >> >> Is my program not getting the correct malloc function? >> Ed >> >> -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
