* [uml-devel] NPTL pthread_create() cannot work.
@ 2005-07-29 11:12 Zhu Tom-a2289c
2005-07-30 18:55 ` Blaisorblade
0 siblings, 1 reply; 8+ messages in thread
From: Zhu Tom-a2289c @ 2005-07-29 11:12 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: blaisorblade
[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]
Dear all,
I am using patch <http://www.user-mode-linux.org/~blaisorblade/patches/devel-guest/uml-2.6.12-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
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 am using libc 2.3.3 and libc 2.3.4.
Note:
on 2.3.2, no "Segment Fault", it looks good.
Has anyone had a test of NPTL on UML?
Thanks,
Tom
[-- Attachment #2: Type: text/html, Size: 6292 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [uml-devel] NPTL pthread_create() cannot work.
2005-07-29 11:12 Zhu Tom-a2289c
@ 2005-07-30 18:55 ` Blaisorblade
0 siblings, 0 replies; 8+ messages in thread
From: Blaisorblade @ 2005-07-30 18:55 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Zhu Tom-a2289c
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [uml-devel] NPTL pthread_create() cannot work.
@ 2005-08-01 1:37 Zhu Tom-a2289c
0 siblings, 0 replies; 8+ messages in thread
From: Zhu Tom-a2289c @ 2005-08-01 1:37 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel
> Yes, I already fixed that recently - that patch is a development one and you're the first tester I heard of.
:-)
> I've succeeded in fixing even this...
Can I get your fix for the further test?
> Is that compiled with NPTL / TLS support? Has 2.3.2 any TLS support at all?
It is said to support NPTL 0.29.
Thanks,
Tom
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [uml-devel] NPTL pthread_create() cannot work.
[not found] <AD266326EC54D9118CE700110A9E2BE205D707D7@zch07exm01.corp.mot.com>
@ 2005-08-03 18:03 ` Blaisorblade
0 siblings, 0 replies; 8+ messages in thread
From: Blaisorblade @ 2005-08-03 18:03 UTC (permalink / raw)
To: Zhu Tom-a2289c; +Cc: user-mode-linux-devel
On Tuesday 02 August 2005 12:05, Zhu Tom-a2289c wrote:
> Hi Blaisor,
>
> I see your new patch on
> http://www.user-mode-linux.org/~blaisorblade/patches/devel-guest/uml-2.6.13
>-rc3-git-bb-20050731-19:08/ Does this fix the problem?
> I used vinilla 2.6.13-rc3 kernel, no matter whether adding git patch,
> I cannot apply all the patches.
Applying *all* the patches won't work, but until *TLS* it should
> Could you indicate which kernel version I should base?
Well, that should be something along -rc4-git3/4, I gave some indications on
the "NEWS page".
> Thanks,
> Tom
>
>
>
> -----Original Message-----
> From: Zhu Tom-a2289c
> Sent: 2005年8月1日 9:37
> To: 'Blaisorblade'
> Cc: user-mode-linux-devel@lists.sourceforge.net
> Subject: RE: [uml-devel] NPTL pthread_create() cannot work.
>
> > Yes, I already fixed that recently - that patch is a development one and
> > you're the first tester I heard of.
> >
> :-)
> :
> > I've succeeded in fixing even this...
>
> Can I get your fix for the further test?
>
> > Is that compiled with NPTL / TLS support? Has 2.3.2 any TLS support at
> > all?
>
> It is said to support NPTL 0.29.
>
> Thanks,
> Tom
--
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! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
-------------------------------------------------------
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [uml-devel] NPTL pthread_create() cannot work.
@ 2005-08-05 7:34 Zhu Tom-a2289c
2005-08-05 15:54 ` Blaisorblade
0 siblings, 1 reply; 8+ messages in thread
From: Zhu Tom-a2289c @ 2005-08-05 7:34 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel
1.
I still fail to use these patches on git3/4,
so, I just made my local fix on 2.6.12-rc4.
pthread_create works goods.
and then find your fix patch include it, seems my fix
is not wrong. :-)
2.
in tls.c,
there are some code looking up the tls_arry
for (idx = GDT_ENTRY_TLS_MIN; idx < GDT_ENTRY_TLS_MAX; idx++) {
shall we use "idx <= GDT_ENTRY_TLS_MAX"?
since
#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
Thanks,
Tom
-----Original Message-----
From: Blaisorblade [mailto:blaisorblade@yahoo.it]
Sent: 2005年8月4日 2:04
To: Zhu Tom-a2289c
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] NPTL pthread_create() cannot work.
On Tuesday 02 August 2005 12:05, Zhu Tom-a2289c wrote:
> Hi Blaisor,
>
> I see your new patch on
>
>http://www.user-mode-linux.org/~blaisorblade/patches/devel-guest/uml-2.
>6.13 -rc3-git-bb-20050731-19:08/ Does this fix the problem?
> I used vinilla 2.6.13-rc3 kernel, no matter whether adding git patch,
> I cannot apply all the patches.
Applying *all* the patches won't work, but until *TLS* it should
> Could you indicate which kernel version I should base?
Well, that should be something along -rc4-git3/4, I gave some indications on the "NEWS page".
> Thanks,
> Tom
>
>
>
> -----Original Message-----
> From: Zhu Tom-a2289c
> Sent: 2005年8月1日 9:37
> To: 'Blaisorblade'
> Cc: user-mode-linux-devel@lists.sourceforge.net
> Subject: RE: [uml-devel] NPTL pthread_create() cannot work.
>
> > Yes, I already fixed that recently - that patch is a development one
> > and you're the first tester I heard of.
> >
> :-)
> :
> > I've succeeded in fixing even this...
>
> Can I get your fix for the further test?
>
> > Is that compiled with NPTL / TLS support? Has 2.3.2 any TLS support
> > at all?
>
> It is said to support NPTL 0.29.
>
> Thanks,
> Tom
--
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! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [uml-devel] NPTL pthread_create() cannot work.
2005-08-05 7:34 [uml-devel] NPTL pthread_create() cannot work Zhu Tom-a2289c
@ 2005-08-05 15:54 ` Blaisorblade
2005-08-07 21:49 ` Rob Landley
0 siblings, 1 reply; 8+ messages in thread
From: Blaisorblade @ 2005-08-05 15:54 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Zhu Tom-a2289c
On Friday 05 August 2005 09:34, Zhu Tom-a2289c wrote:
> 1.
> I still fail to use these patches on git3/4,
Hm, ok... there will be probably some trivial reject...I cannot update those
patches right now since I haven't enough bandwidth.
Just to make sure: you got errors applying until TLS patches, right? Anyhow,
to get the TLS changes only, you need to apply only the following 4 patches:
uml-clean-arch_switch
uml-tls-support-sc-tables
uml-add-tls-support
uml-add-tls-support-debug
They almost apply even on 2.6.12, so should apply for sure on 2.6.13-rc4.
And leave out uml-add-tls-support-flush-empty, it's still broken for now.
> so, I just made my local fix on 2.6.12-rc4.
> pthread_create works goods.
> and then find your fix patch include it, seems my fix
> is not wrong. :-)
Yes, I was probably missing some sleep. Only difference in my patches is that
return value is set to set_tls_entry return value (and this matches with
i386).
Does the system boots ok in that config, including sshd and apps like MySQL /
Apache / Java ? With the previous version of the patches, no TLS data would
work for sure... and sshd still doesn't work on my Sarge (which seems
particularly picky - other people got success with other distros with much
less changes).
> 2.
> in tls.c,
> there are some code looking up the tls_arry
> for (idx = GDT_ENTRY_TLS_MIN; idx < GDT_ENTRY_TLS_MAX; idx++) {
> shall we use "idx <= GDT_ENTRY_TLS_MAX"?
Good catch, thanks, even if this isn't going yet to be the *final* fix (since
we aren't likely using the last slot).
> since
> #define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
> Thanks,
> Tom
--
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! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [uml-devel] NPTL pthread_create() cannot work.
2005-08-05 15:54 ` Blaisorblade
@ 2005-08-07 21:49 ` Rob Landley
0 siblings, 0 replies; 8+ messages in thread
From: Rob Landley @ 2005-08-07 21:49 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Blaisorblade, Zhu Tom-a2289c
On Friday 05 August 2005 10:54, Blaisorblade wrote:
> On Friday 05 August 2005 09:34, Zhu Tom-a2289c wrote:
> > 1.
> > I still fail to use these patches on git3/4,
>
> Hm, ok... there will be probably some trivial reject...I cannot update
> those patches right now since I haven't enough bandwidth.
>
> Just to make sure: you got errors applying until TLS patches, right?
> Anyhow, to get the TLS changes only, you need to apply only the following 4
> patches:
>
> uml-clean-arch_switch
> uml-tls-support-sc-tables
> uml-add-tls-support
> uml-add-tls-support-debug
Um, query:
If somebody wants to test out -skas0 to see if it can be made to work on an
unmodified kbuntu "horny hedgehog" release, which version should one use?
(The july 28 thing? The july 31 snapshot? Or can one just apply those four
patches to 2.6.12 and have some reasonable expectation of something good?)
Keep in mind that -tt mode in 2.6.12.3 seems to be working for me even using
TLS binaries/libraries. (I have no idea why.)
Rob
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [uml-devel] NPTL pthread_create() cannot work.
@ 2005-08-09 3:12 Zhu Tom-a2289c
0 siblings, 0 replies; 8+ messages in thread
From: Zhu Tom-a2289c @ 2005-08-09 3:12 UTC (permalink / raw)
To: Blaisorblade, user-mode-linux-devel
> Hm, ok... there will be probably some trivial reject...I cannot update those patches right now since I haven't enough bandwidth.
On git3/4, cannot make ARCH=um, seems script error.
On git8, cannot run vmlinux. Host needs something?
>> so, I just made my local fix on 2.6.12-rc4.
> Yes, I was probably missing some sleep. Only difference in my patches is that return value is set to set_tls_entry return value (and this matches with i386).
I mean the bug fix of segv problem, when forking, add load_TLS(), ...
>Does the system boots ok in that config, including sshd and apps like MySQL / Apache / Java ? With the previous version of the patches, no TLS data would work for sure... and sshd still doesn't work on my Sarge (which seems particularly picky - other people got success with other distros with much less changes).
I don't know, I am using my rootfs, :-)
> Good catch, thanks, even if this isn't going yet to be the *final* fix (since we aren't likely using the last slot).
I see.
Thanks,
Tom
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-08-10 2:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-05 7:34 [uml-devel] NPTL pthread_create() cannot work Zhu Tom-a2289c
2005-08-05 15:54 ` Blaisorblade
2005-08-07 21:49 ` Rob Landley
-- strict thread matches above, loose matches on Subject: below --
2005-08-09 3:12 Zhu Tom-a2289c
[not found] <AD266326EC54D9118CE700110A9E2BE205D707D7@zch07exm01.corp.mot.com>
2005-08-03 18:03 ` Blaisorblade
2005-08-01 1:37 Zhu Tom-a2289c
2005-07-29 11:12 Zhu Tom-a2289c
2005-07-30 18:55 ` Blaisorblade
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.