Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Iterator.seek crashes Node.js when supplying a Buffer #37

Merged
merged 2 commits into from Jul 16, 2012

Conversation

Projects
None yet
2 participants
Collaborator

justmoon commented Jul 14, 2012

The pull request contains test cases demonstrating the problem. Buffer::HasInstance seems to fail. Tested on Node.js 0.8.2.

I haven't been able to figure out what's going wrong yet, so I'm putting this up here for now. Feel free to chime in with your thoughts.

moon@Dalilah:/var/www/node-leveldb$ make test
if [ ! -d ./build ]; then node-waf configure; fi
node-waf build
Waf: Entering directory `/var/www/node-leveldb/build'
Waf: Leaving directory `/var/www/node-leveldb/build'
'build' finished successfully (0.035s)
coffee --bare --compile --output lib src/coffee
path.exists is now called `fs.exists`.
rm -rf tmp
mkdir -p tmp

  ...........path.existsSync is now called `fs.existsSync`.
...............node: ../src/cpp/iterator.cc:173: static v8::Handle<v8::Value> node_leveldb::JIterator::Seek(const v8::Arguments&): Assertion `Buffer::HasInstance(args[0])' failed.
Collaborator

justmoon commented Jul 14, 2012

Fix added, please review and pull! The problem was that the previous code for toBuffer returned undefined if Buffer.isBuffer returned true.

@mikepb mikepb added a commit that referenced this pull request Jul 16, 2012

@mikepb mikepb Merge pull request #37 from justmoon/iterbuferr
Iterator.seek crashes Node.js when supplying a Buffer
2a28a0f

@mikepb mikepb merged commit 2a28a0f into my8bird:master Jul 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment