From: Helmut Wollmersdorfer <helmut@wollmersdorfer.at>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] user interface test of drbd.conf
Date: Thu, 21 Oct 2004 17:56:14 +0200 [thread overview]
Message-ID: <4177DC1E.70600@wollmersdorfer.at> (raw)
In-Reply-To: <WhHybcWnp6n8hv8yqruBrJk=lge@web.de>
Lars Ellenberg wrote:
> / 2004-10-21 14:36:16 +0200
> \ Helmut Wollmersdorfer:
>
>>Lars Ellenberg wrote:
>>
>>>/ 2004-10-20 18:17:27 +0200
>>>\ Helmut Wollmersdorfer:
>>>>From my experience as tester I will not expect, that _any_ values will
>>>>work correctly without "dry-run".
>>>hm?
>>Very easy explanation:
>>As we all know, usally numbers represented in text are converted to an
>>easier to handle representation inside a program. This can be hex,
>>decimal packed, floating etc. and mostly will be of fixed length. Even
>>bignums will have an upper limit (e.g. 64Kdigits). If there is no check
>>for a maximum value at input, funny things can happen in program logik
>>afterwards: overruns, skip to negative values, truncated values, which
>>possible could cause crazy program behaviour.
> but what has that to do with dry-run?
If I only test with dry-run, I only test the parser. This cannot uncover
errors in afterwards logic.
> and to improve the scanner, maybe limiting to 9 digits will do?
[...]
> +OUT_OF_RANGE_NUM [0-9]{10,}[kmgKMG]?
> +NUM [0-9]{1,9}
> +NUM_U [0-9]{1,9}[kmgKMG]?
Let's try
999999999k ~ 1 T
999999999M ~ 1000 T
999999999G ~ 1000000 T
[...]
> <NUM>{
> {NUM} yy_pop_state(); CP; return TK_INTEGER;
> + {OUT_OF_RANGE_NUM} {
> + PRINTF("%s: number too big\n", yytext);
Better:
+ PRINTF("%s: number exceeds limit of 9 digits\n", yytext);
Helmut Wollmersdorfer
next prev parent reply other threads:[~2004-10-21 15:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041020235059.650D53BE6F@garcon.linbit.com>
2004-10-20 16:17 ` [Drbd-dev] user interface test of drbd.conf Helmut Wollmersdorfer
2004-10-20 23:13 ` Lars Ellenberg
2004-10-21 12:36 ` Helmut Wollmersdorfer
2004-10-21 13:17 ` Lars Ellenberg
2004-10-21 14:42 ` Philipp Reisner
2004-10-21 15:29 ` Helmut Wollmersdorfer
2004-10-21 15:56 ` Helmut Wollmersdorfer [this message]
2004-10-21 17:03 ` Lars Ellenberg
2004-10-20 23:58 ` Lars Ellenberg
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=4177DC1E.70600@wollmersdorfer.at \
--to=helmut@wollmersdorfer.at \
--cc=drbd-dev@lists.linbit.com \
/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