<?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>10224</bug_id>
          
          <creation_ts>2016-09-06 09:15:34 +0000</creation_ts>
          <short_desc>oeqa/utils/sshcontrol.py:SSHProcess decode stdout data fail</short_desc>
          <delta_ts>2017-04-07 16:38:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Runtime Testing</product>
          <component>general</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</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 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="dawei">daweix.wu</reporter>
          <assigned_to name="dawei">daweix.wu</assigned_to>
          <cc>joshuagloe</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65815</commentid>
    <comment_count>0</comment_count>
    <who name="dawei">daweix.wu</who>
    <bug_when>2016-09-06 09:15:34 +0000</bug_when>
    <thetext>Code:
      while time.time() &lt; endtime and not eof:
                if select.select([self.process.stdout], [], [], 5)[0] != []:
                    data = os.read(self.process.stdout.fileno(), 1024)
                    if not data:
                        self.process.stdout.close()
                        eof = True
                    else:
                        data = data.decode(&quot;utf-8&quot;)
                        output += data
                        self.log(data)
                        endtime = time.time() + timeout


Errors at &apos; data = data.decode(&quot;utf-8&quot;)&apos;

UnicodeDecodeError: &apos;utf-8&apos; codec can&apos;t decode byte 0xc4 in position 1023: unexpected end of data

Reproducibility : &lt; 1/10

Possible workaround:  data = data.decode(&quot;utf-8&quot;, &apos;replace&apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65929</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-09-08 15:04:28 +0000</bug_when>
    <thetext>Can you replicate the problem using one of standard tools (not a sample code)?

I want to understand the scenario you were trying to set when you found the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67080</commentid>
    <comment_count>2</comment_count>
    <who name="dawei">daweix.wu</who>
    <bug_when>2016-10-09 03:00:54 +0000</bug_when>
    <thetext>Just do some tests with running command likes &quot;python runtest.py -t 192.168.8.111 -m intel-corei7-64 -f testplan/iottest.manifest&quot; , but the reproducibility is very low , so we just met once. Why I listed the sample code since I saw below info. So I assume the possible cause is the 1024 read cache.
--------------------------------------------------------
Traceback (most recent call last):
  File &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/utils/decorators.py&quot;, line 97, in wrapped_f
    return f(*args, **kwargs)
  File &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/runtime/smack.py&quot;, line 580, in test_smack_labels
    &apos; &apos;.join([x.rstrip(&apos;/&apos;) for x in files.split()]), files, files
  File &quot;iottest/runtest.py&quot;, line 67, in run
    return self.connection.run(cmd, timeout)
  File &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/utils/sshcontrol.py&quot;, line 144, in run
    return self._internal_run(command, self.defaulttimeout, self.ignore_status)
  File &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/utils/sshcontrol.py&quot;, line 124, in _internal_run
    status, output = proc.run(command, timeout, logfile=self.logfile)
  File &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/utils/sshcontrol.py&quot;, line 87, in run
    self._run(command, timeout, logfile)
  File &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/utils/sshcontrol.py&quot;, line 61, in _run
    data = data.decode(&quot;utf-8&quot;)
UnicodeDecodeError: &apos;utf-8&apos; codec can&apos;t decode byte 0xc4 in position 1023: unexpected end of data
--------------------------------------------------------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67093</commentid>
    <comment_count>3</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-10-10 16:32:21 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Just do some tests with running command likes &quot;python runtest.py -t
&gt; 192.168.8.111 -m intel-corei7-64 -f testplan/iottest.manifest&quot; , but the
&gt; reproducibility is very low , so we just met once. Why I listed the sample
&gt; code since I saw below info. So I assume the possible cause is the 1024 read
&gt; cache.
&gt; --------------------------------------------------------
&gt; Traceback (most recent call last):
&gt;   File
&gt; &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/
&gt; utils/decorators.py&quot;, line 97, in wrapped_f
&gt;     return f(*args, **kwargs)
&gt;   File
&gt; &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/
&gt; runtime/smack.py&quot;, line 580, in test_smack_labels
&gt;     &apos; &apos;.join([x.rstrip(&apos;/&apos;) for x in files.split()]), files, files
&gt;   File &quot;iottest/runtest.py&quot;, line 67, in run
&gt;     return self.connection.run(cmd, timeout)
&gt;   File
&gt; &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/
&gt; utils/sshcontrol.py&quot;, line 144, in run
&gt;     return self._internal_run(command, self.defaulttimeout,
&gt; self.ignore_status)
&gt;   File
&gt; &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/
&gt; utils/sshcontrol.py&quot;, line 124, in _internal_run
&gt;     status, output = proc.run(command, timeout, logfile=self.logfile)
&gt;   File
&gt; &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/
&gt; utils/sshcontrol.py&quot;, line 87, in run
&gt;     self._run(command, timeout, logfile)
&gt;   File
&gt; &quot;/home/tester/iotos-tester/workspace/test_beagleboneblack_2/iottest/oeqa/
&gt; utils/sshcontrol.py&quot;, line 61, in _run
&gt;     data = data.decode(&quot;utf-8&quot;)
&gt; UnicodeDecodeError: &apos;utf-8&apos; codec can&apos;t decode byte 0xc4 in position 1023:
&gt; unexpected end of data
&gt; --------------------------------------------------------

Thanks for the info. It will be tackle before the mentioned milestone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68876</commentid>
    <comment_count>4</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2016-12-06 18:01:59 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Just do some tests with running command likes &quot;python runtest.py -t
&gt; 192.168.8.111 -m intel-corei7-64 -f testplan/iottest.manifest&quot; , but the
&gt; reproducibility is very low , so we just met once. Why I listed the sample
&gt; code since I saw below info. So I assume the possible cause is the 1024 read
&gt; cache.

What locale setting are you using in your terminal session? This error means that SSH is not returning UTF-8 encoding. Can you reproduce this error setting your terminal to UTF-8?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69981</commentid>
    <comment_count>5</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2017-01-20 21:06:39 +0000</bug_when>
    <thetext>I&apos;m still not able to reproduce this. Assigning to submitter to get more information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70465</commentid>
    <comment_count>6</comment_count>
    <who name="dawei">daweix.wu</who>
    <bug_when>2017-02-07 05:22:38 +0000</bug_when>
    <thetext>Not sure about the terminal codec , considering the reproducibility is very low , I am to OK to close this as &apos;Won&apos;t fix&apos;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>