# libosip2 5.3.1 (GNU mirror, sha256 fe82fe841608266ac15a5c1118216da00c554d5006e2875a8ac3752b1e6adc79) # x86_64 control, generated by src/libosip2_mknative.sh. # Values 77-libosip2.test requires wasm32-hwjs to reproduce -- EXCEPT the # LOS-CL-* block, which it requires wasm32-hwjs to CONTRADICT above 2^31. # # Configured as the target arm is: stock meta-networking defaults plus # --enable-test (the bbappend's only configure change). # --- upstream's corpus, as shipped in the tarball --- LOS-CORPUS-WELLFORMED 98 LOS-CORPUS-MALFORMED 23 LOS-CORPUS-BYTES-urls.txt 3632 LOS-CORPUS-BYTES-froms.txt 5124 LOS-CORPUS-BYTES-tos.txt 3828 LOS-CORPUS-BYTES-contacts.txt 4223 LOS-CORPUS-BYTES-vias.txt 826 LOS-CORPUS-BYTES-callids.txt 102 LOS-CORPUS-BYTES-contenttypes.txt 439 LOS-CORPUS-BYTES-recordroutes.txt 534 LOS-CORPUS-BYTES-routes.txt 515 LOS-CORPUS-BYTES-wwwas.txt 920 # --- exit status of each header parser on its own corpus --- # Recorded rather than assumed: nine of the ten return 0 unconditionally, # and pinning that here means a program that STARTS reporting failure is a # changed assertion rather than a silently stricter parser. LOS-RC-turl 0 LOS-RC-tfrom 0 LOS-RC-tto 0 LOS-RC-tcontact 0 LOS-RC-tvia 0 LOS-RC-tcallid 0 LOS-RC-tcontentt 0 LOS-RC-trecordr 0 LOS-RC-troute 0 LOS-RC-twwwa 0 # --- one line count, for the tmpfs read-path case --- # The other nine are not recorded: the ref files ARE the assertion, and a # line count beside a byte-for-byte comparison is a second, weaker copy of # the same claim that can only rot out of step with it. LOS-LINES-turl 718 # --- Content-Length: THE ARM-DEPENDENT ONE --- # # osip_message_parse() decides WHETHER A BODY EXISTS with libc atoi() # (osip_message_parse.c:909) and then decides HOW LONG IT IS with # osip_atoi() (line 719). osip_atoi is not atoi: it runs strtol and # returns OSIP_UNDEFINED_ERROR (-1) when the result lands on LONG_MIN or # LONG_MAX. Those two therefore disagree over a range whose lower bound is # LONG_MAX, i.e. it is a function of sizeof(long) alone: # # LP64 (here) Content-Length >= 2^31 truncates to <= 0 inside # atoi(), so the parser concludes there is NO BODY and # returns OSIP_SUCCESS, silently ignoring the header. # ILP32 (wasm32) strtol saturates at LONG_MAX = 2^31-1, atoi returns a # POSITIVE number, so a body is expected; osip_atoi then # reports LONG_MAX as an error, the (size_t) cast makes # it enormous, and the 'message was not received # entirely' check rejects with OSIP_SYNTAXERROR. # # Below 2^31 both arms agree. At and above it they cannot, and the wasm32 # side is the SAFER of the two -- it rejects a message this control # accepts. 77-libosip2.test asserts the agreement below and the # divergence above; the latter is the one case in the suite an x86_64 # binary packaged into the image by mistake could not satisfy. LOS-CL-2 rc=0 code=0 LOS-CL-100 rc=1 code=-5 LOS-CL-2147483646 rc=1 code=-5 LOS-CL-2147483647 rc=1 code=-5 LOS-CL-2147483648 rc=0 code=0 LOS-CL-4294967295 rc=0 code=0 LOS-CL-9223372036854775807 rc=0 code=0