From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Zhu Tom-a2289c <A2289c@motorola.com>
Subject: Re: [uml-devel] NPTL pthread_create() cannot work.
Date: Sat, 30 Jul 2005 20:55:43 +0200 [thread overview]
Message-ID: <200507302055.43880.blaisorblade@yahoo.it> (raw)
In-Reply-To: <AD266326EC54D9118CE700110A9E2BE205C830AA@zch07exm01.corp.mot.com>
On Friday 29 July 2005 13:12, Zhu Tom-a2289c wrote:
> Dear all,
> I am using patch
> <http://www.user-mode-linux.org/~blaisorblade/patches/devel-guest/uml-2.6.1
>2-rc4-bb-20050521-18:54/uml-2.6.12-rc4-bb-20050521-18:54.patch.bz2>
> uml-2.6.12-rc4-bb-20050521-18:54.patch.bz2 on kernel 2.6.12-rc4. but found
> pthread_create() cannot work.
> it seems, in copy_thread() in arch/um/kernel/process_kern.c, the ret
> value's setting is not correct
Yes, I already fixed that recently - that patch is a development one and
you're the first tester I heard of.
> int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
> unsigned long stack_top, struct task_struct * p,
> struct pt_regs *regs)
> {
> int ret;
>
> p->thread = (struct thread_struct) INIT_THREAD;
> ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
> clone_flags, sp, stack_top, p, regs);
>
> if (ret || !current->thread.forking)
> goto out;
>
> clear_flushed_tls(p);
>
> if (UPT_ESI(¤t->thread.regs.regs) != UPT_ESI(&p->thread.regs.regs))
> printk(KERN_DEBUG "newtls_new %x,old %x\n", (unsigned int)
> UPT_ESI(¤t->thread.regs.regs), (unsigned int)
> UPT_ESI(&p->thread.regs.regs));
>
> /*
> * Set a new TLS for the child thread?
> */
> if (clone_flags & CLONE_SETTLS) {
> struct user_desc info;
> int idx;
>
> ret = -EFAULT;
> if (copy_from_user(&info, (void __user
> *)UPT_ESI(¤t->thread.regs.regs), sizeof(info))) goto out;
> ret = -EINVAL;
> if (LDT_empty(&info))
> goto out;
>
> idx = info.entry_number;
>
> set_tls_entry(p, &info, idx, 0);
> }
>
> out:
> return ret;
> }
>
>
> I add a "ret=0;" after set_tls_entry(p, &info, idx, 0);
> after it, pthread_create() can return correctly, but the new thread cannot
> be scheduled correctly. there is always a "Segment Fault".
I've succeeded in fixing even this...
> I am using libc 2.3.3 and libc 2.3.4.
>
> Note:
> on 2.3.2, no "Segment Fault", it looks good.
Is that compiled with NPTL / TLS support? Has 2.3.2 any TLS support at all?
> Has anyone had a test of NPTL on UML?
Currently it is known not to work, but I'm working on fixing that.
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Messenger: chiamate gratuite in tutto il mondo
http://it.beta.messenger.yahoo.com
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2005-07-30 19:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-29 11:12 [uml-devel] NPTL pthread_create() cannot work Zhu Tom-a2289c
2005-07-30 18:55 ` Blaisorblade [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-08-01 1:37 Zhu Tom-a2289c
[not found] <AD266326EC54D9118CE700110A9E2BE205D707D7@zch07exm01.corp.mot.com>
2005-08-03 18:03 ` Blaisorblade
2005-08-05 7:34 Zhu Tom-a2289c
2005-08-05 15:54 ` Blaisorblade
2005-08-07 21:49 ` Rob Landley
2005-08-09 3:12 Zhu Tom-a2289c
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=200507302055.43880.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=A2289c@motorola.com \
--cc=user-mode-linux-devel@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