Bug 720991

Summary: Segmentation Fault during Roles - Add Permission
Product: Red Hat Satellite Reporter: Brad Buckingham <bbuckingham>
Component: WebUIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: cwelton, lzap, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 17:49:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 747354    

Description Brad Buckingham 2011-07-13 13:38:29 UTC
Description of problem:

When attempting to Add Permission to a Role in the UI using an F14 development (git) install, we have observed fairly consistent segmentation faults from Ruby/Rails.

Version-Release number of selected component (if applicable):
git master

How reproducible:
fairly reproducable in F14... not observed with F15

Steps to Reproduce:
1. create a new role from UI (Administration -> Roles -> New Role)
2. select the role just created (opening the edit pane)
3. click 'Add Permission'
  
Actual results:
Ruby/Rails segmentation fault. We have observed the fault occuring in multiple places and below are several that we've seen.  The first one is seen most frequently.

example 1:
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/remove_method.rb:3: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

example 2:
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/module/remove_method.rb:9: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

example 3:
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/autosave_association.rb:163: [BUG] rb_gc_mark(): unknown data type 0x2b(0x51187a0) non object
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

example 4:
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/inflector/inflections.rb:151: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

example 5:
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/core_ext/class/attribute.rb:73: [BUG] rb_gc_mark(): unknown data type 0x37(0x493e8e0) non object
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]

Expected results:
Form for adding a permission is displayed.

Additional info:

Based on some initial debugging, it appears that if the code below is omitted, the segmentation fault is no longer generated.  This should be further investigated.

File: src/lib/util/model_util.rb 

Code:
      # explicitly load all available model classes
      Dir.foreach("#{Rails.root}/app/models") { |f| require f if f =~ /.*\.[rR][bB]/ }

Comment 1 Lukas Zapletal 2011-07-13 14:20:03 UTC
The code is for loading all the models, we need the list of all model classes for table name to class translation and vice versa.

The workaround is to change this line

Dir.foreach("#{Rails.root}/app/models") { |f| require f if f =~ /.*\.[rR][bB]/ }

to

require 'app/models/kp_environment'
...
... all the models for which users are allowed to create permissions
...

Comment 2 Lukas Zapletal 2011-07-20 08:14:47 UTC
@Brad - Do you want me to do the fix in the git?

Comment 3 Brad Buckingham 2011-07-20 12:15:25 UTC
@Lukáš, since you are most familiar with that codebase and the changes coming, please do. Thanks!

Comment 4 Lukas Zapletal 2011-07-21 14:09:12 UTC
ade0f49 720991 - Segmentation Fault during Roles - Add Permission

@Brad - can you verify its gone for you? I was not able to reproduce on F15, but if you dont have F14 devsetup, I can provision a box for this one.

Comment 5 Corey Welton 2011-07-22 15:27:49 UTC
I am not seeing this occur on F14 anymore.  Will wait for Brad's feedback and then close it out.

Comment 6 Brad Buckingham 2011-07-25 14:28:58 UTC
I also was unable to repro the issue on F14, using the latest changes.  :)

Comment 7 Corey Welton 2011-07-25 15:21:18 UTC
QA Verified.

Comment 10 Mike McCune 2013-08-16 18:15:13 UTC
getting rid of 6.0.0 version since that doesn't exist