Issue #13640 has been updated by Josh Cooper.

Status changed from Unreviewed to Accepted

So there's definitely a bug in the new event-loop code. In commit 
<https://github.com/puppetlabs/puppet/commit/3df8eef> everything is good. In 
the merge commit immediately after 
(<https://github.com/puppetlabs/puppet/commit/75476e1>) which contains the 
event-loop changes, running puppet master pins the cpu. The issue is here:

<pre>
next_event > next_agent_run  and next_event = next_agent_run

how_long = next_event - now

how_long > 0 and select([], [], [], how_long)
</pre>

When <b>NOT</b> running an agent, `next_agent_run` is 0, so `next_event` gets 
set to 0 and `how_long` gets set to a large negative number. So we never 
select, causing the infinite loop.

I am able to work around this by adding a line to ensure how_long is positive:

<pre>
how_long = 60 * 60 if how_long <= 0
</pre>

But I don't think that's the real solution.

What's strange is that without the geordi changes, it doesn't seg fault, it 
just pins the cpu. But with the geordi changes, ruby seg faults. Also adding a 
debug line, e.g. puts "#{how_long}" slows the loop down just enough that it 
doesn't seg fault. WIth that said, I think the root cause here is the eventloop.
----------------------------------------
Bug #13640: Puppet master segfaults
https://projects.puppetlabs.com/issues/13640#change-59722

Author: Josh Cooper
Status: Accepted
Priority: Normal
Assignee: Daniel Pittman
Category: 
Target version: 2.7.x
Affected Puppet version: development
Keywords: 
Branch: 


When I run puppet master recently from 2.7.x, I am seeing the cpu sometimes 
getting pinned, and more recently segfaults:

<pre>
dir=~/scratch/master/foo && puppetmasterd --no-daemonize --trace 
--autosign=true --debug --confdir=${dir} --vardir=${dir} --certname puppetmaster
...
/Users/josh/work/puppet/lib/puppet/daemon.rb:189: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
</pre>

The problem seems to be introduced with commit:1de8bd7 (puppet module tool), 
though the crash seems to be occurring in the daemon.rb code, which recently 
changed due to removing the eventloop code. Perhaps the new georgi terminal 
code isn't playing nicely with the new daemon code.

Reverting to 2.7.12 or commit:2d51b64 (immediately prior to the geordi merge) 
resolves the issue. I am using an older ruby version, but this is definitely 
new behavior...


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to