All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Patch for LTP
@ 2019-07-24 10:43 piotr.krzysztof.gawel
  2019-07-24 14:25 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: piotr.krzysztof.gawel @ 2019-07-24 10:43 UTC (permalink / raw)
  To: ltp

Dear LTP community,
When I run LTP tests with musl libc, I discovered few issues in tst_timer_test.c:

The array with run times was not sorted. As Rich Felker pointed out, cmp() function breaks the contract for qsort() ? I fixed it.Because array was not sorted, some tests were dumping cores. Plotting function strongly relies on having array sorted. I fixed that in #1 but still prefer defensive
 programming here ? protect against buffer overflow i.e. when input data is incorrect.Calculation if average run time is greater than desired time + threshold was incorrect. Each expected run should be in range t < s[i] < t + threshold, so for max.
 edge: sum(s[i] + threshold) < sum(t + threshold). For i belonging to [d,n] => sum(s[i]) < (n-d)*(t + threshold) and not (n-d)*t + threshold.
Please add this patch to main line of LTP if you don?t see issues here. Feel free to modify the change if needed.Thanks in advance!
Kind regards,Piotr Gawel
null
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190724/88167bb0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ltp-fix-tst_timer-framework.patch
Type: application/patch
Size: 2262 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190724/88167bb0/attachment.bin>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [LTP] Patch for LTP
  2019-07-24 10:43 [LTP] Patch for LTP piotr.krzysztof.gawel
@ 2019-07-24 14:25 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2019-07-24 14:25 UTC (permalink / raw)
  To: ltp

Hi!
> When I run LTP tests with musl libc, I discovered few issues in tst_timer_test.c:
> 
> The array with run times was not sorted. As Rich Felker pointed out, cmp() function breaks the contract for qsort() ??? I fixed it.Because array was not sorted, some tests were dumping cores. Plotting function strongly relies on having array sorted. I fixed that in #1 but still prefer defensive
>  programming here ??? protect against buffer overflow i.e. when input data is incorrect.Calculation if average run time is greater than desired time + threshold was incorrect. Each expected run should be in range t < s[i] < t + threshold, so for max.
>  edge: sum(s[i] + threshold) < sum(t + threshold). For i belonging to [d,n] => sum(s[i]) < (n-d)*(t + threshold) and not (n-d)*t + threshold.
> Please add this patch to main line of LTP if you don???t see issues here. Feel free to modify the change if needed.Thanks in advance!

Good catch, also thanks for the patch.

Can you please split the patch into separate patches?

You are doing unrelated changes each should be in a separate patch.

Also the comment in the compare function should rather be in the patch
description than in the code itself.

Lastly but not least if you could send the patches with git-send-email
or at least inline so that I can comment on the changes in the reply.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-24 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 10:43 [LTP] Patch for LTP piotr.krzysztof.gawel
2019-07-24 14:25 ` Cyril Hrubis

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.