Closed webholics closed 13 years ago
Hi Mario, thanks for reporting this. Could you perhaps run this through valgrind? What do uname -a
and cat /etc/issue
say?
uname -a
Linux chilitweets 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux
cat /etc/issue
Ubuntu 10.04.1 LTS \n \l
Valgrind memory error:
==2616== Memcheck, a memory error detector ==2616== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==2616== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==2616== Command: node test.js ==2616== Invalid free() / delete / delete[] ==2616== at 0x4024B3A: free (vg_replace_malloc.c:366) ==2616== by 0x7AC134C: (anonymous namespace)::FreeMemory(char*, void*) (in /usr/local/lib/node/.npm/iconv/1.1.0/package/iconv.node) ==2616== by 0x81515B3: node::Buffer::Replace(char*, unsigned int, void (*)(char*, void*), void*) (node_buffer.cc:209) ==2616== by 0x81539B7: node::Buffer::~Buffer() (node_buffer.cc:200) ==2616== by 0x81EB133: v8::internal::GlobalHandles::PostGarbageCollectionProcessing() (in /usr/local/bin/node) ==2616== Address 0x74dd6e0 is 0 bytes inside a block of size 16 free'd ==2616== at 0x4024B3A: free (vg_replace_malloc.c:366) ==2616== by 0x4024FBD: realloc (vg_replace_malloc.c:525) ==2616== by 0x7AC0F33: (anonymous namespace)::Iconv::Convert(char*, unsigned int) (in /usr/local/lib/node/.npm/iconv/1.1.0/package/iconv.node) ==2616== by 0x7AC1296: (anonymous namespace)::Iconv::Convert(v8::Arguments const&) (in /usr/local/lib/node/.npm/iconv/1.1.0/package/iconv.node) ==2616== by 0x81B7601: v8::internal::Builtin_HandleApiCall(v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>) (in /usr/local/bin/node) ==2616==
Mario, could you post your test script? I can't reproduce it no matter how hard I pummel it.
Unfortunately I don't have a simple test case and I'm not sure when and why exactly the crash happens. I'm creating >100 Iconv instances and am calling convert() a lot in a short amount of time.
I'm closing the issue because I can't reproduce it. My pummel script is here if you're interested. Feel free to reopen the issue if you have suggestions or additional information.
Hi, I have the same error on ubuntu (tried node 0.4.6 and 0.4.7) but not on OSX (0.4.6). It happens when using a patched version of index.js in https://github.com/dvv/simple-geoip :
patch1: var Iconv = require('iconv').Iconv , iconv = new Iconv('iso-8859-1', 'utf-8');
and
patch2: /OLD/ //record.city_name = buffer.toString('utf8', b, e); /Patch/ record.city_name = iconv.convert(buffer.slice(b,e)).toString('utf8');
any idea?
FYI, it works a few times and then fail. Moreover, everything works properly when removing call to iconv.convert, so I think it's not the buffer. (using: record.city_name = buffer.slice(b,e).toString('utf8');)
Anh-Tuan, can you wrap this up in a test case? What version of Ubuntu are you using, by the way?
wget http://dl.dropbox.com/u/1435930/geoip.zip unzip geoip.zip cd geoip wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz gzip -f -d GeoLiteCity.dat.gz node node-iconv-fail-testcase.js
Ubuntu 10.04 LTS
I'll be damned, it works (or rather, it doesn't). Not sure what's causing it but I'll dive in. Thanks!
Thank you! FYI: iconv --version OSX: iconv (GNU libiconv 1.11) Ubuntu: iconv (Ubuntu EGLIBC 2.11.1-0ubuntu7.8) 2.11.1
v1.1.1 contains this fix and has been uploaded to npm, by the way.
Great! Dank je wel!
Hi guys i got the same error but i do not use iconv or anything like it, i just use openlayers and oracle modules. please help me.
In node >0.4.6 I'm getting the following exception regularly:
Any ideas?