Issue #19314 has been updated by Josh Cooper.

Status changed from Unreviewed to Needs More Information
Assignee set to James Shubin
Priority changed from High to Normal

Hi James,

I think there's a problem with your inline template, the following pins my cpu:

<pre>
$ ruby -ripaddr -e "IPAddr.new('172.16.1.1/172.16.1.0').to_range.to_a"
</pre>

It appears you just want the last element in the range, so try:

<pre>
$ ruby -ripaddr -e "IPAddr.new('172.16.1.1/172.16.1.0').to_range.last"
</pre>

Also, you might want to create a custom function instead of using inline 
templates, especially the one that assigns a value to x, and then accesses the 
variable in another statement.





----------------------------------------
Bug #19314: puppet segfaults in combination with ipaddr
https://projects.puppetlabs.com/issues/19314#change-86762

Author: James Shubin
Status: Needs More Information
Priority: Normal
Assignee: James Shubin
Category: 
Target version: 
Affected Puppet version: 3.1.0
Keywords: segmentation fault, segfault
Branch: 


Sadly, I don't have a lot of information. Let me know how I can be more 
helpful. I have an enormous amount of puppet code running, so at the moment, I 
can't post it all.

On client:
<pre>
# puppet agent --test 
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Error: Could not retrieve catalog from remote server: end of file reached
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Connection refused - connect(2)
</pre>

On server:
<pre>
# puppet master --no-daemonize --verbose --debug
[...]
Debug: template[inline]: Interpolated template inline template in 0.00 seconds
Debug: template[inline]: Bound template variables for inline template in 0.00 
seconds
/usr/lib/ruby/1.8/ipaddr.rb:321: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Aborted
</pre>

These types of things are present in the code:
inline_template("<%= IPAddr.new('255.255.255.255').mask(${cidr}).to_s %>")
inline_template('<% x = IPAddr.new(valid_ipaddress + "/" + cidr.to_s) %><%= 
x.to_range.to_a[x.to_range.count - 1] %>')

Although, it's not clear which one (if any) actually triggers this. The code 
works perfectly when run manually with puppet apply, also, the segfault doesn't 
show up consistently. Certain unrelated changes in the code allow the above to 
work, and sometimes it segfaults. So, maybe there some sort of race condition 
or ghost hiding out?

Hopefully this can give you enough of a clue for where to look.

Thanks,
James



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to