Jira (FACT-2554) Distro-packaged facter (3.14.2) on Fedora 31 segfault on external fact from .yaml

12 views
Skip to first unread message

bbradley (Jira)

unread,
Apr 14, 2020, 9:02:03 PM4/14/20
to puppe...@googlegroups.com
bbradley created an issue
 
Facter / Bug FACT-2554
Distro-packaged facter (3.14.2) on Fedora 31 segfault on external fact from .yaml
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: facter_f31_barf.txt
Created: 2020/04/14 6:01 PM
Environment:

Stock Fedora 31 install with distro-provided versions of facter, puppet and ruby...

root@saltmaster01:0 ~ # uname -a
Linux saltmaster01.int 5.5.15-200.fc31.x86_64 #1 SMP Thu Apr 2 19:16:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
 
root@saltmaster01:0 ~ # dnf list installed | grep fact
facter.x86_64                        3.14.2-1.fc31                     @fedora  
ruby-facter.x86_64                   3.14.2-1.fc31                     @fedora  
 
root@saltmaster01:0 ~ # dnf list installed | grep puppet
puppet.noarch                        5.5.10-9.fc31                     @updates 
puppet-headless.noarch               5.5.10-9.fc31                     @updates
 
root@saltmaster01:0 ~ # dnf list installed | grep ruby
libselinux-ruby.x86_64               2.9-5.fc31                        @fedora  
ruby.x86_64                          2.6.5-124.fc31                    @updates 
ruby-augeas.x86_64                   0.5.0-21.fc31                     @fedora  
ruby-facter.x86_64                   3.14.2-1.fc31                     @fedora  
ruby-libs.x86_64                     2.6.5-124.fc31                    @updates 
rubygem-bigdecimal.x86_64            1.4.1-124.fc31                    @updates 
rubygem-did_you_mean.noarch          1.3.0-124.fc31                    @updates 
rubygem-io-console.x86_64            0.4.7-124.fc31                    @updates 
rubygem-irb.noarch                   1.0.0-124.fc31                    @updates 
rubygem-json.x86_64                  2.2.0-201.fc31                    @fedora  
rubygem-multi_json.noarch            1.13.1-4.fc31                     @fedora  
rubygem-openssl.x86_64               2.1.2-124.fc31                    @updates 
rubygem-pathspec.noarch              0.2.1-5.fc31                      @fedora  
rubygem-psych.x86_64                 3.1.0-124.fc31                    @updates 
rubygem-rdoc.noarch                  6.1.2-124.fc31                    @updates 
rubygem-rgen.noarch                  0.8.4-2.fc31                      @fedora  
rubygem-ruby-shadow.x86_64           2.5.0-10.fc31                     @fedora  
rubygems.noarch                      3.0.3-124.fc31                    @updates 
rubypick.noarch                      1.1.1-11.fc31                     @fedora

Priority: Normal Normal
Reporter: bbradley

Segfault on loading a simple YAML file as external fact...

root@saltmaster01:0 facts.d # pwd
/etc/facter/facts.d
 
root@saltmaster01:0 facts.d # cat hello.yaml 
---
hello: world
 
root@saltmaster01:0 facts.d # facter --debug
2020-04-15 00:49:57.684971 INFO  puppetlabs.facter - executed with command line: --debug.
2020-04-15 00:49:57.685251 DEBUG leatherman.ruby:505 - ruby was found at "/usr/bin/ruby".
2020-04-15 00:49:57.685392 DEBUG leatherman.execution:93 - executing command: /usr/bin/ruby -e print(['libdir', 'archlibdir', 'sitearchlibdir', 'bindir'].find do |name|dir = RbConfig::CONFIG[name];next unless dir;file = File.join(dir, RbConfig::CONFIG['LIBRUBY_SO']);break file if File.exist? file;false end)
2020-04-15 00:49:57.772567 DEBUG | - /usr/lib64/libruby.so.2.6.5
2020-04-15 00:49:57.772732 DEBUG leatherman.execution:563 - process exited with status code 0.
2020-04-15 00:49:57.774891 INFO  leatherman.ruby:138 - ruby loaded from "/usr/lib64/libruby.so.2.6.5".
2020-04-15 00:49:57.775165 DEBUG leatherman.dynamic_library:77 - symbol rb_data_object_alloc not found in library /usr/lib64/libruby.so.2.6.5, trying alias rb_data_object_wrap.
2020-04-15 00:49:57.856253 INFO  leatherman.ruby:187 - using ruby version 2.6.5
2020-04-15 00:49:57.856368 INFO  puppetlabs.facter - resolving all facts.
2020-04-15 00:49:57.856477 DEBUG puppetlabs.facter - fact "facterversion" has resolved to "3.14.2".
2020-04-15 00:49:57.856668 DEBUG leatherman.file_util:65 - Error reading file: No such file or directory
2020-04-15 00:49:57.856960 DEBUG puppetlabs.facter - loading all custom facts.
2020-04-15 00:49:57.857026 DEBUG puppetlabs.facter - loading custom fact directories from config file
2020-04-15 00:49:57.857116 DEBUG puppetlabs.facter - skipping external facts for "/opt/puppetlabs/facter/facts.d": No such file or directory
2020-04-15 00:49:57.857184 DEBUG puppetlabs.facter - searching "/etc/facter/facts.d" for external facts.
2020-04-15 00:49:57.857288 DEBUG puppetlabs.facter - resolving facts from YAML file "/etc/facter/facts.d/hello.yaml".
-e: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
 
...
 
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html
 
Aborted (core dumped)

Remove .yaml fact and replace with .txt external fact...

root@saltmaster01:0 facts.d # ls -l
total 4
-rw-r--r--. 1 root root 12 Apr 15 00:55 hello.txt
 
root@saltmaster01:0 facts.d # cat hello.txt 
hello=world
 
root@saltmaster01:0 facts.d # facter --debug
2020-04-15 00:56:29.995843 INFO  puppetlabs.facter - executed with command line: --debug.
2020-04-15 00:56:29.996016 DEBUG leatherman.ruby:505 - ruby was found at "/usr/bin/ruby".
2020-04-15 00:56:29.996103 DEBUG leatherman.execution:93 - executing command: /usr/bin/ruby -e print(['libdir', 'archlibdir', 'sitearchlibdir', 'bindir'].find do |name|dir = RbConfig::CONFIG[name];next unless dir;file = File.join(dir, RbConfig::CONFIG['LIBRUBY_SO']);break file if File.exist? file;false end)
2020-04-15 00:56:30.084541 DEBUG | - /usr/lib64/libruby.so.2.6.5
2020-04-15 00:56:30.084689 DEBUG leatherman.execution:563 - process exited with status code 0.
2020-04-15 00:56:30.086642 INFO  leatherman.ruby:138 - ruby loaded from "/usr/lib64/libruby.so.2.6.5".
2020-04-15 00:56:30.086820 DEBUG leatherman.dynamic_library:77 - symbol rb_data_object_alloc not found in library /usr/lib64/libruby.so.2.6.5, trying alias rb_data_object_wrap.
2020-04-15 00:56:30.165503 INFO  leatherman.ruby:187 - using ruby version 2.6.5
2020-04-15 00:56:30.165578 INFO  puppetlabs.facter - resolving all facts.
2020-04-15 00:56:30.165652 DEBUG puppetlabs.facter - fact "facterversion" has resolved to "3.14.2".
2020-04-15 00:56:30.165836 DEBUG leatherman.file_util:65 - Error reading file: No such file or directory
2020-04-15 00:56:30.166114 DEBUG puppetlabs.facter - loading all custom facts.
2020-04-15 00:56:30.166156 DEBUG puppetlabs.facter - loading custom fact directories from config file
2020-04-15 00:56:30.166235 DEBUG puppetlabs.facter - skipping external facts for "/opt/puppetlabs/facter/facts.d": No such file or directory
2020-04-15 00:56:30.166274 DEBUG puppetlabs.facter - searching "/etc/facter/facts.d" for external facts.
2020-04-15 00:56:30.166322 DEBUG puppetlabs.facter - resolving facts from text file "/etc/facter/facts.d/hello.txt".
2020-04-15 00:56:30.166414 DEBUG puppetlabs.facter - fact "hello" has resolved to "world".
2020-04-15 00:56:30.166460 DEBUG puppetlabs.facter - completed resolving facts from text file "/etc/facter/facts.d/hello.txt".
2020-04-15 00:56:30.166512 DEBUG puppetlabs.facter - skipping external facts for "/etc/puppetlabs/facter/facts.d": No such file or directory
2020-04-15 00:56:30.166577 DEBUG puppetlabs.facter - resolving ruby facts.
...
timezone => UTC
virtual => vmware
 
root@saltmaster01:0 facts.d # echo $?
0

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 2:21:03 AM4/15/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 2:27:02 AM4/15/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 5:40:03 AM4/15/20
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Apr 22, 2020, 8:20:04 AM4/22/20
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Apr 22, 2020, 8:49:02 AM4/22/20
to puppe...@googlegroups.com
Gabriel Nagy commented on Bug FACT-2554
 
Re: Distro-packaged facter (3.14.2) on Fedora 31 segfault on external fact from .yaml

Hi,

I managed to reproduce this after upgrading yaml-cpp from 0.6.2 to 0.6.3 on Fedora 31.

So basically:

  • build facter with yaml-cpp 0.6.2, then upgrade yaml-cpp to 0.6.3 => segfault
  • build facter with yaml-cpp 0.6.3, then downgrade yaml.cpp to 0.6.2 => segfault

After building with debug symbols, this showed up:
./bin/facter: symbol lookup error: /home/repo/facter/build/lib/libfacter.so.3.14.10: undefined symbol: _ZN4YAML6detail9node_data12empty_scalarB5cxx11E

This seems to be an ABI break in yaml-cpp, and it was also reported back in November on the yaml-cpp GitHub project: https://github.com/jbeder/yaml-cpp/issues/789.

There are some workarounds for this:

  • downgrade yaml-cpp back to 0.6.2 if possible
  • get Fedora maintainers to rebuild the facter package with yaml-cpp 0.6.3
  • use the puppet-agent AIO package which provides facter with a functioning vendored yaml-cpp

Either way, there's nothing we can do from our side, unfortunately.

Thanks,
Gabriel

Reply all
Reply to author
Forward
0 new messages