public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@petalogix.com>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Jiri Palecek <jpalecek@web.de>,
	Nathan T Lynch <natlynch@us.ibm.com>,
	vapier@gentoo.org, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] clone tests fails
Date: Wed, 06 Jan 2010 11:19:25 +0100	[thread overview]
Message-ID: <4B4463AD.8050806@petalogix.com> (raw)
In-Reply-To: <20100106032644.GB8157@us.ibm.com>

Serge E. Hallyn wrote:
> Quoting Jiri Palecek (jpalecek@web.de):
>> Serge E. Hallyn napsal(a):
>>> Quoting Michal Simek (michal.simek@petalogix.com):
>>>> Serge E. Hallyn wrote:
>>>>> Quoting Michal Simek (michal.simek@petalogix.com):
>>>>>> Hi Mike,
>>>>>>
>>>>>> I have one question about one your big patch
>>>>>>
>>>>>> http://git.kernel.org/?p=linux/kernel/git/galak/ltp.git;a=commitdiff;h=391dc18fe3271fbf2ca1864a5299f091c31e0018
>>>>>>
>>>>>> My question is why you add -1 in lib/cloner.c:65
>>>>>>
>>>>>> +       ret = clone(fn, (stack ? stack + stack_size - 1 : NULL),
>>>>>> +                       clone_flags, arg);
>>>>>>
>>>>>> In previous code in clone testcases was nothing like this.
>>>>>> What reason have you had to add it?
>>>>> Because the same thing was done in lots of places all over the
>>>>> testsuite (and done wrong).  This consolidates them all.
>>>>
>>>> I don't have anything against consolidation. I just want to know why
>>>> there is that -1 which weren't in any clone testcases. Nothing more
>>>> nothing less.
>>> ooooh.  Because if we've done stack = malloc(stack_size), then
>>> stack+stack_size is 1 above the the top of stack.
>> If the value of the parameter is the stack pointer of the created
>> thread, it shouldn't matter - the address should never be used (read
>> or written).
>>
>> Michal, I suspect the failures you see are somehow related to
>> alignment (that your architecture doesn't like odd addresses). Is
>> that right? Under x86, the address gets aligned (so some of the
>> space is unused).
>>
>> Perhaps both of these behaviors should be tested by LTP?
> 
> Gah, yes, Nathan had mentioned arches where this matters (including
> some power?).  Nathan, did you have a generic fix for this in
> userspace?  Should always be safe to do
> 	(stack + stack_size - 1) & ~0xf
> ?

(long)(stack + stack_size - 1) & ~0x3

0x3 is enough - just clear last 2 bits.
I am not sure about long type - maybe need long long or long double.

Mike's solution not work for me.

Thanks,
Michal






> 
> -serge


-- 
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2010-01-06 10:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 16:17 [LTP] clone tests fails Michal Simek
2010-01-04 16:49 ` Serge E. Hallyn
2010-01-04 17:35   ` Michal Simek
2010-01-04 17:49     ` Serge E. Hallyn
2010-01-06  1:05       ` Jiri Palecek
2010-01-06  3:26         ` Serge E. Hallyn
2010-01-06  5:25           ` Mike Frysinger
2010-01-07  1:25             ` Jiri Palecek
2010-01-06 10:19           ` Michal Simek [this message]
2010-01-06  5:25         ` Mike Frysinger
2010-01-07  1:21           ` Jiri Palecek
2010-01-06 10:15         ` Michal Simek
2010-01-07  1:12           ` Jiri Palecek
2010-01-07 14:12             ` Michal Simek

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=4B4463AD.8050806@petalogix.com \
    --to=michal.simek@petalogix.com \
    --cc=jpalecek@web.de \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=natlynch@us.ibm.com \
    --cc=serue@us.ibm.com \
    --cc=vapier@gentoo.org \
    /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