From: Jan Stancek <jstancek@redhat.com>
To: Kang Kai <Kai.Kang@windriver.com>
Cc: ltp-list@lists.sourceforge.net,
Zhenfeng Zhao <Zhenfeng.Zhao@windriver.com>
Subject: Re: [LTP] [PATCH] pthread_detach/4-3: workaround for segment fault
Date: Tue, 28 Aug 2012 04:37:13 -0400 (EDT) [thread overview]
Message-ID: <1527836506.11605302.1346143033089.JavaMail.root@redhat.com> (raw)
In-Reply-To: <5036EB22.9090303@windriver.com>
----- Original Message -----
> From: "Kang Kai" <Kai.Kang@windriver.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net, "Zhenfeng Zhao" <Zhenfeng.Zhao@windriver.com>
> Sent: Friday, 24 August, 2012 4:46:58 AM
> Subject: Re: [LTP] [PATCH] pthread_detach/4-3: workaround for segment fault
> >> I was thinking usleep(sleep_time) that progressively increases. So
> >> it
> >> starts firing signals as quickly as it can and slows down over
> >> time.
> >> Each pthread_detach() would reset the sleep_time.
> >>
> >> As for our original issue, idea I'm playing with is:
> >>
> >> main (procA) - do_child (procB) - send_sig (thread)
> >> \
> >> test (thread) - threaded
> >> (detached thread)
> >>
> >> - turn 'while' in test() to single 'for' loop
> >> - loop in main, fork and call do_child, wait for child to finish
> > Hi,
> >
> > attached is v1 of the idea above. I ran it 100x times on various
> > setups as root and unprivileged user.
>
> Hi Jan,
>
> Great!
> > Kai, would you like to give a try?
> I have test it on routerstation, x86_64(ubuntu11.10 & redhat 5.3) and
> x86(redhat 5.3) each 100+ times, and all PASS.
>
Hi,
I'm still looking at this testcase. I have been testing v1 more on different
releases and arches and I'm hitting an issue on ppc64 RHEL6.3.
I'm getting abort from gcc_assert. The most interesting thing is that
thread, which aborts shouldn't exist, because for this scenario pthread_create
returns 1 (EPERM).
(gdb) bt
#0 0x0000008066374e50 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x0000008066376de4 in abort () at abort.c:92
#2 0x000000806687e504 in _Unwind_SetSpColumn (context=0xfff97a0df58, outer_cfa=0xfff97a0e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1265
#3 uw_init_context_1 (context=0xfff97a0df58, outer_cfa=0xfff97a0e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1472
#4 0x000000806687ebe0 in _Unwind_ForcedUnwind (exc=0xfff97a0f670, stop=@0x8066560ad8: 0x8066545660 <unwind_stop>, stop_argument=0xfff97a0e880) at ../../../gcc/unwind.inc:201
#5 0x0000008066548904 in _Unwind_ForcedUnwind (exc=<value optimized out>, stop=<value optimized out>, stop_argument=<value optimized out>) at ../nptl/sysdeps/pthread/unwind-forcedunwind.c:132
#6 0x0000008066545600 in __pthread_unwind (buf=<value optimized out>) at unwind.c:130
#7 0x0000008066545bac in __do_cancel () at pthreadP.h:265
#8 __pthread_enable_asynccancel () at cancellation.c:49
#9 0x000000806653c568 in start_thread (arg=0xfff97a0f200) at pthread_create.c:289
#10 0x000000806643a32c in .__clone () from /lib64/libc-2.12.so
(gdb) frame 2
#2 0x000000806687e504 in _Unwind_SetSpColumn (context=0xfff97a0df58, outer_cfa=0xfff97a0e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1265
1265 gcc_assert (size == sizeof(_Unwind_Word));
The arg in threaded() is not used for anything, so I passed scenario number as parameter.
(gdb) p/x ((struct pthread *) 0xfff97a0f200)->arg
$1 = 0x12
So it's thread for scenario 0x12. This scenario tries to set explicit scheduling with max
priority. When you run this as unprivileged user, pthread_create gives you EPERM.
This comment is interesting, same gcc_assert(), also power7:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52839#c10
Regards,
Jan
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2012-08-28 8:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 10:35 [LTP] [PATCH] pthread_detach/4-3: workaround for segment fault Jan Stancek
2012-08-22 2:29 ` Kang Kai
2012-08-22 7:06 ` Jan Stancek
2012-08-22 8:28 ` Kang Kai
2012-08-22 8:58 ` Jan Stancek
2012-08-22 14:20 ` Jan Stancek
2012-08-23 6:21 ` Kang Kai
2012-08-23 7:09 ` Jan Stancek
2012-08-23 11:07 ` Jan Stancek
2012-08-24 2:46 ` Kang Kai
2012-08-28 8:37 ` Jan Stancek [this message]
2012-08-29 8:57 ` Kang Kai
2012-08-29 9:21 ` Jan Stancek
-- strict thread matches above, loose matches on Subject: below --
2012-08-14 9:00 Kang Kai
2012-08-18 22:58 ` Wanlong Gao
2012-08-20 1:39 ` Kang Kai
2012-08-20 2:01 ` Wanlong Gao
2012-08-20 2:21 ` Kang Kai
2012-08-21 1:31 ` Kang Kai
2012-08-21 1:35 ` Wanlong Gao
2012-08-21 9:24 ` Kang Kai
2012-08-21 9:24 ` Wanlong Gao
2012-08-21 9:45 ` Jan Stancek
2012-08-21 9:59 ` Kang Kai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1527836506.11605302.1346143033089.JavaMail.root@redhat.com \
--to=jstancek@redhat.com \
--cc=Kai.Kang@windriver.com \
--cc=Zhenfeng.Zhao@windriver.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox