Quote:
Originally Posted by
vgersh99
Are there any other ip ranges with the 128.x.x.x addresses that don't dump cores?
vgersh99 I did some more testing with the awk script that segmentation faults. I've tested numerous IP ranges and anything that starts with 128 or higher awk will fault. The results are very strange. Anything that less than 128 such as 127.x.x.x will not fault. 128.x.x.x and greater such as 129.x.x.x, 221.x.x.x, 222.x.x.x, etc with produce a segmentation fault.
I messed around with the other parts of the IP address ranges and
these work fine:
127.128.128.0 - 127.128.128.255
124.11.58.0 - 127.11.58.7
These
do not work and segmentation faults (IP starting 128 or higher)
129.128.128.0 - 129.128.128.255
Although the first IP starts with 124 the second IP in the range starts with 128 and seg faults:
124.11.58.0 - 128.11.58.7
EDIT: Reason for segmentation fault solved
Okay I found this information reference
OpenBSD awk vs gawk. It states "Gawk uses 53-bit unsigned integers, but OpenBSD awk uses 32-bit signed integers." This applies to the bitwise operations.
If I convert
128.0.0.0 to decimal the result is 2,147,483,648 which exceeds the maximum 32-bit signed integer value for variables 2,147,483,647 declared as integers. So it's clear now why the script that uses the native
lshift, rshift, or bitwise operations is causing an awk segmentation fault with IP's greater than
128.0.0.0 and the script that uses the custom
bit_lshift, bit_rshift, bit_or bitwise operations doesn't.
End of a long story =(