alassek / activerecord-pg_enum

Integrate PostgreSQL's enumerated types with the Rails enum feature
MIT License
168 stars 10 forks source link

Segmentation fault for Ruby 3.0 #18

Closed sveredyuk closed 3 years ago

sveredyuk commented 3 years ago

Hi, seems like I found segfault for Ruby 3.0

When trying to load rails 6.1.1 environment:

/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activerecord-pg_enum-1.2.2/lib/active_record/pg_enum/postgresql_adapter.rb:5: [BUG] Segmentation fault at 0x0000000300000004
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.
alassek commented 3 years ago

I've seen this happen in CI but haven't been able to repro locally so far. The line of code that is segfaulting is a totally standard module include, so I don't have the slightest idea what could be going wrong here.

RobertGauld commented 3 years ago

Me too. Rails 6.1.3, Ruby 3.0.0p0. Unfortunately very intermittent. Most of the time an uninstall then install of the gem works to clear it.

alassek commented 3 years ago

I've adding Ruby 3.0.1 to CI, and so far have not been able to reproduce this. Can any of you?

RobertGauld commented 3 years ago

It appears to have been behaving recently, possibly some tool/library from elsewhere got updated.

alassek commented 3 years ago

I'm going to close this for now, if someone can provide reproduction steps I'll take a closer look. My gut tells me this was probably a bug in 3.0.0 that got patched. There is no legitimate reason for a module include to segfault.