https://parisc.wiki.kernel.org/index.php?title=TestCases&feed=atom&action=history
TestCases - Revision history
2024-03-29T13:31:52Z
Revision history for this page on the wiki
MediaWiki 1.19.24
https://parisc.wiki.kernel.org/index.php?title=TestCases&diff=6221&oldid=prev
Thibaut Varene: formatting update
2014-05-31T21:11:41Z
<p>formatting update</p>
<a href="https://parisc.wiki.kernel.org/index.php?title=TestCases&diff=6221&oldid=5041">Show changes</a>
Thibaut Varene
https://parisc.wiki.kernel.org/index.php?title=TestCases&diff=5041&oldid=prev
Deller: /* Kernel Testcases */
2014-03-25T12:26:03Z
<p><span dir="auto"><span class="autocomment">Kernel Testcases</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 12:26, 25 March 2014</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>= Kernel Testcases =</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>= Kernel Testcases =</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">== Math test case ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">should return 0.0: (hppa floating point error)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> #include <stdio.h></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> #include <math.h></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> int</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> main (void) {</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">  double result = exp (-4.3682654441477153e+19);</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">  printf ("%g\n", result);</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">  if (result != 0.0)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">  return 1;</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">  return 0;</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"> }</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Futex wait failure ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Futex wait failure ==</div></td></tr>
</table>
Deller
https://parisc.wiki.kernel.org/index.php?title=TestCases&diff=3431&oldid=prev
Deller at 15:10, 5 February 2014
2014-02-05T15:10:10Z
<p></p>
<a href="https://parisc.wiki.kernel.org/index.php?title=TestCases&diff=3431&oldid=3101">Show changes</a>
Deller
https://parisc.wiki.kernel.org/index.php?title=TestCases&diff=3101&oldid=prev
Deller: Created page with "= Kernel Testcases = == Futex wait failure == No testcase. == Threads and fork on VIPT-WB machines == * Affects [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203..."
2014-02-05T11:57:52Z
<p>Created page with "= Kernel Testcases = == Futex wait failure == No testcase. == Threads and fork on VIPT-WB machines == * Affects [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203..."</p>
<p><b>New page</b></p><div>= Kernel Testcases =<br />
<br />
== Futex wait failure ==<br />
<br />
No testcase.<br />
<br />
== Threads and fork on VIPT-WB machines ==<br />
<br />
* Affects [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203|#561203]].<br />
* Discussed on [[http://thread.gmane.org/gmane.linux.ports.parisc/2503|this thread]] and [[http://thread.gmane.org/gmane.linux.ports.parisc/2751|this thread]]<br />
<br />
Summary from [[http://article.gmane.org/gmane.linux.ports.parisc/2823|JDA]]:<br />
<br />
''The minifail bug is a "Threads and fork" problem<br />
arising from cache corruption. Mainly, copy_user_page is broken when<br />
copying memory shared by more than one process. There are also issues<br />
in PTE/TLB management on SMP systems. Probably, the vfork/execve bug<br />
is caused by the same problem.''<br />
<br />
Initial patch [[http://marc.info/?l=linux-parisc&m=126202676424518&q=p3|syscall.S.d.1]] from [[http://article.gmane.org/gmane.linux.ports.parisc/2524|JDA]]<br />
<br />
First testcase [[http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=25;filename=minifail.cpp;att=1;bug=561203|minifail.cpp]]<br />
<br />
Build with:<br />
{{{<br />
$ g++ -I/usr/include/qt4 -lQtCore minifail.cpp -o minifail -O0 -g<br />
}}}<br />
<br />
Fails occasionally with:<br />
{{{<br />
$ i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail; done;<br />
$ i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail qt; done;<br />
}}}<br />
<br />
Typical observed failure:<br />
{{{<br />
Run 21<br />
Segmentation fault<br />
Run 22<br />
Child OK.<br />
Thread OK.<br />
Run 23<br />
Thread OK.<br />
Segmentation fault<br />
}}}<br />
<br />
* Reduced [[http://marc.info/?l=linux-parisc&m=126503924510791&q=p4|minifail6.cpp]], from [[http://article.gmane.org/gmane.linux.ports.parisc/2606|this post]]:<br />
* Tentative [[http://marc.info/?l=linux-parisc&m=126514540817084&q=p3|patch]], see this [[http://article.gmane.org/gmane.linux.ports.parisc/2615|post]]<br />
* Other version [[http://marc.info/?l=linux-parisc&m=126523464015510&q=p3|minifail3.c]] from [[http://article.gmane.org/gmane.linux.ports.parisc/2618|Helge Deller]]<br />
* Other version [[http://marc.info/?l=linux-parisc&m=126835038716389&q=p3|minifail9.cpp]] from [[http://article.gmane.org/gmane.linux.ports.parisc/2685|JDA]]<br />
* Other version [[http://marc.info/?l=linux-parisc&m=126919558329853&q=p3|minifail12.cpp]] from [[http://article.gmane.org/gmane.linux.ports.parisc/2693|JDA]]<br />
* '''Final''' (?) version [[http://marc.info/?l=linux-parisc&m=127275273129566&q=p3|minifail_dave.cpp]] from [[http://article.gmane.org/gmane.linux.ports.parisc/2824|Helge Deller]]<br />
<br />
----<br />
<br />
Other testcase from [[http://article.gmane.org/gmane.linux.ports.parisc/2774|JDA]]:<br />
<br />
Compile with `-static` to link with libc.a. Testcase prints incorrect parent pid.:<br />
<br />
{{{#!cplusplus<br />
#include <stdio.h><br />
#include <stdlib.h><br />
#include <errno.h><br />
#include <sys/types.h><br />
#include <unistd.h><br />
<br />
#define CALL_EXIT 0<br />
<br />
int main (void)<br />
{<br />
pid_t child;<br />
pid_t parent;<br />
char *cmd[] = { "bash", "-c", "echo In child $$;", (char *)0 };<br />
char *env[] = { "HOME=/tmp", (char *)0 };<br />
int ret;<br />
<br />
child = vfork();<br />
<br />
if (child == 0)<br />
{<br />
ret = execve("/bin/bash", cmd, env);<br />
// printf ("ret = %d\n", ret);<br />
_exit(1);<br />
}<br />
else<br />
{<br />
// printf("child != 0\n");<br />
}<br />
<br />
parent = getpid();<br />
printf("parent is %d\n", (unsigned int)parent);<br />
printf("child is %d\n", (unsigned int)child);<br />
<br />
return 0;<br />
}<br />
}}}<br />
<br />
=== Patches ===<br />
<br />
* [[https://patchwork.kernel.org/patch/76829/|parisc_lock_v2.patch]] from Helge Deller - Not Applicable (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/85865/|entry.S.patch]] from JDA (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/90467/|patch1]] from JDA - Superseded by patch2 (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/90596/|patch2]] from JDA - Included in patch3 (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/91525/|bundle patch3]] from JDA - Partially split into<br />
* [[https://patchwork.kernel.org/patch/91916/|Call pagefault_disable/pagefault_enable in kmap_atomic/kunmap_atomic]] (on-buildds)<br />
* [[https://patchwork.kernel.org/patch/91918/|Remove unnecessary macros from entry.S]] (on-buildds)<br />
* [[https://patchwork.kernel.org/patch/91919/|Delete unnecessary nop's in entry.S]] (on-buildds)<br />
* [[https://patchwork.kernel.org/patch/91922/|Avoid interruption in critical region in entry.S]] (on-buildds)<br />
* [[https://patchwork.kernel.org/patch/91924/|LWS fixes for syscall.S]] (on-buildds)<br />
* '''Note:''' some bits from patch3 have not be separately submitted (futex.h, etc) - Needs review<br />
* [[https://patchwork.kernel.org/patch/91933/|pgtable.h patch update]], initially found in patch3 from JDA (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/93520/|bundle patch4]] aka `pte.2.d` from JDA, updating parts of patch3 (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/95969/|patch]] from James Bottomley for kmap issues fixing '''minifail6.cpp''' (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/97971/|bundle patch5]] from JDA with a slightly modified version of James' patch (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/99861/|bundle patch6]] from JDA, with apparently good results both on pa8800 and previous CPUs (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/101741/|bundle patch7]] from JDA, with reworked pacache.s and cache.c (not-upstream)<br />
<br />
== vfork/execve ==<br />
<br />
* Affects [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558905|#558905]]<br />
* Discussed by Carlos O'Donell in [[http://thread.gmane.org/gmane.linux.ports.parisc/2403|this thread]]:<br />
<br />
''I have constructed a vfork test case which shows some of the problems<br />
I have using vfork reliably. This fails every time on my PA8700 system<br />
running 2.6.32-rc6. It appears as though r28 (ret0) in the parent is<br />
being corrupted.''<br />
<br />
The intent of the testcase is to do the following:<br />
a. vfork<br />
a. Launch "ls -l" in the vfork'd child.<br />
a. Print some information in the parent.<br />
<br />
{{{#!cplusplus<br />
/* vfork.c */<br />
#include <stdio.h><br />
#include <stdlib.h><br />
#include <errno.h><br />
<br />
int main (void)<br />
{<br />
pid_t child;<br />
char *cmd[] = { "ls", "-l", (char *)0 };<br />
char *env[] = { "HOME=/tmp", (char *)0 };<br />
<br />
child = vfork();<br />
<br />
if (child == 0)<br />
{<br />
execve("/bin/ls", cmd, env);<br />
}<br />
else<br />
{<br />
printf("child != 0\n");<br />
}<br />
<br />
printf("child is 0x%x\n", (unsigned int)child);<br />
<br />
return 0;<br />
}<br />
}}}<br />
<br />
Compile this test case twice:<br />
{{{<br />
gcc -O1 -g -o vfork-O1 vfork.c<br />
gcc -O0 -g -o vfork-O0 vfork.c<br />
}}}<br />
<br />
The return from vfork is corrupted in the parent.<br />
This gets worse at -O0.<br />
<br />
To remove the C library from the loop I attach a complete vfork<br />
implementation as used by glibc. [[http://marc.info/?l=linux-parisc&m=126013436326095&q=p3|pt-vfork.s]]<br />
<br />
You can compile the test case using: `cc -O1 -g -o vfork-O1 vfork.c pt-vfork.s`<br />
<br />
In summary:<br />
* Test case works on x86.<br />
* Test case fails on hppa.<br />
* Test case works on hppa under strace.<br />
<br />
More discussion by Carlos O'Donell in [[http://thread.gmane.org/gmane.linux.ports.parisc/2725|this thread]]<br />
<br />
* Other testcase [[http://marc.info/?l=linux-parisc&m=126979720816005&q=p3|vforktest.tgz]] by Carlos O'Donell<br />
* Updated (?) testcase [[http://marc.info/?l=linux-parisc&m=126980206121937&q=p3|vforktest.tgz]] by Carlos O'Donell<br />
<br />
=== Patches ===<br />
<br />
* [[https://patchwork.kernel.org/patch/90144/|Patch]] from JDA (not-upstream)<br />
* [[https://patchwork.kernel.org/patch/90018/|Patch]] from Carlos O'Donell - Comments/cleanup (on-buildds)<br />
<br />
<br />
== floating point SIGFPE not trapped ==<br />
<br />
* Affects [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559406|#559406]]<br />
* Testcase [[http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=33;filename=fputest.c;att=1;bug=559406|fputest.c]]<br />
<br />
=== Patches ===<br />
<br />
* [[https://patchwork.kernel.org/patch/96558/|Patch]] from Helge Deller (in-debian, on-buildds)<br />
<br />
= GCC TestCases =<br />
<br />
== MMAP ==<br />
<br />
* Affects [[http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40505|PR40505]].<br />
* Discussed by Carlos O'Donell on [[http://thread.gmane.org/gmane.linux.debian.devel.release/30830/focus=31039|this thread]].<br />
* Testcase [[http://marc.info/?l=linux-parisc&m=124689818116647&q=p3|test-mmap.c]] from Carlos O'Donell<br />
<br />
<br />
= GLIBC TestCases =<br />
<br />
== Segmentation fault in __libc_start_main with -static ==<br />
<br />
Discussed in [[http://thread.gmane.org/gmane.linux.ports.parisc/2585|this thread]]<br />
<br />
Testcase from [[http://marc.info/?l=linux-parisc&m=126477688209053|JDA]]: Compile with `g++ -o xx -static -pthread xx.C`<br />
{{{#!cplusplus<br />
// This test only applies to glibc (NPTL) targets.<br />
// { dg-do run { target *-*-linux* } }<br />
// { dg-options "-pthread" }<br />
<br />
#include <pthread.h><br />
#include <cxxabi.h><br />
extern "C" int printf (const char *, ...);<br />
<br />
int main()<br />
{<br />
try<br />
{<br />
pthread_exit (0);<br />
}<br />
catch (abi::__forced_unwind &)<br />
{<br />
printf ("caught forced unwind\n");<br />
throw;<br />
}<br />
catch (...)<br />
{<br />
printf ("caught ...\n");<br />
return 1;<br />
}<br />
}<br />
}}}</div>
Deller