Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5127

unterminated c-style comment causes hang

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 3.8.2
    • Fix Version/s: PUP 4.3.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Ubuntu 14.04 LTS master/agent

    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-12-02, Language 2015-12-16
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      An unterminatated C-style comment could lead to puppet hanging forever.

      Description

      In my manifest file for my node, I had an unterminated c-style comment:

      having a manifest file containing /* is sufficient to cause this (though other stupid errors like terminating with another /* or bad nesting can also trigger the bug).

      Tested with a simple:

      strace -fff puppet master --debug --no-daemonize --compile puppet-agent 
      

      relevant strace output:

      [pid  3469] stat("/etc/puppet/environments/vagrant/manifests/puppet-agent.pp", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
      [pid  3469] stat("/etc/puppet/environments/vagrant/manifests/puppet-agent.pp", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
      [pid  3469] stat("/etc/puppet/environments/vagrant/manifests/puppet-agent.pp", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
      [pid  3469] open("/etc/puppet/environments/vagrant/manifests/puppet-agent.pp", O_RDONLY) = 5
      [pid  3469] fstat(5, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
      [pid  3469] fstat(5, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
      [pid  3469] ioctl(5, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fff7c8788e0) = -1 ENOTTY (Inappropriate ioctl for device)
      [pid  3469] fstat(5, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
      [pid  3469] lseek(5, 0, SEEK_CUR)       = 0
      [pid  3469] read(5, "  /*\n", 5)        = 5
      [pid  3469] read(5, "", 8192)           = 0
      [pid  3469] close(5)                    = 0
      

      I was originally suspecting that it was trying to read() past EOF looking for the comment terminator (and perhaps it still is) but it looks like it hangs after close()

      This causes a complete hang of puppet after that line. I left it running for about 20 minutes and it still persistently hung.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              AdamJacobMuller Adam Jacob Muller
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support