Skip to contentSkip to conversation

pthread_detach/4-3: workaround for segment fault

PATCH In review Kang Kai 3 participants 11 messages Aug 14, 2012 – Aug 21, 2012

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

PATCH 1/1 pthread_detach/4-3: workaround for segment fault

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Fix typo at same time.

---
 .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +2 -2
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
 #include "../testfrmw/testfrmw.c"
 
 #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
 #endif
 
 #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
 	do {
 		do_it2 = 0;
-	} while (do_it2 = 0);
+	} while (do_it2);
 
 	ret = pthread_join(th_sig1, NULL);
 	if (ret)
Signature · 13 lines
1.7.5.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

Quoted 2 lines

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 21 lines
---
 .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
 #include "../testfrmw/testfrmw.c"
 
 #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
 #endif
 
 #define WITH_SYNCHRO

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
 	do {
 		do_it2 = 0;
-	} while (do_it2 = 0);
+	} while (do_it2);
 
 	ret = pthread_join(th_sig1, NULL);
 	if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#2 lore raw
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".
It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

Regards,
Kai

Quoted 27 lines
Quoted 2 lines

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 20 lines
---
  .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
  #include "../testfrmw/testfrmw.c"
 
  #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
  #endif
 
  #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
Quoted 9 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
  	do {
  		do_it2 = 0;
-	} while (do_it2 = 0);
+	} while (do_it2);
 
  	ret = pthread_join(th_sig1, NULL);
  	if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Thanks,
Wanlong Gao

Quoted 42 lines

Regards,
Kai

Quoted 36 lines
Quoted 2 lines

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 28 lines
---
  .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +2 -2
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
  #include "../testfrmw/testfrmw.c"
 
  #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
  #endif
 
  #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
      do {
          do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
      ret = pthread_join(th_sig1, NULL);
      if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#4 lore raw
Quoted 8 lines · Wanlong Gao
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Quoted 3 lines
Quoted 2 lines

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 43 lines

Thanks,
Wanlong Gao

Quoted 38 lines

Regards,
Kai

Quoted 34 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 28 lines
---
   .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +2 -2
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
   #include "../testfrmw/testfrmw.c"
 
   #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
   #endif
 
   #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
       do {
           do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
       ret = pthread_join(th_sig1, NULL);
       if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Hi Wanlong,

Quoted 10 lines

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Do you meet the "Segmentation Fault" yet?

Regards,
Kai

Quoted 44 lines
Quoted 2 lines
Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 37 lines

Thanks,
Wanlong Gao

Quoted 34 lines

Regards,
Kai

Quoted 31 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 25 lines
---
    .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +2 -2
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
    #include "../testfrmw/testfrmw.c"
 
    #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
    #endif
 
    #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
        do {
            do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
Quoted 14 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 3 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +0 -0
        ret = pthread_join(th_sig1, NULL);
        if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#6 lore raw
Quoted 20 lines · Kang Kai
Quoted 9 lines · Kang Kai
Quoted 8 lines · Wanlong Gao
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Hi Wanlong,

Quoted 7 lines

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic
Quoted 5 lines
Quoted 3 lines

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Do you meet the "Segmentation Fault" yet?

Not yet.

Thanks,
Wanlong Gao

Quoted 64 lines

Regards,
Kai

Quoted 58 lines
Quoted 2 lines
Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 32 lines

Thanks,
Wanlong Gao

Quoted 29 lines

Regards,
Kai

Quoted 26 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 20 lines
---
    .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
    #include "../testfrmw/testfrmw.c"
 
    #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
    #endif
 
    #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
        do {
            do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
        ret = pthread_join(th_sig1, NULL);
        if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#7 lore raw
Quoted 20 lines · Wanlong Gao
Quoted 19 lines · Kang Kai
Quoted 9 lines · Kang Kai
Quoted 8 lines · Wanlong Gao
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Hi Wanlong,

Quoted 7 lines

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Do you meet the "Segmentation Fault" yet?

Hi Wanlong,

Quoted 1 line

Not yet.

I test it on x86_64 with Redhat 5.3, it doesn't fail. I try to compare them to find why it fails with Ubuntu 11.10.

Thanks,
Kai

Quoted 66 lines

Thanks,
Wanlong Gao

Quoted 61 lines

Regards,
Kai

Quoted 57 lines
Quoted 2 lines
Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 32 lines

Thanks,
Wanlong Gao

Quoted 29 lines

Regards,
Kai

Quoted 26 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 20 lines
---
     .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
     #include "../testfrmw/testfrmw.c"
 
     #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
     #endif
 
     #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
         do {
             do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
         ret = pthread_join(th_sig1, NULL);
         if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#8 lore raw
Quoted 24 lines · Kang Kai
Quoted 23 lines · Wanlong Gao
Quoted 22 lines · Kang Kai
Quoted 9 lines · Kang Kai
Quoted 8 lines · Wanlong Gao
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Hi Wanlong,

Quoted 10 lines

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Quoted 6 lines
Quoted 1 line
Quoted 1 line

Do you meet the "Segmentation Fault" yet?

Hi Wanlong,

Quoted 1 line

Not yet.

I test it on x86_64 with Redhat 5.3, it doesn't fail. I try to compare them to find why it fails with Ubuntu 11.10.

OK, please.

Thanks,
Wanlong Gao

Quoted 72 lines

Thanks,
Kai

Quoted 66 lines

Thanks,
Wanlong Gao

Quoted 61 lines

Regards,
Kai

Quoted 57 lines
Quoted 2 lines
Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 32 lines

Thanks,
Wanlong Gao

Quoted 29 lines

Regards,
Kai

Quoted 26 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 20 lines
---
     .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
     #include "../testfrmw/testfrmw.c"
 
     #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
     #endif
 
     #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
         do {
             do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
         ret = pthread_join(th_sig1, NULL);
         if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#9 lore raw
In reply to Kang Kai
Quoted 21 lines · Kang Kai
Quoted 20 lines · Wanlong Gao
Quoted 19 lines · Kang Kai
Quoted 9 lines · Kang Kai
Quoted 8 lines · Wanlong Gao
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Hi Wanlong,

Quoted 7 lines

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Do you meet the "Segmentation Fault" yet?

Hi Wanlong,

Quoted 1 line

Not yet.

I test it on x86_64 with Redhat 5.3, it doesn't fail.

I tried to reproduce it on x86_64 RHEL6/7 (real hw+kvm) and ubuntu-12.04-server (kvm), but without any luck.

I spotted one possible issue:

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +7 -3
index 5c15e93..7b738e7 100644
@@ -129,9 +129,13 @@ static void *threaded(void *arg)
                UNRESOLVED(ret, "Unable to unblock SIGUSR1 and SIGUSR2"
                           " in worker thread");
 
-       ret = pthread_detach(pthread_self());
-       if (ret == EINTR)
-               FAILED("pthread_detach() returned EINTR");
+       /* Attempting to detach an already detached thread results
+        * in unspecified behavior */
+       if (scenarii[sc].detached != 1) {
+               ret = pthread_detach(pthread_self());
+               if (ret == EINTR)
+                       FAILED("pthread_detach() returned EINTR");
+       }
 
        /* Signal we're done */
        do {

Regards,
Jan

Quoted 73 lines

I try to compare them to find why it fails with Ubuntu 11.10.

Thanks,
Kai

Quoted 66 lines

Thanks,
Wanlong Gao

Quoted 61 lines

Regards,
Kai

Quoted 57 lines
Quoted 2 lines
Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 32 lines

Thanks,
Wanlong Gao

Quoted 29 lines

Regards,
Kai

Quoted 26 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 20 lines
---
     .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
     #include "../testfrmw/testfrmw.c"
 
     #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
     #endif
 
     #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
         do {
             do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
         ret = pthread_join(th_sig1, NULL);
         if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Quoted 10 lines

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#10 lore raw
Quoted 45 lines · Jan Stancek
Quoted 21 lines · Kang Kai
Quoted 20 lines · Wanlong Gao
Quoted 19 lines · Kang Kai
Quoted 9 lines · Kang Kai
Quoted 8 lines · Wanlong Gao
Quoted 6 lines · Kang Kai
Quoted 4 lines · Wanlong Gao
Quoted 2 lines · Kang Kai

This case fails randomly with "Segmentation fault". Reset VERBOSE to 6 can avoid this problem.

Can you explain that why "reset VERBOSE" can avoid this "Seg Fault" problem?

It is a multi-thread issue. You can run it for less than 10 times, and it will fail with "Segmentation fault".

I didn't see this on my side.

Hi Wanlong,

Quoted 7 lines

It fails both on mips and x86_64.
On the x86_64,

cpu:  Intel I7
OS:   Ubuntu 11.10
libc:  eglibc 2.13
kernel: 3.0.0-12-generic
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

How about try this script on a x86_64 machine:
for i in $(seq 100); do echo $i; ./4-3.run-test ; ret=$?; if [ $ret -ne 0 ]; then echo $? ; break; fi; done

Do you meet the "Segmentation Fault" yet?

Hi Wanlong,

Quoted 1 line

Not yet.

I test it on x86_64 with Redhat 5.3, it doesn't fail.

I tried to reproduce it on x86_64 RHEL6/7 (real hw+kvm) and ubuntu-12.04-server (kvm), but without any luck.

I spotted one possible issue:

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +0 -1
index 5c15e93..7b738e7 100644
@@ -129,9 +129,13 @@ static void *threaded(void *arg)
                 UNRESOLVED(ret, "Unable to unblock SIGUSR1 and SIGUSR2"
                            " in worker thread");
 
-       ret = pthread_detach(pthread_self());

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c static void *threaded(void *arg) · line 139

Quoted 10 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +7 -2
-       if (ret == EINTR)
-               FAILED("pthread_detach() returned EINTR");
+       /* Attempting to detach an already detached thread results
+        * in unspecified behavior */
+       if (scenarii[sc].detached != 1) {
+               ret = pthread_detach(pthread_self());
+               if (ret == EINTR)
+                       FAILED("pthread_detach() returned EINTR");
+       }
 

Hi Jan,

Thanks.
I am sorry that It doesn't work and still "segment fault".

Regards,
Kai

Quoted 86 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +0 -0
         /* Signal we're done */
         do {

Regards,
Jan

Quoted 79 lines

I try to compare them to find why it fails with Ubuntu 11.10.

Thanks,
Kai

Quoted 63 lines

Thanks,
Wanlong Gao

Quoted 60 lines

Regards,
Kai

Quoted 57 lines
Quoted 2 lines
Quoted 1 line

It is hard to debug and I didn't find the root cause, but open the VERBOSE will avoid this situation. So it is a workaround.

I'd like to send a patch to fix this typo first.

Fine.

Regards,
Kai

Quoted 32 lines

Thanks,
Wanlong Gao

Quoted 29 lines

Regards,
Kai

Quoted 26 lines
Quoted 1 line

Fix typo at same time.

The typo fix is OK.

Thanks,
Wanlong Gao

Quoted 20 lines
---
      .../conformance/interfaces/pthread_detach/4-3.c    |    4 ++--
      1 files changed, 2 insertions(+), 2 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
index 5c15e93..23738dc 100644
@@ -49,7 +49,7 @@
      #include "../testfrmw/testfrmw.c"
 
      #ifndef VERBOSE
-#define VERBOSE 1
+#define VERBOSE 6
      #endif
 
      #define WITH_SYNCHRO
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c int main(int argc, char *argv[]) · line 287

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c +1 -1
          do {
              do_it2 = 0;
-    } while (do_it2 = 0);
+    } while (do_it2);
 
          ret = pthread_join(th_sig1, NULL);
          if (ret)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list