<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10676</bug_id>
          
          <creation_ts>2016-11-16 08:19:54 +0000</creation_ts>
          <short_desc>cooker: event queue overflowed</short_desc>
          <delta_ts>2016-12-14 21:21:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jose.perez.carranza</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="David Lopez Barriba">davidx.lopez.barriba</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68352</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-11-16 08:19:54 +0000</bug_when>
    <thetext>When producing a lot of output from shell commands which run in parallel (see bug #10668) as part of a task, I ended up with this failure:

ERROR: Running idle function
Traceback (most recent call last):
  File &quot;/work/ostro-os/bitbake/lib/bb/server/process.py&quot;, line 142, in ProcessServer.idle_commands(delay=0.1, fds=[&lt;multiprocessing.connection.Connection object at 0x7f67d0fe65f8&gt;, &lt;multiprocessing.connection.Connection object at 0x7f67d0b37080&gt;]):
                 try:
    &gt;                retval = function(self, data, False)
                     if retval is False:
  File &quot;/work/ostro-os/bitbake/lib/bb/cooker.py&quot;, line 211, in _process_inotify_updates(server=&lt;ProcessServer(ProcessServer-1, started)&gt;, notifier_list=[&lt;pyinotify.Notifier object at 0x7f67d0b3d6a0&gt;, &lt;pyinotify.Notifier object at 0x7f67d0b3d7f0&gt;], abort=False):
                         n.read_events()
    &gt;                    n.process_events()
                 return 1.0
  File &quot;/work/ostro-os/bitbake/lib/pyinotify.py&quot;, line 1275, in Notifier.process_events():
                 else:
    &gt;                self._default_proc_fun(revent)
             self._sys_proc_fun.cleanup()  # remove olds MOVED_* events records
  File &quot;/work/ostro-os/bitbake/lib/bb/cooker.py&quot;, line 262, in BBCooker.notifications(event=&lt;Event mask=0x4000 maskname=IN_Q_OVERFLOW &gt;):
         def notifications(self, event):
    &gt;        if not event.pathname in self.inotify_modified_files:
                 self.inotify_modified_files.append(event.pathname)
AttributeError: &apos;Event&apos; object has no attribute &apos;pathname&apos;

IN_Q_OVERFLOW is &quot;Event queue overflowed&quot;. It seems reasonable that such an event doesn&apos;t have a pathname.

Not sure what bitbake can do in this case. At least it shouldn&apos;t crash as above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68353</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-11-16 09:05:43 +0000</bug_when>
    <thetext>Handling a shell command like
 echo foo | sed -u &apos;s/^/bar: /&apos; &amp; wait $!
required a slightly more complex workaround. In that case, the offending token is a list of three tuples.

Here&apos;s the updated workaround which handles that. Changing indention makes it fairly large. The basic idea is that if a token is a list, process_token_list will be called recursively for the members of that list.

diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 41484ec..8673b77 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -389,25 +389,24 @@ class ShellParser():
             &quot;case_clause&quot;: case_clause,
         }
 
-        for token in tokens:
-            try:
+        def process_token_list(tokens):
+            for token in tokens:
+                if isinstance(token, list):
+                    process_token_list(token)
+                    continue
                 name, value = token
-            except ValueError:
-                if isinstance(token, list) and len(token) == 1:
-                    bb.warn(&apos;Unexpected token (need list or tuple with two entries): %s&apos; % token)
-                    name, value = token[0]
-                else:
-                    bb.fatal(&apos;Cannot split %s into name and value (need list or tuple with two entries)&apos; % token)
-            try:
-                more_tokens, words = token_handlers[name](value)
-            except KeyError:
-                raise NotImplementedError(&quot;Unsupported token type &quot; + name)
+                try:
+                    more_tokens, words = token_handlers[name](value)
+                except KeyError:
+                    raise NotImplementedError(&quot;Unsupported token type &quot; + name)
+
+                if more_tokens:
+                    self.process_tokens(more_tokens)
 
-            if more_tokens:
-                self.process_tokens(more_tokens)
+                if words:
+                    self.process_words(words)
 
-            if words:
-                self.process_words(words)
+        process_token_list(tokens)
 
     def process_words(self, words):
         &quot;&quot;&quot;Process a set of &apos;words&apos; in pyshyacc parlance, which includes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68354</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-11-16 09:06:11 +0000</bug_when>
    <thetext>Oops, wrong bug. Please ignore comment #1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68928</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-12-08 14:09:07 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=e10da7d9dfc4da714092a63987d564ef67f73718</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>