<?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>10522</bug_id>
          
          <creation_ts>2016-10-28 12:11:04 +0000</creation_ts>
          <short_desc>python: test.regrtest fails</short_desc>
          <delta_ts>2017-09-22 17:41:46 +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>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Markus Lehtonen">markus.lehtonen</reporter>
          <assigned_to name="Jose Lamego">jose.a.lamego</assigned_to>
          <cc>alejandro.hernandez</cc>
    
    <cc>jair.de.jesus.gonzalez.plascencia</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>markus.lehtonen</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ross.burton</cc>
          
          
          <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>67719</commentid>
    <comment_count>0</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-10-28 12:11:04 +0000</bug_when>
    <thetext>Python test.regrtest is broken. First of all, the package dependencies are incorrect. After getting around that, some tests segfault:
&lt;pre&gt;
root@qemux86:~# for t in test_bytes test_str test_string test_tuple test_unicode test_userstring; do python -m test.regrtest $t; done
[1/1] test_bytes
[   98.185825] python[376]: segfault at b719e000 ip 4269cad2 sp bfea34f4 error 7 in libc-2.24.so[42625000+175000]
Segmentation fault
[1/1] test_str
[  113.812423] python[381]: segfault at b7080000 ip 4269cac4 sp bfee0594 error 7 in libc-2.24.so[42625000+175000]
Segmentation fault
[1/1] test_string
[  127.986049] python[384]: segfault at b7178000 ip 4269caea sp bfeecf64 error 7 in libc-2.24.so[42625000+175000]
Segmentation fault
[1/1] test_tuple
[  129.136838] python[385]: segfault at b7732000 ip 428a8ebc sp bfdab840 error 6 in libpython2.7.so.1.0[42824000+1a3000]
Segmentation fault
[1/1] test_unicode
[  148.463642] python[386]: segfault at 82d6010 ip 4269cab9 sp bfc7b5b4 error 4 in libc-2.24.so[42625000+175000]
Segmentation fault
[1/1] test_userstring
[  179.787759] python[387]: segfault at b709b000 ip 4269cac4 sp bf9c2a54 error 7 in libc-2.24.so[42625000+175000]
Segmentation fault
&lt;/pre&gt;

Some other tests fail more gracefully:
&lt;pre&gt;
python -m test.regrtest test_StringIO test_builtin test_calendar test_cmath test_ctypes test_distutils test_exceptions test_getargs test_gzip
 test_json test_math test_shutil test_socket test_sqlite test_traceback test_warnings
[ 1/16] test_StringIO
test test_StringIO failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_StringIO.py&quot;, line 197, in test_unicode
    self.assertRaises(UnicodeEncodeError, self.MODULE.StringIO, u&apos;\xf4&apos;)
AssertionError: UnicodeEncodeError not raised

[ 2/16/1] test_builtin
test test_builtin failed -- multiple errors occurred; run in verbose mode for details
[ 3/16/2] test_calendar
test test_calendar failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_calendar.py&quot;, line 212, in test_output_htmlcalendar
    result_2004_html.strip()
AssertionError: &apos;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf8&quot;?&gt;\n&lt;!DOCTYPE html PUBLIC &quot;-//
...

[ 4/16/3] test_cmath
test test_cmath failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_cmath.py&quot;, line 352, in test_specific_values
    msg=error_message)
  File &quot;/usr/lib/python2.7/test/test_cmath.py&quot;, line 112, in rAssertAlmostEqual
    &apos;{!r} and {!r} are not sufficiently close&apos;.format(a, b))
AssertionError: acos0034: acos(complex(-1.0000000000000002, 0.0))
Expected: complex(3.1415926535897931, -2.1073424255447014e-08)
Received: complex(3.1415926535897931, -2.1073424338879928e-08)
Received value insufficiently close to expected value.

[ 5/16/4] test_ctypes
test test_ctypes failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/ctypes/test/test_structures.py&quot;, line 258, in test_invalid_name
    self.assertRaises(TypeError, declare_with_name, u&quot;x\xe9&quot;)
AssertionError: TypeError not raised

[ 6/16/5] test_distutils
unable to execute &apos;i586-poky-linux-gcc&apos;: No such file or directory
unable to execute &apos;i586-poky-linux-gcc&apos;: No such file or directory
unable to execute &apos;i586-poky-linux-gcc&apos;: No such file or directory
unable to execute &apos;i586-poky-linux-gcc&apos;: No such file or directory
Warning -- os.environ was modified by test_distutils
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
[ 7/16/6] test_exceptions
test test_exceptions failed -- multiple errors occurred; run in verbose mode for details
[ 8/16/7] test_getargs
test test_getargs failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_getargs.py&quot;, line 25, in test_with_marshal
    self.assertRaises(UnicodeError, marshal.loads, arg)
  File &quot;/usr/lib/python2.7/unittest/case.py&quot;, line 473, in assertRaises
    callableObj(*args, **kwargs)
ValueError: bad marshal data (unknown type code)

[ 9/16/8] test_gzip
test test_gzip failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_gzip.py&quot;, line 84, in test_write_incompatible_type
    f.write(u&apos;\xff&apos;)
AssertionError: UnicodeEncodeError not raised

[10/16/9] test_json
t test_json failed -- multiple errors occurred; run in verbose mode for details
[11/16/10] test_math
test test_math failed -- multiple errors occurred; run in verbose mode for details
[12/16/11] test_shutil
test test_shutil failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_shutil.py&quot;, line 535, in test_unzip_zipfile
    self.fail(msg.format(exc, details))
AssertionError: Command &apos;[&apos;unzip&apos;, &apos;-t&apos;, &apos;/tmp/tmpdGc2VR/archive.zip&apos;]&apos; returned non-zero exit status 1

**Unzip Output**
unzip: invalid option -- &apos;t&apos;
BusyBox v1.24.1 (2016-10-28 14:03:27 EEST) multi-call binary.

Usage: unzip [-lnopq] FILE[.zip] [FILE]... [-x FILE...] [-d DIR]


[13/16/12] test_socket
test test_socket failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_socket.py&quot;, line 309, in testSendtoErrors
    s.sendto(u&apos;\u2620&apos;, sockname)
AssertionError: UnicodeEncodeError not raised

[14/16/13] test_sqlite
test test_sqlite failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/sqlite3/test/regression.py&quot;, line 158, in CheckSetIsolationLevel
    &quot;isolation_level&quot;, u&quot;\xe9&quot;)
AssertionError: UnicodeEncodeError not raised

[15/16/14] test_traceback
test test_traceback failed -- Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/test/test_traceback.py&quot;, line 179, in test_unicode
    self.assertEqual(lines, [&apos;AssertionError: \\xe9\n&apos;])
AssertionError: Lists differ: [&apos;AssertionError: \xc3\xa9\n&apos;] != [&apos;AssertionError: \\xe9\n&apos;]

First differing element 0:
&apos;AssertionError: \xc3\xa9\n&apos;
&apos;AssertionError: \\xe9\n&apos;

- [&apos;AssertionError: \xc3\xa9\n&apos;]
  ?                     ^^^^^

+ [&apos;AssertionError: \\xe9\n&apos;]
?                   +  ^


[16/16/15] test_warnings
/usr/lib/python2.7/unittest/case.py:503: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if not first == second:
test test_warnings failed -- multiple errors occurred; run in verbose mode for details
16 tests failed:
    test_StringIO test_builtin test_calendar test_cmath test_ctypes
    test_distutils test_exceptions test_getargs test_gzip test_json
    test_math test_shutil test_socket test_sqlite test_traceback
    test_warnings

&lt;/pre&gt;

The above lists all the tests that are failing on qemux86 in my case. Other tests succeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67903</commentid>
    <comment_count>1</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-11-03 14:54:52 +0000</bug_when>
    <thetext>I found the failures when implementing profile-guided-optimization for Python as test.regrtest is the default profile target being used there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68118</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-11-08 17:28:21 +0000</bug_when>
    <thetext>Fixed in oe-core a8dc4bc039d1c01a78fdc1f727cbfc6f2feffe93.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68172</commentid>
    <comment_count>3</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-11-09 07:15:50 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Fixed in oe-core a8dc4bc039d1c01a78fdc1f727cbfc6f2feffe93.

That was just a very small piece of a fix, fixing import errors but not the actual test case failures.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68175</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-11-09 08:41:53 +0000</bug_when>
    <thetext>Sorry, thanks for noticing!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68437</commentid>
    <comment_count>5</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-11-18 09:21:04 +0000</bug_when>
    <thetext>Just for reference, I quickly tried regrtest on python-native and the results are better:

$ tmp-glibc/sysroots/x86_64-linux/usr/bin/nativepython -m test.regrtest -w
...
4 tests failed again:
    test_distutils test_gdb test_urllib test_urllib2_localnet

I&apos;m just not entirely confident that it loads/imports the correct sysroot libraries/modules instead of host system ones in all cases</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76473</commentid>
    <comment_count>6</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-02 15:42:57 +0000</bug_when>
    <thetext>I&apos;ve been able to reproduce this issue, showing that the failures are caused by multiple causes. 

Preliminary findings are at the following comment; however, before continuing, I&apos;d like to point out that python-test was dropped from python modules in commit [1] due to being for internal Python developer&apos;s use only [2].

Markus: What are your thoughts on the relevance/need for fixing these tests? So far, there are no signs that any of the failures is caused by our building/configuration but mostly due to a required test code refactoring/fixing.


[1] c760d99466c270d18294f5a07ccd91185fa0ef83 (from OE-Core a5bb13a5d7d7a668ca61da6b17884e3b05b95355)

[2] https://docs.python.org/2/library/test.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76474</commentid>
    <comment_count>7</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-02 15:50:06 +0000</bug_when>
    <thetext>Tests ran in qemu with qemux86 core-image-minimal with python-tests at IMAGE_FEATURES_append

Following tests are showing a segmentation fault caused in all cases by the &quot;test_replace_overflow&quot; function:
    test_bytes
    test_string
    test_str
    test_unicode
    test_userstring

Following tests are all showing AssertionError: UnicodeError not raised:
    test_StringIO
    test_builtin
    test_exceptions
    test_gzip
    test_socket
    test_sqlite

Following tests are showing errors that may be also related to encoding:    
    test_ctypes     (AssertionError: TypeError not raised)
    test_traceback  (AssertionError: Lists differ)
    test_getargs    (ValueError: bad marshal data (unknown type code))

Following tests are showing OSError: [Error 12] Cannot allocate memory: 
    test_parser
    test_platform
    test_poll
    test_posix
    test_pty
    test_readline
    test_select
    test_ssl

Other errors:
    test_tuple      (AssertionError: MemoryError not raised)
    test_cmath      (Received value insufficiently close to expected value.)
    test_calendar   (AssertionError))
    test_shutil     (unzip: invalid option -- &apos;t&apos;)
    test_warnings   (x18) AttributeError: &apos;CatchWarningTests&apos; object has no attribute &apos;module&apos;
                    (x2) AssertionError
    test_distutils  (unable to execute file)
    test_json
    test_pdb
    test_math
    test_multiprocessing
    test_os
    test_pep247
    test_pipes
    test_popen
    test_popen2     (x2)(Exception AttributeError)
    test_pydoc
    test_quopri
    test_resource   (Out of memory)
    test_source_encoding
    test_sysconfig  (AssertionError: /usr/lib/python2.7/config/Makefile) self.assertTrue(os.path.isfile(makefile), makefile)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76497</commentid>
    <comment_count>8</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-09-04 14:51:58 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Tests ran in qemu with qemux86 core-image-minimal with python-tests at
&gt; IMAGE_FEATURES_append
&gt; 
&gt; Following tests are showing a segmentation fault caused in all cases by the
&gt; &quot;test_replace_overflow&quot; function:
&gt;     test_bytes
&gt;     test_string
&gt;     test_str
&gt;     test_unicode
&gt;     test_userstring
&gt; 
&gt; Following tests are all showing AssertionError: UnicodeError not raised:
&gt;     test_StringIO
&gt;     test_builtin
&gt;     test_exceptions
&gt;     test_gzip
&gt;     test_socket
&gt;     test_sqlite
&gt; 
&gt; Following tests are showing errors that may be also related to encoding:    
&gt;     test_ctypes     (AssertionError: TypeError not raised)
&gt;     test_traceback  (AssertionError: Lists differ)
&gt;     test_getargs    (ValueError: bad marshal data (unknown type code))
&gt; 
&gt; Following tests are showing OSError: [Error 12] Cannot allocate memory: 
&gt;     test_parser
&gt;     test_platform
&gt;     test_poll
&gt;     test_posix
&gt;     test_pty
&gt;     test_readline
&gt;     test_select
&gt;     test_ssl
&gt; 
&gt; Other errors:
&gt;     test_tuple      (AssertionError: MemoryError not raised)
&gt;     test_cmath      (Received value insufficiently close to expected value.)
&gt;     test_calendar   (AssertionError))
&gt;     test_shutil     (unzip: invalid option -- &apos;t&apos;)
&gt;     test_warnings   (x18) AttributeError: &apos;CatchWarningTests&apos; object has no
&gt; attribute &apos;module&apos;
&gt;                     (x2) AssertionError
&gt;     test_distutils  (unable to execute file)
&gt;     test_json
&gt;     test_pdb
&gt;     test_math
&gt;     test_multiprocessing
&gt;     test_os
&gt;     test_pep247
&gt;     test_pipes
&gt;     test_popen
&gt;     test_popen2     (x2)(Exception AttributeError)
&gt;     test_pydoc
&gt;     test_quopri
&gt;     test_resource   (Out of memory)
&gt;     test_source_encoding
&gt;     test_sysconfig  (AssertionError: /usr/lib/python2.7/config/Makefile)
&gt; self.assertTrue(os.path.isfile(makefile), makefile)


Jose,

For the memomry issues, you may need to increase the memory used by the qemu. This is done through extra parameters when launching the image.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76501</commentid>
    <comment_count>9</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2017-09-04 16:24:58 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Tests ran in qemu with qemux86 core-image-minimal with python-tests at
&gt; IMAGE_FEATURES_append
&gt; 
&gt; Following tests are showing a segmentation fault caused in all cases by the
&gt; &quot;test_replace_overflow&quot; function:
&gt;     test_bytes
&gt;     test_string
&gt;     test_str


Great work narrowing this down Jose, couldyou upload the full test log as an attachment, so we can see the specific errors for each one.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76503</commentid>
    <comment_count>10</comment_count>
      <attachid>3972</attachid>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-04 19:37:05 +0000</bug_when>
    <thetext>Created attachment 3972
Logs from tests showing segmentation fault from test_replace_overflow function</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76504</commentid>
    <comment_count>11</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-04 19:41:22 +0000</bug_when>
    <thetext>I&apos;ve attached the logs from tests showing segmentation faults from test_replace_overflow function (I&apos;m afraid there&apos;s not much information).

Leo: You are right, I ran qemu with 256M of memory and the &quot;OSError: [Error 12] Cannot allocate memory&quot; is gone. Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76642</commentid>
    <comment_count>12</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-07 15:42:38 +0000</bug_when>
    <thetext>Regarding the segmentation faults, those are caused by a known issue in Python&apos;s overflow checks (see [1]) for which a fix is available in Python 3 but unfortunately there are no plans to backport it to Python 2 (see [2]).

This should add to the question on whether this regression tests are still relevant or not. 

[1] http://bugs.python.org/issue29145

[2] http://bugs.python.org/issue29145#msg285022</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76647</commentid>
    <comment_count>13</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-09-07 16:25:41 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Regarding the segmentation faults, those are caused by a known issue in
&gt; Python&apos;s overflow checks (see [1]) for which a fix is available in Python 3
&gt; but unfortunately there are no plans to backport it to Python 2 (see [2]).
&gt; 
&gt; This should add to the question on whether this regression tests are still
&gt; relevant or not. 
&gt; 
&gt; [1] http://bugs.python.org/issue29145
&gt; 
&gt; [2] http://bugs.python.org/issue29145#msg285022

So this is a know issue at upstream, so I suggest to resolved it as wontfix unless you think the patch is trivial to backport.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76655</commentid>
    <comment_count>14</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2017-09-07 17:22:30 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Regarding the segmentation faults, those are caused by a known issue in
&gt; Python&apos;s overflow checks (see [1]) for which a fix is available in Python 3
&gt; but unfortunately there are no plans to backport it to Python 2 (see [2]).
&gt; 
&gt; This should add to the question on whether this regression tests are still
&gt; relevant or not. 
&gt; 
&gt; [1] http://bugs.python.org/issue29145
&gt; 
&gt; [2] http://bugs.python.org/issue29145#msg285022

I tried to reproduce it on my computer and it froze beyond repair, I had to manually turn it off, to me that pretty much settles it, this is an upstream issue, and while the ptest package may be useful to us in some ways, we can&apos;t base our work on those tests.

We may still want to try and fix the Unicode errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76735</commentid>
    <comment_count>15</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-11 20:18:30 +0000</bug_when>
    <thetext>I further investigated the cause for the encode-related failures to discard any error related to our build process:

All of the regression tests are based on the assumption that the default target encoding is &apos;ascii&apos;, whereas Yocto-build images use &apos;utf-8&apos; as default encoding for Python 2 (defined in sitecustomize.py). This causes the unexpected behavior.

For example: the expected outcome in test_StringIO.TestcStringIO.test_unicode is a UnicodeEncodeError when the cStringIO module tries to convert Unicode strings to character strings in the default (ascii assumed) encoding. Evidently, in our case there is no encoding error since both the input string and the default encoding (used by Python&apos;s str() function) are &apos;utf-8&apos;.

So, these encoding errors would also need the regression tests to be re-written/refactored.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76737</commentid>
    <comment_count>16</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2017-09-11 20:25:45 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; I further investigated the cause for the encode-related failures to discard
&gt; any error related to our build process:
&gt; 
&gt; All of the regression tests are based on the assumption that the default
&gt; target encoding is &apos;ascii&apos;, whereas Yocto-build images use &apos;utf-8&apos; as
&gt; default encoding for Python 2 (defined in sitecustomize.py). This causes the
&gt; unexpected behavior.


Jose, I believe using setdefaultencoding() is discouraged, this will be fixed on M1 with the new manifest patches, can you please check what happens if you remove the setting from sitecustomize.py?, do the errors go away?

Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76741</commentid>
    <comment_count>17</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-11 21:18:29 +0000</bug_when>
    <thetext>Confirmed that all of the encoding-related errors are no longer present when the image is created WITHOUT the setdefaultencoding() setting in sitecustomize.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77075</commentid>
    <comment_count>18</comment_count>
    <who name="Jose Lamego">jose.a.lamego</who>
    <bug_when>2017-09-22 17:27:15 +0000</bug_when>
    <thetext>Following are the summarized findings for the reported behavior:

    - python-tests module was dropped from  python-modules [1], so it must
      be explicitly added to an image in order to be available.

    - Some of the failures are only present when executing the tests in a qemu
      emulated machine and are caused by its inherent limited resources.
      For example: executing the tests in qemu with 128 MB of memory causes at
      least 8 test failures due to memory that can not be allocated.

    - When executed on real hardware (Minnowboard Turbot 32 bits), failures
      can be divided into four main causes:

      1 - Segmentation fault caused by a known issue in Python&apos;s replace_*
          function [2]. There are no plans to fix this for Python 2.7.

      2 - Failures related to Unicode encoding. These are caused by the default
          encoding used in Yocto-build images (&apos;utf-8&apos;) being different from
          the assumed &apos;ascii&apos; by the tests. This will no longer be the case
          after 2.5 M1 milestone, when manifest patches that remove the
          mentioned default encoding are scheduled to be implemented.

      3 - Other:
          both test_distutils and test_sysconfig failure due to dev-related
          resources not available in limited-size images (gcc compiler and
          makefiles, respectively). These failures are not present when
          executing tests in SDK images or when tools-sdk is added as an extra
          image feature.

          test_shutil failure due to invalid option in BusyBox&apos;s unzip. This
          is not the case when using an SDK image.

          test_tuple failure due to __mul__ operator not raising MemoryError
          when using a large multiplier. This may be the result of an
          optimized memory management implemented after the test was developed.
          
After these findings, recommendation is to run the regression tests under the
following configuration:

      - Use an SDK image (for example: core-image-sato-sdk) or add &apos;tools-sdk&apos;
        to EXTRA_IMAGE_FEATURES

      - Ensure default encoding is &apos;ascii&apos;

      - Exclude the tests that use the &quot;replace_*&quot; function and test_tuple
        test.
        (i.e.: use &apos;--exclude&apos; option followed by
         &apos;test_bytes test_string test_str test_tuple&apos;)

For all of the above, and given that any of the failures is directly caused by
our building system, I&apos;m closing this bug as &quot;won&apos;t fix&quot;.
      
[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c760d99466c270d18294f5a07ccd91185fa0ef83

[2] https://bugs.python.org/issue29145</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77077</commentid>
    <comment_count>19</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-09-22 17:41:46 +0000</bug_when>
    <thetext>(In reply to comment #18)
&gt; Following are the summarized findings for the reported behavior:

your report is pretty conclusive so not much to add. BTW, on all this exploration did you instruct bitbake to use the &apos;profile-guided-optimization&apos; when compiling the interpreter? and did you run the ptests under python3? I believe this wont change the bugzilla status, but just wondering  if output from the latter may be different.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3972</attachid>
            <date>2017-09-04 19:37:05 +0000</date>
            <delta_ts>2017-09-04 19:37:05 +0000</delta_ts>
            <desc>Logs from tests showing segmentation fault from test_replace_overflow function</desc>
            <filename>seg_fault_tests.tar.gz</filename>
            <type>application/gzip</type>
            <size>2407</size>
            <attacher name="Jose Lamego">jose.a.lamego</attacher>
            
              <data encoding="base64">H4sIAN2qrVkAA+2cW2/bOBaA++xfobeZYhtHsmzJKdCHTjG7GGAGGGB3noJAoCXaZiNLWpLKpb9+
DyU7F5HirU62GZgPsRSfj6J4PRfSHDOetQxTximpNtOy3rw7dgrDMEnmAXxG6SJ8+tmlRRiHQRRH
iziezdN4HoTRPE3n74Lw6CVRpJZxRKEoX2uGdXKm7/t3CR4+30j69Cn48uc939ZVMJum0ygOfi7w
GrUl/xB8bjdBHAUzaK4PQZh+jBYfFxfvg8t/ffkSpNPZNLyaAB4Ev5OqvTubTyPI4ey+znl9BpVa
FYgWZyRZJme3hG/PNiVZ5QAFJeG8xGe4Kgiq+hzObxA9v6lLxEmJz/muOeeiXzZdwbJ5upj8B+6h
fwYiq2Bdog37GLB7Nu0uocirdvMp/BA09/F1dotoBbLiviA3hBHIQ/W/Ct+Ke1KxBue8v+SYopyT
Gyxu64aTHZl8626KuuLZLSUcZ6t7jvO66P5d1d3wyRh8sb8/XJJNVVOc4eqG0Lra4ap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