fuwaneko / node-protobuf

Google Protocol Buffers wrapper for Node.js [UNMAINTAINED]
179 stars 42 forks source link

Segmentation fault #11

Closed Esya closed 10 years ago

Esya commented 11 years ago

Using node v0.10.21, protoc 2.5.0

If I compile any proto file, then

pb = require('node-protobuf').Protobuf;
desc = fs.readFileSync('protos/test.desc');
p = new pb(desc);
p.Serialize({},"Schema");

I get a segfault right away

fuwaneko commented 11 years ago
  1. Is empty object a valid object for the "Schema"?
  2. What are your OS and compiler?
Esya commented 10 years ago

Hmm, so it was a week ago I don't remember how exactly I did the test. But if the Schema is not in the desc file, it segs fault.

OSX 10.8.3, protoc 2.5.0 as the compiler

fuwaneko commented 10 years ago

@Esya Well, what did you expect if you try to use incorrect desc file? But I guess I should add check for this.

Esya commented 10 years ago

Well obviously not a Seg fault first of all. This should never happen.

2013/11/4 Dmitry Gorbunov notifications@github.com

@Esya https://github.com/Esya Well, what did you expect if you try to use incorrect desc file? But I guess I should add check for this.

— Reply to this email directly or view it on GitHubhttps://github.com/fuwaneko/node-protobuf/issues/11#issuecomment-27686251 .

fuwaneko commented 10 years ago

@Esya should be fixed in 1.0.7

sortega commented 10 years ago

I have the same problem with 1.0.7. (Node 0.10.18, protoc 2.4.1).

fuwaneko commented 10 years ago

@sortega could you please post your code and proto file?

sortega commented 10 years ago

I've created a minimal node module that fails with segfault here https://dl.dropboxusercontent.com/u/11539316/protofail.tar.gz

sortega commented 10 years ago

More details: OS X 10.9

fuwaneko commented 10 years ago

@sortega hmm, it works on my PC, Node 10.21 and libprotobuf 2.5.0. Maybe it's Mac OS related, but I don't have Mac to check it thoroughly.

sortega commented 10 years ago

Might be as I've updated to OS X mavericks very recently. (I've already regretted it)

fuwaneko commented 10 years ago

I don't see this error on 10.9. Probably fixed.