From: Pu, L. <lo...@in...> - 2004-11-24 01:04:13
|
I attached a patch to remove mincore01 test2. Pu Long -----Original Message----- From: Jin, Gordon=20 Sent: 2004=C4=EA11=D4=C213=C8=D5 9:04 To: ltp...@li... Subject: mincore01 test2: use negative value for "length" with unsigned = type =20 In ltp-20041007, 32-bit(x86) binary mincore01 fails on 64-bit = platform(ia64, x86-64...). Here is the cause: The prototype of mincore is: int mincore(void *start, size_t length, unsigned char *vec); Please note the data type for length: size_t, i.e. unsigned type = (unsigned int on x86, unsigned long on ia64/x86-64). But test2 uses a negative value for length and expect EINVAL. This = doesn't conform to the prototype. For a native program, when a negative little value used (like mincore01 = test2), the overflow will happen and return EINVAL. If a negative big value used, it won't return EINVAL. For a 32-bit binary running on 64-bit platform, the argument is = zero-extended to be a positive little value, so this case will fail. I know the case follows man page, but I think man page is not correct = here. We need to conform to the prototype and I suggest to remove test2. = Any comments? Thanks, Gordon=20 |