Skip to contentSkip to conversation

Patches for POSIX test cases

LTP Superseded Kang Kai 4 participants 11 messages Dec 9, 2011 – Dec 13, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

Hi All,

These two patches are for POSIX test suite, and could anyone give some comments? Thanks.

And is there a irc channel for ltp/posix, I need some help about POSIX test on linux.

Thanks and Regards,
Kai

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#1 lore raw

PATCH 1/2 pthread_mutex_lock/3-1: make sure install signal hanldler first

Test case failed for linux in some platform. Make parent thread sleep for a while to make sure that signal handlers are installed before send signal USR1 and USR2.

---
 .../interfaces/pthread_mutex_lock/3-1.c            |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c +3 -1
index 771851d..a648c96 100644
@@ -307,6 +307,8 @@ int main (int argc, char * argv[])
 	if ((ret = pthread_create(&th_work, NULL, threaded, NULL)))
 	{ UNRESOLVED(ret, "Worker thread creation failed"); }
 
+	sleep(1);
+
 	arg1.thr = &th_work;
 	arg2.thr = &th_work;
 	arg1.sig = SIGUSR1;
@@ -359,4 +361,4 @@ int main (int argc, char * argv[])
 	#endif
 	#endif
 	PASSED;
-}
\ No newline at end of file
+}
Signature · 13 lines
1.7.5.4


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw

Re: [LTP] [PATCH 1/2] pthread_mutex_lock/3-1: make sure install signal hanldler first

Quoted 30 lines · Kang Kai

Test case failed for linux in some platform. Make parent thread sleep for a while to make sure that signal handlers are installed before send signal USR1 and USR2.

---
 .../interfaces/pthread_mutex_lock/3-1.c            |    4 +++-

 1 files changed, 3 insertions(+), 1 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c +3 -2
index 771851d..a648c96 100644
@@ -307,6 +307,8 @@ int main (int argc, char * argv[])
        if ((ret = pthread_create(&th_work, NULL, threaded, NULL)))
        { UNRESOLVED(ret, "Worker thread creation failed"); }
 
+       sleep(1);
+
        arg1.thr = &th_work;
        arg2.thr = &th_work;
        arg1.sig = SIGUSR1;
@@ -359,4 +361,4 @@ int main (int argc, char * argv[])
        #endif
        #endif
        PASSED;
-}
\ No newline at end of file
+}
--
Quoted 1 line

1.7.5.4

It's better than status quo, but it's still kind of race prone (highly unlikely, but you never know). It seems like a pthread_mutex would make more sense in this case.
Thanks,
-Garrett

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#3 lore raw

PATCH 2/2 pthread_rwlock_unlock/4-2: remove local var 'rc'

In reply to Kang Kai

Local var 'rc' in function main hides the global one. In child thread it sets global var 'rc' with funtion return value. But in function main, test var 'rc' always succeeds because it tests local var 'rc'.

---
 .../interfaces/pthread_rwlock_unlock/4-2.c         |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +1 -2
index 3023886..4928f85 100644
@@ -54,7 +54,6 @@ static void* fn_unlk(void *arg)
 int main()
 {
 	int cnt = 0;
-	int rc = 0;
 
 	pthread_t un_thread;
 
@@ -125,4 +124,4 @@ int main()
 
 	printf("Test PASSED: Note*: Returned 0 instead of EPERM, but standard specified _may_ fail.\n");
 	return PTS_PASS;
-}
\ No newline at end of file
+}
Signature · 13 lines
1.7.5.4


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Reviewed-by on v1 2/2
#4 lore raw

Re: [LTP] [PATCH 2/2] pthread_rwlock_unlock/4-2: remove local var 'rc'

Quoted 4 lines · Kang Kai

Local var 'rc' in function main hides the global one. In child thread it sets global var 'rc' with funtion return value. But in function main, test var 'rc' always succeeds because it tests local var 'rc'.

Good catch.

Quoted 18 lines
---
 .../interfaces/pthread_rwlock_unlock/4-2.c         |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +0 -1
index 3023886..4928f85 100644
@@ -54,7 +54,6 @@ static void* fn_unlk(void *arg)
 int main()
 {
 	int cnt = 0;
-	int rc = 0;
 
 	pthread_t un_thread;
 

testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c int main() · line 127

Quoted 6 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +1 -1
@@ -125,4 +124,4 @@ int main()
 
 	printf("Test PASSED: Note*: Returned 0 instead of EPERM, but standard specified _may_ fail.\n");
 	return PTS_PASS;
-}
\ No newline at end of file
+}

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw

Re: [LTP] [PATCH 2/2] pthread_rwlock_unlock/4-2: remove local var 'rc'

Quoted 29 lines · Wanlong Gao
Quoted 4 lines · Kang Kai

Local var 'rc' in function main hides the global one. In child thread it sets global var 'rc' with funtion return value. But in function main, test var 'rc' always succeeds because it tests local var 'rc'.

Good catch.

Quoted 17 lines

---
 .../interfaces/pthread_rwlock_unlock/4-2.c         |    3 +--

 1 files changed, 1 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +0 -1
index 3023886..4928f85 100644
@@ -54,7 +54,6 @@ static void* fn_unlk(void *arg)
  int main()
  {
       int cnt = 0;
-     int rc = 0;
 
       pthread_t un_thread;
 
Quoted 7 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c int main() · line 127

Quoted 7 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +1 -1
@@ -125,4 +124,4 @@ int main()
 
       printf("Test PASSED: Note*: Returned 0 instead of EPERM, but standard specified _may_ fail.\n");
       return PTS_PASS;
-}
\ No newline at end of file
+}

Will be committed soon (kind of interesting why -Wshadow didn't identify this issue...).
-Garrett

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#6 lore raw

Re: [LTP] [PATCH 2/2] pthread_rwlock_unlock/4-2: remove local var 'rc'

Quoted 32 lines · Garrett Cooper
Quoted 31 lines · Wanlong Gao
Quoted 4 lines · Kang Kai

Local var 'rc' in function main hides the global one. In child thread it sets global var 'rc' with funtion return value. But in function main, test var 'rc' always succeeds because it tests local var 'rc'.

Good catch.

Quoted 19 lines
---
 .../interfaces/pthread_rwlock_unlock/4-2.c         |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +0 -1
index 3023886..4928f85 100644
@@ -54,7 +54,6 @@ static void* fn_unlk(void *arg)
 int main()
 {
      int cnt = 0;
-     int rc = 0;
 
      pthread_t un_thread;
 
@@ -125,4 +124,4 @@ int main()
 
Quoted 8 lines
Quoted 5 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c int main() · line 127

Quoted 5 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c +1 -1
      printf("Test PASSED: Note*: Returned 0 instead of EPERM, but standard specified _may_ fail.\n");
      return PTS_PASS;
-}
\ No newline at end of file
+}

Will be committed soon (kind of interesting why -Wshadow didn't identify this issue...).

Yeah, odd, I didn't see warning by -Wshadow, either.

Quoted 2 lines

-Garrett

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#7 lore raw
In reply to Kang Kai
Quoted 5 lines · Kang Kai

Hi All,

These two patches are for POSIX test suite, and could anyone give some comments? Thanks.

And is there a irc channel for ltp/posix, I need some help about POSIX test on linux.

It seems there isn't a irc. You can just send email to list.

Quoted 7 lines

Thanks and Regards,
Kai

Quoted 11 lines

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#8 lore raw
Quoted 9 lines · Wanlong Gao
Quoted 5 lines · Kang Kai

Hi All,

These two patches are for POSIX test suite, and could anyone give some comments? Thanks.

And is there a irc channel for ltp/posix, I need some help about POSIX test on linux.

It seems there isn't a irc. You can just send email to list.

OK, thanks.

Quoted 7 lines
Quoted 7 lines

Thanks and Regards,
Kai

Quoted 12 lines
Quoted 11 lines

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#9 lore raw
In reply to Wanlong Gao
Quoted 10 lines · Wanlong Gao
Quoted 5 lines · Kang Kai

Hi All,

These two patches are for POSIX test suite, and could anyone give some comments? Thanks.

And is there a irc channel for ltp/posix, I need some help about POSIX test on linux.

It seems there isn't a irc. You can just send email to list.

There was an IRC chan for LTP, but I don't know how much/often people stick around there. Subrata was there for a while along with Mike F. and your's truly. I don't hang around IRC all that much -- esp. not EFNET.
-Garrett

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#10 lore raw
In reply to Kang Kai

Hi!

Quoted 3 lines

These two patches are for POSIX test suite, and could anyone give some comments? Thanks.

And is there a irc channel for ltp/posix, I need some help about POSIX test on linux.

There is an LTP channel on freenode (And I'm usually there under nick metan at least during my working hours).

And just now I've been overhelmed by other tasks, so stay tuned I'll look at the patches soon enough.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list