unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Jeremy Evans <code@jeremyevans.net>
To: Eric Wong <e@80x24.org>
Cc: Pere Joan Martorell <pere.joan@camaloon.com>,
	Philip Cunningham <philip@irisconnect.co.uk>,
	Jonathan del Strother <maillist@steelskies.com>
Subject: Re: Random crash when sending USR2 + QUIT signals to Unicorn process
Date: Fri, 14 Jul 2017 15:50:15 -0700	[thread overview]
Message-ID: <20170714225015.GD68067@jeremyevans.local> (raw)
In-Reply-To: <20170714211608.GA3272@starla>

On 07/14 09:16, Eric Wong wrote:
> Pere Joan Martorell <pere.joan@camaloon.com> wrote:
> > I suspect that the conflicting gem was 'sequel_pg' (sequel_pg
> > overwrites the inner loop of the Sequel postgres adapter row fetching
> > code with a C version. The C version is significantly faster than the
> > pure ruby version that Sequel uses by default), but given I didn't
> > remove these gems one by one I can't completely ensure that.
> > 
> > If the problem reemerges I'll keep you informed.
> > 
> > Thanks!! :)
> Thanks for the info.  I've added Jeremy Evans, the author of
> sequel_pg to the Cc: even though I think he reads this list...
> Anyways, I think I've spotted one potential bug in sequel_pg
> w.r.t. RB_GC_GUARD usage, and the fix is below:
>   git clone https://github.com/jeremyevans/sequel_pg && cd sequel_pg
>   curl https://80x24.org/spew/20170714210918.3332-1-e@80x24.org/raw | git am
> (more in-depth explanation is in the commit message)
> Pere: perhaps you can give it a shot
> Keep in mind I've only compile-tested this.  I didn't find
> automated tests in the code and I don't have a usable Postgres
> instance, at the moment.


Thanks for this patch.  I'm not an RB_GC_GUARD expert, but the changes
look fine to me. The existing RB_GC_GUARD calls were added by me in
2012 to fix an earlier segfault.[1] This is the first reported
RB_GC_GUARD-related segfault in sequel_pg since then.

Pere, I would appreciate if you could test this patch and see if it
fixes your issue.  I will also test it and will release a new sequel_pg
version with this patch if it fixes the issue.


[1] https://github.com/jeremyevans/sequel_pg/commit/15edb132887d9b5292cad419fc7692ed5cd4b01b.diff

  reply	other threads:[~2017-07-14 22:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 18:48 Random crash when sending USR2 + QUIT signals to Unicorn process Pere Joan Martorell
2017-07-13 19:34 ` Eric Wong
2017-07-14 10:21   ` Pere Joan Martorell
2017-07-14 21:16     ` Eric Wong
2017-07-14 22:50       ` Jeremy Evans [this message]
2017-07-15  0:15         ` Eric Wong
2017-07-15  1:34           ` Jeremy Evans
2017-07-15  4:45             ` Eric Wong
2017-07-15  7:56               ` Jeremy Evans
2017-07-17 14:32                 ` Jeremy Evans
2017-07-24  1:25                   ` Eric Wong
2017-08-07  6:16                     ` Jeremy Evans
2017-08-07 20:18                       ` Eric Wong
2017-10-03 14:52                         ` Xuanzhong Wei
2017-10-03 17:15                           ` Eric Wong
2017-10-03 18:20                             ` Xuanzhong Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170714225015.GD68067@jeremyevans.local \
    --to=code@jeremyevans.net \
    --cc=e@80x24.org \
    --cc=maillist@steelskies.com \
    --cc=pere.joan@camaloon.com \
    --cc=philip@irisconnect.co.uk \
    --cc=unicorn-public@bogomips.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).