Message48810
Logged In: YES
user_id=21627
I think it will always be possible to produce crashes. If
some operating system treats a parameter as a pointer, it
doesn't matter whether we process ints or longs;it might
always cause overwriting some random memory (if the system
uses the pointer for output).
The only solution would be to restrict the commands to the
ones we understand, giving an exception for the rest. In the
spirit of "consenting adults", this would be unpythonic.
So if we want to give the user more control, we might do
type-based reasoning: if the user passes an int, pass an C
int (raising an exception if it is out of range). If the
user passes a long, pass a C long if it fits, else a C long
long, else raise an exception.
I'm concerned about the POSIX vs. Linux story, though: POSIX
claims that these are ints in many cases, yet Linux
apparently uses long throughout. Doesn't this give an
inconsistency in calling conventions on 64-bit platforms
(with 64-bit longs), which would make Linux not POSIX-compliant? |
|
Date |
User |
Action |
Args |
2007-08-23 15:44:05 | admin | link | issue1309352 messages |
2007-08-23 15:44:05 | admin | create | |
|