HLA StdLib2 criticism
- From: "vid512@xxxxxxxxx" <vid512@xxxxxxxxx>
- Date: 17 Jan 2007 01:57:47 -0800
allright, you finally released something, so i am gonna point out few
problems i spot
--------- in lowmost (os-dependant level)
1. stdin.read in case of linux:
bad checking for error. linux syscalls doesn't return -1 in case of
error. they return any value in range -4096 < eax < 0. This error is
pretty common in many places in your code. i consider it critical bug,
because you completely fail to catch errors returned by system.
2. memmap in case of linux:
checking for eax<0 isn't enough. linux user space covers 3gb, so
returned pointer can be >7FFFFFFFh. again, -4096 is the magic value.
3. os.system in linux
errors returned by linux.fork() goes completely uncatched.
4. stdin.read in case of win32
why do you check just AL for 0? manual says you need to check entire
return value, which is EAX. What if returned nonzero value is 100h?
-------- now let's get a level higher:
5. stdin.readln
- treating EOF like empty line typed doesn't seem as best solution to
me. usual behavior of input reading routines is to skip all empty space
(including empty lines) before reaching data it wants to read. This may
cause forever-looping.
- i think i have read that maximal linux input size is 4096 characters,
more than yours 1023.
-------- one more level higher:
6. _geti_
- your bad treating of EOF shows up here. altough i cannot test it, i
bet that trying to read number when we are on EOF causes infinite loop.
readln always returns empty string, which is considered as a delimiter
by _geti_. So it will be forever skipping delimiters. This is critical
*design* problem, coming from fact you decided to ignore EOF on input
and then hacked translating EOFs to empty lines.
- also, why do you allow only "delimiter" characters to end number?
it's pretty common to accept for example decimal number "134" from
input "134abc", and leave "abc" on input.
- your fixed input buffer shows up here as another design problem: what
if there is several thousands "0" characters on input, followed by "1"?
This is perfectly valid input, with value 1.
- behavior of your input functions in case of "input value out of
range" differs depending on size of input. If input for geti16 is for
example "123455663532423421412", then number is left on input, but if
it's "32769", then number is readen off the input. How do you await
such error to be handled by caller? Such error is completely not
handlable, and is only useful for displaying it to user.
you see, there are pretty many design problems with HLALib, i hoped you
will fix them for version 2, but you seem to keep ignoring them (I
already told you about some of them).
Looking forward for your answers / explainations
.
- Follow-Ups:
- Re: HLA StdLib2 criticism
- From: randyhyde@xxxxxxxxxxxxx
- Re: HLA StdLib2 criticism
- From: Betov
- Re: HLA StdLib2 criticism
- Prev by Date: Re: Can this be fixed?
- Next by Date: Re: HLA StdLib2 criticism
- Previous by thread: Alternatives to thinking in ASM?
- Next by thread: Re: HLA StdLib2 criticism
- Index(es):
Relevant Pages
|