Segmentation fault in data_objects on new hosting (Nginx+Passenger) #56

Closed
crantok opened this Issue May 21, 2013 · 12 comments

Projects

None yet

3 participants

@crantok
crantok commented May 21, 2013

I've just tried moving my Sinatra app to new hosting. The environment:

  • "Passenger 3.0.11 (nginx 1.0.10/Ruby 1.9.3)".
  • ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
  • CentOS release 6.4 (Final)

DataMapper seems to access the database okay. (If I deliberately use a bad password then I get an error message saying MySQL denied access to the user.) And I can define my models, but the first time I try to access any data in the DB (e.g. by MyModel.count) I get a segmentation fault.

/home/myuser/webapps/myapp/gems/gems/data_objects-0.10.12/lib/data_objects/connection.rb:79: [BUG] Segmentation fault

Does this look like data_object's problem? (Sorry if that's a dumb question. I haven't encountered a segmentation fault in Ruby before.) What other information would be useful for me to supply here?

This app works on my previous hosting and on my laptop but I'm using Thin rather than Passenger on those systems.

@godfat
godfat commented May 21, 2013

I am running ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.2.1] and seeing a segfault after doing a select with ALTER TABLE with postgres as well.

But it looks to me it's more a Ruby bug since it segfaulted at lines in Ruby code instead of native code. However it's actually hard to tell. I don't yet have time to figure out what's going on, but want to let people know we have similar issues. (though it might not be related)

@dbussink
Member

Could any one of you create a small repro for this to reproduce the problem? Ideally just a script with no dependencies except for DataObjects itself. I'm sure it would be fairly easy to fix then.

@crantok
crantok commented May 21, 2013

@dbussink I'll try to do that tomorrow morning (I'm in the UK) and post a link here. This is my first DataMapper app and I'm relatively new to Ruby. If I get stuck then I'll mention that here too.

@godfat
godfat commented May 22, 2013

Here it is. https://gist.github.com/godfat/5626115
So it looks like it crashed at execute_reader which is a C function.

@godfat
godfat commented May 22, 2013

Could it be a postgres change? I am using psql --version psql (PostgreSQL) 9.2.4

@crantok
crantok commented May 22, 2013

I've uploaded a script that's based on godfat's. https://gist.github.com/crantok/5626645

One thing I forgot:
Server version: 5.5.30-30.1 Percona Server (GPL), Release rel30.1, Revision 465

@dbussink
Member

@crantok Looks like your issue is a different one from @godfat, they don't seem to be related. I've managed to reproduce the issue of @godfat, but the one @crantok reported seems to run fine for me.

@crantok
crantok commented May 22, 2013

That's a pity. Any idea what my next step should be? I wonder whether it's worth pointing my host's support at this thread.

@dbussink
Member

I don't know if it's possible to set up a machine somewhere that shows this problem? If you could get this crash reproduced in for example an isolated virtual machine that I could get access to, that would be great. That's probably the easiest way to get the information needed to fix this issue.

@dbussink dbussink added a commit that referenced this issue May 22, 2013
@dbussink dbussink Fix segfault when running command through execute_reader
In this case we just return an empty reader, since that seems to be the
most sensible. Not all drivers support this distinction anyway, so
raising an exception here is hard. Also since the query does succeed,
the exception could be confusing as in that it actually executes while
that was not expected.

Related to #56
b7ba9a8
@crantok
crantok commented May 22, 2013

Providing a VM is beyond my abilities. I've raised a ticket with my host to see if they can help in this regard.

@crantok
crantok commented May 27, 2013

I've found out that there was a problem with the gem installation on my hosting account. Reinstallation killed the problem so my original issue was a phantom. I haven't closed the issue in case you still need it open for the postgres segfault.

@dbussink
Member

Ah, I'm closing it then, since the postgres segfault was fixed.

@dbussink dbussink closed this May 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment