[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    [LTP]  [PATCH] patch for fcntl14 crash in blackfin uclinux
From:       Vivi <violetleigh () gmail ! com>
Date:       2007-11-23 9:01:34
Message-ID: 1ad2dd430711230101q269e917ardabbd0e975d8abb8 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


fcntl14 test case will crash on uclinux on blackfin board, eg: BF537-EZKIT

patch is here for workaround solution to this bug:
---
Index: testcases/kernel/syscalls/fcntl/fcntl14.c
===================================================================
--- testcases/kernel/syscalls/fcntl/fcntl14.c (revision 120)
+++ testcases/kernel/syscalls/fcntl/fcntl14.c (working copy)
@@ -75,7 +75,7 @@ typedef struct {
  long b_start;
  long b_len;
  short c_type;
- short c_whence;
+ int c_whence;
  long c_start;
  long c_len;
  short c_flag;
@@ -579,6 +579,7 @@ setup(void)
  struct sigaction act;

  tst_sig(FORK, DEF_HANDLER, cleanup); /* capture signals */
+ signal(SIGHUP, SIG_IGN);
  umask(0);
  TEST_PAUSE;   /* Pause if that option is specified */
  tst_tmpdir();   /* make temp dir and cd to it */
@@ -1157,7 +1158,7 @@ int main(int ac, char **av)
   }
   /* spawn a child process */
-  if ((child = fork()) == 0) {
+  if ((child = FORK_OR_VFORK()) == 0) {
 #ifdef UCLINUX
    if (self_exec(argv0, "nddddddddd", 2, thiscase->c_type,
           thiscase->c_whence, thiscase->c_start,

---


Best regards,
Violet Leigh

[Attachment #5 (text/html)]

<div>fcntl14 test case will crash&nbsp;on uclinux on blackfin board, eg: \
BF537-EZKIT</div> <div>&nbsp;</div>
<div>patch is here for workaround solution to this bug:<br>---</div>
<div>Index: testcases/kernel/syscalls/fcntl/fcntl14.c<br>===================================================================<br>--- \
testcases/kernel/syscalls/fcntl/fcntl14.c&nbsp;(revision 120)<br>+++ \
testcases/kernel/syscalls/fcntl/fcntl14.c&nbsp;(working copy) <br>@@ -75,7 +75,7 @@ \
typedef struct {<br>&nbsp;&nbsp;long b_start;<br>&nbsp;&nbsp;long \
b_len;<br>&nbsp;&nbsp;short c_type;<br>-&nbsp;short c_whence;<br>+&nbsp;int \
c_whence;<br>&nbsp;&nbsp;long c_start;<br>&nbsp;&nbsp;long \
c_len;<br>&nbsp;&nbsp;short c_flag;<br>@@ -579,6 +579,7 @@ setup(void) \
<br>&nbsp;&nbsp;struct sigaction act;</div> <p>&nbsp;&nbsp;tst_sig(FORK, DEF_HANDLER, \
cleanup);&nbsp;/* capture signals */<br>+&nbsp;signal(SIGHUP, \
SIG_IGN);<br>&nbsp;&nbsp;umask(0);<br>&nbsp;&nbsp;TEST_PAUSE;&nbsp;&nbsp;&nbsp;/* \
Pause if that option is specified */<br>&nbsp;&nbsp;tst_tmpdir();&nbsp;&nbsp;&nbsp;/* \
make temp dir and cd to it */ <br>@@ -1157,7 +1158,7 @@ int main(int ac, char \
**av)<br>&nbsp;&nbsp;&nbsp;}</p> <div>&nbsp;&nbsp;&nbsp;/* spawn a child process \
*/<br>-&nbsp;&nbsp;if ((child = fork()) == 0) {<br>+&nbsp;&nbsp;if ((child = \
FORK_OR_VFORK()) == 0) {<br>&nbsp;#ifdef UCLINUX<br>&nbsp;&nbsp;&nbsp;&nbsp;if \
(self_exec(argv0, &quot;nddddddddd&quot;, 2, \
thiscase-&gt;c_type,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
thiscase-&gt;c_whence, thiscase-&gt;c_start, </div>
<div>&nbsp;</div>
<div>---</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Best regards,</div>
<div>Violet Leigh</div>


["fcntl14.patch" (text/plain)]

Index: testcases/kernel/syscalls/fcntl/fcntl14.c
===================================================================
--- testcases/kernel/syscalls/fcntl/fcntl14.c	(revision 120)
+++ testcases/kernel/syscalls/fcntl/fcntl14.c	(working copy)
@@ -75,7 +75,7 @@ typedef struct {
 	long b_start;
 	long b_len;
 	short c_type;
-	short c_whence;
+	int c_whence;
 	long c_start;
 	long c_len;
 	short c_flag;
@@ -579,6 +579,7 @@ setup(void)
 	struct sigaction act;

 	tst_sig(FORK, DEF_HANDLER, cleanup);	/* capture signals */
+	signal(SIGHUP, SIG_IGN);
 	umask(0);
 	TEST_PAUSE;			/* Pause if that option is specified */
 	tst_tmpdir();			/* make temp dir and cd to it */
@@ -1157,7 +1158,7 @@ int main(int ac, char **av)
 		}

 		/* spawn a child process */
-		if ((child = fork()) == 0) {
+		if ((child = FORK_OR_VFORK()) == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv0, "nddddddddd", 2, thiscase->c_type,
 				      thiscase->c_whence, thiscase->c_start,


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic