* CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
@ 2014-05-21 13:40 Raghu Pv
2014-05-22 9:04 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Raghu Pv @ 2014-05-21 13:40 UTC (permalink / raw)
To: linux-arm-kernel
Overview:
CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
Steps to reproduce:
Executing a multithreaded application that creates and terminates
threads and also there a lot of signals
If a signal arrives during execution of clone(), clone is returning
ERESTARTNOINTR to userspace.
We see the following implementation that sets ERESTARTNOINTR:
/*
* Process group and session signals need to be delivered to just the
* parent before the fork or both the parent and the child after the
* fork. Restart if a signal comes in before we add the new process to
* it's process group.
* A fatal signal pending means that current will exit, so the new
* thread can't slip out of an OOM kill (or normal SIGKILL).
*/
recalc_sigpending();
if (signal_pending(current)) {
spin_unlock(¤t->sighand->siglock);
write_unlock_irq(&tasklist_lock);
retval = -ERESTARTNOINTR;
goto bad_fork_cleanup_namespace;
}
Leaking ERESTARTNOINTR to userspace is a big concern because this a
kernel internal error code.
Immediately after that the application crashes.
Actual result: Application crashes
Expected Result: Application should not crash and clone system call
should restart if clone is previously interrupted by a signal.
^ permalink raw reply [flat|nested] 3+ messages in thread
* CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
2014-05-21 13:40 CLONE from pthread_create fails with ERESTARTNOINTR and application crashes Raghu Pv
@ 2014-05-22 9:04 ` Will Deacon
2014-05-22 9:40 ` Raghu Pv
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2014-05-22 9:04 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 21, 2014 at 02:40:16PM +0100, Raghu Pv wrote:
> CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
[...]
> Executing a multithreaded application that creates and terminates
> threads and also there a lot of signals
Do you have sample source for that?
> If a signal arrives during execution of clone(), clone is returning
> ERESTARTNOINTR to userspace.
With which kernel version? Your quote from fork.c doesn't match mainline.
Can you reproduce with -rc6?
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
* CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
2014-05-22 9:04 ` Will Deacon
@ 2014-05-22 9:40 ` Raghu Pv
0 siblings, 0 replies; 3+ messages in thread
From: Raghu Pv @ 2014-05-22 9:40 UTC (permalink / raw)
To: linux-arm-kernel
Hi WiIl,
Many Thanks for responding to my issue.
I am currently using 2.6.18.8 kernel for armv4tl platform.
We are seeing this issue on our larger system codebase which happens
when pthread_create/clone call is interrupted by a signal.
I am currently working out to come up a sample code segment that can
reproduce the issue.
If you are aware of this issue in 2.6.18.8 kernel and if it is fixed
in subsequent commits please help me to find the relevant patches that
can resolve the problem.
I look forward for your response.
Thanks in advance.
Thanks,
Raghu
On 22 May 2014 10:04, Will Deacon <will.deacon@arm.com> wrote:
> On Wed, May 21, 2014 at 02:40:16PM +0100, Raghu Pv wrote:
>> CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
>
> [...]
>
>> Executing a multithreaded application that creates and terminates
>> threads and also there a lot of signals
>
> Do you have sample source for that?
>
>> If a signal arrives during execution of clone(), clone is returning
>> ERESTARTNOINTR to userspace.
>
> With which kernel version? Your quote from fork.c doesn't match mainline.
> Can you reproduce with -rc6?
>
> Will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-22 9:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 13:40 CLONE from pthread_create fails with ERESTARTNOINTR and application crashes Raghu Pv
2014-05-22 9:04 ` Will Deacon
2014-05-22 9:40 ` Raghu Pv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).