# BST-TIMEOUT: 300 # NOT MEASURED ON TARGET YET. One probe run bounded at 60 s # plus ~200 shell extractions -- the shape of # 57-libxtst.test, which carries the same 300 for ~130 of # them. Replace this note with a measured elapsed the first # time the suite runs on target. # libXvMC 1.0.14 -- the client half of the XvMC extension (poky # recipes-graphics/xorg-lib). See libxvmc_%.bbappend for what the port adds and # why. BRINTOS-2491. # # --------------------------------------------------------------------------- # NOTHING HERE HAS RUN ON A TARGET YET # # Every expectation below is DERIVED FROM THE SOURCE of libXvMC 1.0.14, from # the staged xorgproto XvMC.h, and from libXext's and libX11's own source for # the guard and initialisation paths. It was written in a phase that builds at # recipe scope only and never boots an image, so no value in it is a finding: # they are PREDICTIONS, and the first on-target run is what turns them into # results. Where a red appears, read it as this file having been wrong until the # case has been checked against the source again. # # FOUR THINGS HERE ARE MEASURED RATHER THAN PREDICTED, and it is worth saying # which, because a reader who treats the whole file as guesswork will re-derive # work that is already done: # # The PACKAGING cases (section 1) and the ARCHIVE SPLIT (section 3) were read # off the built .debs at recipe scope, 2026-09-12: five packages, no ${PN}, # libXvMC.a + libXvMCW.a in -staticdev, the two headers and two .pc files in # -dev, and every symbol in section 3 confirmed present in the archive named # and absent from the other. # # S01 is the build's own answer, out of libXvMC's config.h: HAVE_SHMAT=1 on # this arm, recorded at 1.0.14 / 2026-09-12. # # GROUP A was confirmed against an ILP32 reference build (x86-32, the same # plain-struct layout rules), every value below matching. It is derived for # wasm32 and confirmed for ILP32, which is a stronger statement than the rest # of this file can make but still not a target measurement. # # Everything in V, X, E and N is derived from source and has not run. # # S02..S07 are NOT predicted at all. Whether this arm has SysV shared memory # is exactly what nobody knows yet, which is why the ticket calls XvMC its # shared-memory member. Those cases are RECORDED (as skips carrying the # number) and only their consistency with the build-time answer is scored. # # --------------------------------------------------------------------------- # libXvMC.a IS NOT WHAT XvMClib.h DECLARES, AND THAT IS THE FIRST THING TO KNOW # # XvMClib.h declares thirty-six entry points. src/XvMC.c defines ELEVEN of them # -- five public (XvMCQueryExtension, XvMCQueryVersion, XvMCGetDRInfo, # XvMCListSurfaceTypes, XvMCListSubpictureTypes) and six _xvmc_* internals. The # other thirty-one, which is the whole rendering API, are a hardware DRIVER's, # and this same recipe's SECOND library -- libXvMCW -- reaches them by dlopen(3) # at run time from a driver named in /etc/X11/XvMCConfig. # # So this image ships two archives with very different standing. libXvMC.a is a # working protocol client with no server to talk to. libXvMCW.a is a dispatcher # with nothing to dispatch to: a static-only distro produces no .so for it to # open, and there is no XvMC driver here to open in the first place. Neither is # a defect of the port; both are asserted for what they are. # # --------------------------------------------------------------------------- # THERE IS NO X SERVER HERE, AND THAT IS WHAT THE X AND E GROUPS MEASURE # # Ten of the eleven open with xvmc_find_display(dpy) and then XvMCCheckExtension # -- XextCheckExtension under another name, which calls XMissingExtension and # returns the family's documented value. 57-libx11 measures XOpenDisplay # returning NULL in four forms and this suite does not repeat that; what it adds # is the two XOpenDisplay cases the TICKET names (group N), where the question # is not whether the call refuses but whether it refuses PROMPTLY. # # The probe reaches the guard on a fabricated, zeroed Display, by supplying its # own XQueryExtension -- truthfully, since no such extension exists here. It # also supplies the Display's lock_fns, so a call that ever got past a guard # into Xlib's request path is caught at LockDisplay, printed as TRAP, and exits # 0 before it can fault. A red on libxvmc/no-trap with the X and E cases absent # is the method failing SAFELY, not the library failing. # # A LITERAL NULL Display IS NOT CALLED, and the ticket asked for it. Xlib # documents no behaviour for one, and libXvMC's first act on a cache miss ends # in XAddExtension(dpy), whose first statement loads through the pointer -- so # the honest answer is that the call faults and there is no documented result to # assert. It is recorded below as a skip carrying that reason; an `ok' there # would be a claim about a call nobody made. . "$BST_LIB" S=libxvmc # THE CANARY. brintos_local_verify.py drops a suite's FIRST BST result line # before the host parser sees it (BRINTOS-1149, our own host-side tooling), and # counts the dropped line as a pass. A case that asserts nothing stands here so # the eaten line costs nothing. bst_ok $S/canary TESTDIR=/usr/libexec/libxvmc-tests PROBE=$TESTDIR/libxvmc-probe ARCHIVE=/usr/lib/libXvMC.a WARCHIVE=/usr/lib/libXvMCW.a PCFILE=/usr/lib/pkgconfig/xvmc.pc WPCFILE=/usr/lib/pkgconfig/xvmc-wrapper.pc HDR=/usr/include/X11/extensions/XvMClib.h HDR_VLD=/usr/include/X11/extensions/vldXvMC.h # The version the recipe pins. Asserted rather than read back, so a recipe # bumped without revisiting this suite is a red here instead of a silent change # of subject -- every expectation below is derived from THIS version's source. WANT_VERSION=1.0.14 if [ ! -f "$ARCHIVE" ]; then bst_skip $S/present "libxvmc not installed on this image" exit 0 fi bst_ok $S/present # --- 1. the packaging landed where the recipe says ---------------------------- # Read through dpkg-query rather than by globbing the rootfs, so this asserts # the PACKAGE owns these paths and a file that arrived from some other recipe is # not mistaken for this port's. This is the ticket's "the .deb installs on # target with dpkg" case. # # NOTE THERE IS NO `libxvmc` RUNTIME PACKAGE TO ASSERT, and that is not an # omission. poky's recipe leaves FILES:${PN} at ${libdir}/libXvMC.so.*, and on # this static-only arm no such file is ever produced, so the main package is # never emitted. A suite that asserted it installed would red on every green # build -- the same reading as cairo's and libxtst's. check_out $S/pkg-staticdev-installed "install ok installed" \ dpkg-query -W -f='${Status}\n' libxvmc-staticdev check_out $S/pkg-dev-installed "install ok installed" \ dpkg-query -W -f='${Status}\n' libxvmc-dev check_out $S/pkg-tests-installed "install ok installed" \ dpkg-query -W -f='${Status}\n' libxvmc-tests # The deliverables. This arm ships no shared package libraries, so the archives # ARE the library and their absence is the port shipping nothing. BOTH are # asserted: libXvMCW is half of what this recipe builds, and a build that lost # it would still produce a plausible-looking libxvmc-staticdev. check $S/archive test -s "$ARCHIVE" check $S/archive-wrapper test -s "$WARCHIVE" check $S/pkgconfig test -s "$PCFILE" check $S/pkgconfig-wrapper test -s "$WPCFILE" check $S/hdr-xvmclib test -s "$HDR" check $S/hdr-vldxvmc test -s "$HDR_VLD" # --disable-shared is image-wide, so the archive is the whole library # deliverable. A .so here would mean that stopped being true -- and for THIS # package it would mean more than that, since libXvMCW's entire design is to # dlopen one. bst_lib_shape $S/lib-shape "/usr/lib/libXvMC*.so*" pcver=$(sed -n 's/^Version: *//p' "$PCFILE" 2>/dev/null | head -1) check_eq $S/pkgconfig-version "$WANT_VERSION" "$pcver" wpcver=$(sed -n 's/^Version: *//p' "$WPCFILE" 2>/dev/null | head -1) check_eq $S/pkgconfig-wrapper-version "$WANT_VERSION" "$wpcver" # THE VERSION THE TICKET ASKED FOR IS IN THREE PLACES AND ONLY TWO OF THEM AGREE, # WHICH IS UPSTREAM'S DOING AND NOT THIS PORT'S. # # 1.0.14 is the PACKAGE version: it is what xvmc.pc carries, and the two cases # above assert it. The installed headers define NO package-version macro at all # -- XvMClib.h has none, and grep confirms it below rather than leaving the # reader to take that on trust. # # What xorgproto's XvMC.h does define is XvMCVersion 1 / XvMCRevision 1, and # that is the PROTOCOL version, 1.1. It is a different number about a different # thing and it does not track the package. The probe reports it as V02/V03 and # this suite asserts it there; asserting 1.0.14 against it would be asserting a # number upstream never claimed. if grep -qE 'XVMC_MAJOR_VERSION|XVMC_VERSION|LIBXVMC_VERSION' "$HDR" 2>/dev/null; then bst_notok $S/hdr-no-package-version "XvMClib.h now defines a package-version macro; this suite asserts 1.0.14 only against xvmc.pc and should be taught to assert it here too" else bst_ok $S/hdr-no-package-version fi # xvmc.pc must name what a consumer resolves through it. On a static-only distro # a missing entry is not a warning -- it is a link that fails in the consumer, # because there is no shared object to carry the dependency. Upstream splits # them: videoproto and xextproto are public, and x11, xext and xv are private. # Both halves matter here, since every link is static. pcpub=$(sed -n 's/^Requires: *//p' "$PCFILE" 2>/dev/null | head -1) for want in videoproto xextproto; do case " $pcpub " in *" $want "*) bst_ok "$S/pkgconfig-requires-$want" ;; *) bst_notok "$S/pkgconfig-requires-$want" "xvmc.pc Requires does not name $want: '$pcpub'" ;; esac done pcpriv=$(sed -n 's/^Requires\.private: *//p' "$PCFILE" 2>/dev/null | head -1) for want in x11 xext xv; do case "$pcpriv" in *"$want"*) bst_ok "$S/pkgconfig-requires-$want" ;; *) bst_notok "$S/pkgconfig-requires-$want" "xvmc.pc Requires.private does not name $want: '$pcpriv'" ;; esac done # --- 2. the premise: there is no X server on this image ----------------------- # Stated here rather than executed, because 57-libx11 owns the executed form. # These two are free and they fix what groups X, E and N mean below: with a # display, the guard cases would be measuring something else entirely. if [ -z "${DISPLAY:-}" ]; then bst_ok $S/no-display else bst_notok $S/no-display "DISPLAY is set to '$DISPLAY' on an image with no X server"; fi if [ ! -d /tmp/.X11-unix ]; then bst_ok $S/no-x-socket-dir else bst_notok $S/no-x-socket-dir "/tmp/.X11-unix exists"; fi # --- 3. the two archives carry different halves of the API -------------------- # grep rather than nm: the image ships no binutils nm, and the names are present # as plain bytes. -a where the grep supports it -- on this arm the archive # members are LLVM IR bitcode (ThinLTO), so a grep that suppresses matches in a # file containing NULs reports nothing; GNU grep needs -a, busybox grep as # shipped does not. Probing keeps this measuring libXvMC rather than measuring # the image's grep. if echo x | grep -aq x 2>/dev/null; then _grepq="grep -aq"; else _grepq="grep -q"; fi # The eleven src/XvMC.c defines. The probe's link is the exhaustive check; this # is the part that survives the probe being absent. for sym in XvMCQueryExtension XvMCQueryVersion XvMCGetDRInfo \ XvMCListSurfaceTypes XvMCListSubpictureTypes \ _xvmc_create_context _xvmc_destroy_context \ _xvmc_create_surface _xvmc_destroy_surface \ _xvmc_create_subpicture _xvmc_destroy_subpicture; do if $_grepq "$sym" "$ARCHIVE" 2>/dev/null; then bst_ok "$S/sym-$sym" else bst_notok "$S/sym-$sym" "$sym absent from $ARCHIVE" fi done # The rendering API lives in the WRAPPER and nowhere else. Asserted in both # directions on purpose: finding XvMCCreateContext in libXvMC.a would mean this # suite's whole reading of the package is wrong, and the eleven-symbol census # the probe links against would be a floor over the wrong set. for sym in XvMCCreateContext XvMCCreateSurface XvMCRenderSurface \ XvMCPutSurface XvMCCreateBlocks XvMCCreateMacroBlocks \ XvMCQueryAttributes; do if $_grepq "$sym" "$WARCHIVE" 2>/dev/null; then bst_ok "$S/wsym-$sym" else bst_notok "$S/wsym-$sym" "$sym absent from $WARCHIVE -- the wrapper is the only place the rendering API exists in this package" fi done if $_grepq XvMCRenderSurface "$ARCHIVE" 2>/dev/null; then bst_notok $S/api-split "XvMCRenderSurface is in $ARCHIVE; upstream puts the rendering API in the wrapper only, and this suite's census floor assumes that split" else bst_ok $S/api-split fi # THE WRAPPER IS INERT ON THIS IMAGE, and that is a documented property rather # than a red. Its dispatch is dlopen(3) of a driver .so named in # /etc/X11/XvMCConfig; this distro produces no .so and ships no XvMC driver, so # there is nothing for it to open. Recorded so a later reader does not mistake # the shipped archive for a working rendering path. if [ -e /etc/X11/XvMCConfig ]; then bst_skip $S/wrapper-inert "an /etc/X11/XvMCConfig exists; the wrapper may have a driver to name on this image after all -- re-read this case" else bst_skip $S/wrapper-inert "no /etc/X11/XvMCConfig and no driver .so on a static-only image: libXvMCW ships but can dispatch to nothing. Not a defect of this port" fi # The installed header must declare what a consumer compiles against. for decl in XvMCQueryExtension XvMCQueryVersion XvMCListSurfaceTypes \ XvMCCreateContext XvMCRenderSurface XvMCCreateBlocks \ XvMCGetDRInfo XvMCSetAttribute; do if grep -q "$decl" "$HDR" 2>/dev/null; then bst_ok "$S/hdr-decl-$decl" else bst_notok "$S/hdr-decl-$decl" "$decl is not declared in $HDR" fi done # --- 4. the probe ------------------------------------------------------------- WORK=${TMPDIR:-/tmp}/bst-libxvmc.$$ # BRINTOS-WORKAROUND: brintos/linux#73 remove -- plain mkdir on a leaf, verdict taken from the filesystem rather than from $?. # `mkdir -p` calls mkdir # on every component including ones that already exist and reads the kernel's # private restart sentinel (517) where it would have read EEXIST, so it aborts # on the parent and never reaches the leaf. See 57-cairo.test for the measured # table (BRINTOS-2547). _w=0 _werr= while [ "$_w" -lt 3 ] && [ ! -d "$WORK" ]; do _werr=$(mkdir "$WORK" 2>&1) _w=$((_w + 1)) done if [ ! -d "$WORK" ]; then bst_notok $S/workdir "cannot create $WORK after 3 attempts: ${_werr:-no diagnostic} -- the probe and every case below it need it" exit 0 fi # The recipe records whether the probe linked, beside the binary, so a reader on # target can tell "not built" from "not installed" -- and it carries the # build-time HAVE_SHMAT answer, which group S needs and which is otherwise # visible only in a build log nobody on target has. LINKFILE=$TESTDIR/probe-link.txt if [ ! -f "$LINKFILE" ]; then bst_notok $S/probe-link-present "no probe-link.txt in $TESTDIR; the recipe writes one on every build" BUILT_SHMAT= elif grep -q '^LINKED libxvmc-probe$' "$LINKFILE" 2>/dev/null; then bst_ok $S/probe-link-present BUILT_SHMAT=$(sed -n 's/^HAVE_SHMAT //p' "$LINKFILE" | head -1) else bst_notok $S/probe-link-present "the recipe did not record the probe as LINKED" BUILT_SHMAT= fi # The census floor, the half a .bb cannot state. Eleven is the whole of # src/XvMC.c at 1.0.14 (see the bbappend's LIBXVMC_MIN_ENTRY_POINTS). check_eq $S/probe-link-entry-points "11" \ "$(sed -n 's/^ENTRY_POINTS //p' "$LINKFILE" 2>/dev/null | head -1)" if [ ! -x "$PROBE" ]; then bst_notok $S/probe-present "not installed at $PROBE (the bbappend installs it; check do_install and probe-link.txt)" exit 0 fi bst_ok $S/probe-present # bst_probe bounds the run and keeps whatever it printed: if the probe wedges or # dies early, the last line it managed is in the red rather than lost with the # guest's tmpfs. 60 s is generous for a run whose only syscalls are two refused # connects and four shm calls; the bound exists because a connect that BLOCKS is # one of the two answers group N is here to tell apart, and an unbounded probe # would report that as a suite timeout instead. pout=$WORK/probe.out bst_probe $S/probe-runs "$pout" 60 "$PROBE" pstat=$? if [ "$pstat" -eq 124 ]; then bst_notok $S/probe-complete "the probe did not return within its bound; every case below is unmeasured" exit 0 fi if grep -q '^PROBE-END$' "$pout" 2>/dev/null; then bst_ok $S/probe-complete else bst_notok $S/probe-complete "probe output has no PROBE-END terminator (last line: $(tail -1 "$pout" 2>/dev/null))" fi # The trap described at the top of this file. A TRAP line means the probe # stopped ITSELF rather than faulting, so this case and probe-complete going red # together, with X/E absent, is the method failing safely. if grep -q '^TRAP ' "$pout" 2>/dev/null; then bst_notok $S/no-trap "the probe trapped: $(grep -m1 '^TRAP ' "$pout")" else bst_ok $S/no-trap fi # val -- the probe's value for one case, empty when the probe stopped # first. Matches on the ID in field 1 rather than taking the line by position, # because a platform diagnostic could land in the middle of the transcript. val() { awk -v k="$1" '$1==k { $1=""; sub(/^ /,""); print; exit }' "$pout"; } # want -- score one probe value against a derived answer. # A missing value is reported as the probe having stopped early rather than as a # mismatch against '', which is a different fault and localises to a different # line. want() { _got=$(val "$1") if [ -z "$_got" ]; then bst_notok "$S/$2" "no value on target (probe stopped before $1); want='$3'" elif [ "$_got" = "$3" ]; then bst_ok "$S/$2" else bst_notok "$S/$2" "want:'$3' got:'$_got'" fi } # note -- record a measurement without asserting it. bst_ok carries # no text and bst_notok is a red, so a skip whose message is the number is the # only result line that both reaches the capture and claims nothing. note() { _got=$(val "$1") bst_skip "$S/$2" "${_got:-(probe stopped before $1)}" } # --- C: the census the probe linked against ----------------------------------- want C01 census-size 11 # --- V: the constants the archive and the staged xorgproto headers agree on --- # The protocol version pair is V02/V03 and it is 1.1 -- see the note above # hdr-no-package-version for why that is not 1.0.14. want V01 name XVideo-MotionCompensation want V02 proto-version 1 want V03 proto-revision 1 want V04 num-events 0 want V05 num-errors 3 want V06 bad-context 0 want V07 bad-surface 1 want V08 bad-subpicture 2 want V09 chroma-420 1 want V10 chroma-422 2 want V11 chroma-444 3 want V12 flag-overlaid 1 want V13 flag-backend-subpicture 2 want V14 flag-subpicture-scaling 4 want V15 flag-intra-unsigned 8 want V16 mc-mocomp 0 want V17 mc-idct 65536 want V18 mc-mpeg1 1 want V19 mc-mpeg2 2 want V20 mc-h263 3 want V21 mc-mpeg4 4 want V22 mb-motion-forward 2 want V23 mb-motion-backward 4 want V24 mb-pattern 8 want V25 mb-intra 16 want V26 pred-field 1 want V27 pred-frame 2 want V28 pred-dual-prime 3 want V29 pred-4mv 4 want V30 select-first-forward 1 want V31 select-second-backward 8 want V32 dct-frame 0 want V33 dct-field 1 want V34 top-field 1 want V35 bottom-field 2 want V36 frame-picture 3 want V37 second-field 4 want V38 direct 1 want V39 rendering 1 want V40 displaying 2 # --- A: the in-memory layout this arm hands the packages above it ------------- # ILP32 against the LP64 hosts these declarations are normally read on, which is # the whole reason to print them: XID, XvPortID and every pointer are 4 bytes # here and 8 there, so EVERY structure below has a different size on the two. # Derived from xorgproto's XvMC.h with that substitution: # # XvMCSurfaceInfo int,int,4x ushort,int,int = 24 # XvMCContext XID,int,ushort,ushort,XvPortID,int,void* = 24 # XvMCSurface XID,XID,int,ushort,ushort,void* = 20 # XvMCSubpicture XID,XID,int,ushort,ushort,int,int,char[4],void* = 32 # XvMCBlockArray uint,XID,void*,short* = 16 # XvMCMacroBlock 2x ushort,4x uchar,short[2][2][2],uint,2x ushort = 32 # XvMCMacroBlockArray uint,XID,void*,XvMCMacroBlock* = 16 # # CONFIRMED on an ILP32 reference build (x86-32), 2026-09-12: every value below # is what that compiler produced for these declarations. What is not confirmed # is that wasm32's ABI agrees with it, which is the whole question -- but a # mismatch is now a statement about wasm32 rather than about this file's # arithmetic. # # The XvMCMacroBlockArray/XvMCMacroBlock pair is the one that matters most: a # consumer strides over an array of the second through a pointer in the first, # so an offset this suite and that archive disagreed about corrupts a decode # rather than failing to build. want A01 sizeof-xid 4 want A02 sizeof-pointer 4 want A03 sizeof-xvportid 4 want A10 sizeof-surfaceinfo 24 want A11 surfaceinfo-off-surface-type-id 0 want A12 surfaceinfo-off-chroma-format 4 want A13 surfaceinfo-off-max-width 8 want A14 surfaceinfo-off-max-height 10 want A15 surfaceinfo-off-sub-max-width 12 want A16 surfaceinfo-off-sub-max-height 14 want A17 surfaceinfo-off-mc-type 16 want A18 surfaceinfo-off-flags 20 want A20 sizeof-context 24 want A21 context-off-context-id 0 want A22 context-off-surface-type-id 4 want A23 context-off-width 8 want A24 context-off-height 10 want A25 context-off-port 12 want A26 context-off-flags 16 want A27 context-off-privdata 20 want A30 sizeof-surface 20 want A31 surface-off-surface-id 0 want A32 surface-off-context-id 4 want A33 surface-off-surface-type-id 8 want A34 surface-off-width 12 want A35 surface-off-height 14 want A36 surface-off-privdata 16 want A40 sizeof-blockarray 16 want A41 blockarray-off-num-blocks 0 want A42 blockarray-off-context-id 4 want A43 blockarray-off-privdata 8 want A44 blockarray-off-blocks 12 want A50 sizeof-macroblockarray 16 want A51 macroblockarray-off-num-blocks 0 want A52 macroblockarray-off-context-id 4 want A53 macroblockarray-off-privdata 8 want A54 macroblockarray-off-macro-blocks 12 want A60 sizeof-subpicture 32 want A61 subpicture-off-subpicture-id 0 want A62 subpicture-off-xvimage-id 8 want A63 subpicture-off-num-palette-entries 16 want A64 subpicture-off-entry-bytes 20 want A65 subpicture-off-component-order 24 want A66 subpicture-off-privdata 28 want A70 sizeof-macroblock 32 want A71 macroblock-off-x 0 want A72 macroblock-off-type 4 want A73 macroblock-off-dct-type 7 want A74 macroblock-off-pmv 8 want A75 macroblock-sizeof-pmv 16 want A76 macroblock-off-index 24 want A77 macroblock-off-cbp 28 # --- N: XOpenDisplay refuses, and refuses PROMPTLY ---------------------------- # The ticket's two cases. Both must return NULL -- with no X server anywhere, # that much is 57-libx11's finding and is not in doubt. What IS in doubt on a # platform whose socket layer is new is whether the second one BLOCKS, and a # client that blocks on a connect nothing answers is what a video application # would experience as a hang. # # The elapsed values are asserted with a ceiling rather than a literal: the # right answer is "promptly", and pinning a second would make a slow but correct # run a red. errno is RECORDED and not asserted -- Xlib makes no promise about # what it leaves there, and 57-libx11 says the same. want N01 display-unset "(unset)" want N02 open-nodisplay null want N05 open-tcp-dead null note N04 open-nodisplay-errno note N07 open-tcp-dead-errno for _c in "N03 open-nodisplay-prompt 5" "N06 open-tcp-dead-prompt 10"; do set -- $_c _e=$(val "$1") if [ -z "$_e" ]; then bst_notok "$S/$2" "no value on target (probe stopped before $1)" elif [ "$_e" -le "$3" ] 2>/dev/null; then bst_ok "$S/$2" else bst_notok "$S/$2" "XOpenDisplay took ${_e}s to refuse, over the ${3}s ceiling -- it blocked rather than refusing" fi done # --- X: the guarded entry points ---------------------------------------------- # XvMCQueryExtension is the ONE that does not go through XvMCCheckExtension: it # tests XextHasExtension itself, returns False, and raises NOTHING. X02 is that # distinction and it is why an extension-error handler is installed at all -- # without it "returned 0" and "returned 0 having raised the missing-extension # error" would be one undifferentiated answer. want X01 query-extension-false 0 want X02 query-extension-raises-nothing 0 want X03 query-extension-asks-xlib-once 1 want X04 query-extension-asked-for XVideo-MotionCompensation # The False arm assigns neither out-parameter. -1 is the probe's sentinel: a 0 # here would mean the library wrote an event base it had no way to know. want X05 query-extension-eventbase-untouched -1 want X06 query-extension-errbase-untouched -1 # BadImplementation is 17 (X.h). It is the value XvMCCheckExtension is given for # every Status-returning entry point in this library, so the same literal # appears in every guard case below and in group E. want X07 query-version-badimplementation 17 want X08 query-version-raises-once 1 want X09 query-version-raised-for XVideo-MotionCompensation want X10 query-version-major-untouched -1 want X11 query-version-minor-untouched -1 # ListSurfaceTypes sets *num = 0 BEFORE the guard, so the documented empty # result is observable even though the call refused, and the NULL it returns is # safe to hand to XFree -- which is the ticket's "safe to free" case, executed # rather than argued. want X12 list-surface-types-null null want X13 list-surface-types-num-zero 0 want X14 list-surface-types-raises-once 1 want X15 list-surface-types-free-safe freed want X16 list-subpicture-types-null null want X17 list-subpicture-types-count-zero 0 want X18 list-subpicture-types-raises-once 1 want X19 list-subpicture-types-free-safe freed want X23 get-drinfo-badimplementation 17 want X24 get-drinfo-name-cleared null want X25 get-drinfo-busid-cleared null want X26 get-drinfo-raises-once 1 # Every raise carried X_EXTENSION_MISSING as its reason. A raise with some other # reason would mean the probe's handler is catching something that is not the # missing-extension path. want X22 raise-reason-missing 1 # ONE stub answer over the whole run: xvmc_find_display caches on the Display # pointer, so every call after the first is a cache hit and asks Xlib nothing. # A second answer here would mean the cache is not working and each call is # re-initialising the extension -- which on a real display would be a round trip # per call. want X30 extension-cache-holds 1 # How many times libX11's extension bookkeeping takes the display lock inside # that one initialisation is libX11's business and has changed between versions, # so it is recorded rather than asserted. The probe's trap is what BOUNDS it; # these two are for whoever reads a trap. note X20 lock-calls note X21 unlock-calls # --- E: the error paths on objects that were never created -------------------- # Each structure is zeroed and handed to the call that would populate or destroy # it. Two things must hold and only one of them is a return code: the documented # value comes back, AND the caller's memory is untouched. A library that wrote a # context_id into a context it then refused to create would leave a caller # holding an id the server has never heard of, and no status code says so. # # The three create paths also clear their two out-parameters before the guard, # which is the documented "nothing was allocated for you" -- a caller that # trusted a stale priv_data would free a pointer the library never gave it. want E01 create-context-badimplementation 17 want E01a create-context-priv-count-zero 0 want E01b create-context-priv-data-null null want E02 create-context-leaves-caller-untouched 0 want E03 destroy-context-badimplementation 17 want E04 destroy-context-leaves-caller-untouched 0 want E05 create-surface-badimplementation 17 want E05a create-surface-priv-count-zero 0 want E05b create-surface-priv-data-null null want E06 create-surface-leaves-caller-untouched 0 want E07 destroy-surface-badimplementation 17 want E08 destroy-surface-leaves-caller-untouched 0 want E09 create-subpicture-badimplementation 17 want E09a create-subpicture-priv-count-zero 0 want E09b create-subpicture-priv-data-null null want E10 create-subpicture-leaves-caller-untouched 0 want E11 destroy-subpicture-badimplementation 17 want E12 destroy-subpicture-leaves-caller-untouched 0 want E13 blockarray-zeroed 0 want E14 macroblockarray-zeroed 0 # The NULL-display case the ticket names. See the header comment: Xlib documents # no behaviour for one and libXvMC's path into XAddExtension loads through the # pointer, so there is no documented result to assert and the probe does not # make the call. Recorded so the omission is visible rather than silent. bst_skip $S/null-display "not called: Xlib documents no NULL-Display behaviour, and libXvMC's cache-miss path ends in XAddExtension(dpy) -> LockDisplay(dpy), which loads through it. There is no documented result here to assert" # --- S: SysV shared memory ---------------------------------------------------- # XvMC is its round's shared-memory member and this is that measurement. The # library's only shm call site is inside XvMCGetDRInfo, which fills a # shmget/shmat page with a pattern so the server can prove the connection is # local -- and which is behind the guard above, so it is unreachable on this # image. The probe therefore measures the two halves SEPARATELY: # # S01 what configure decided at build time. AC_CHECK_FUNCS([shmat]) is a LINK # test, so it answers "the toolchain resolves the symbol" -- on a cross # build a different question from "the syscall works on the target". # S02+ what shmget/shmat/shmdt actually do here, called directly. # # S01 IS ASSERTED because it is a build-time fact this port measured. S02..S07 # are NOT: whether this arm has SysV shared memory is exactly what nobody knows # yet, and an image that refuses a segment is a perfectly acceptable result for # a package whose shm path needs a server it does not have. # # What IS scored is the CONSISTENCY of the two, and only in the direction that # is unambiguously wrong: an archive built believing shmat works, on a runtime # where shmget refuses. That is the cross-compile autoconf trap # docs/conventions/autoconf-answer-placement.md exists for, and if it fires the # owner is the platform, not this recipe -- the remedy is a cached answer, and # the evidence for it is this case. # 1, measured at recipe scope on 2026-09-12: configure's link test resolves # shmat on this arm. Asserted as a literal so a toolchain change that flips it # is a red here rather than a silent change of what the archive contains -- and # cross-checked against probe-link.txt, which is the same fact taken from the # build rather than from the binary. want S01 shmat-built-in 1 check_eq $S/shmat-recorded-in-link-file "1" "${BUILT_SHMAT:-}" note S02 shmget-id note S03 shmget-errno note S04 shmat-address note S05 shmat-errno note S06 shm-pattern-roundtrip note S07 shmdt-rc _s01=$(val S01) _s02=$(val S02) if [ -z "$_s01" ] || [ -z "$_s02" ]; then bst_notok $S/shm-config-matches-runtime "the probe stopped before group S" elif [ "$_s01" = "0" ]; then # Built without shm. Nothing in the archive calls shmget, so there is nothing # to be inconsistent with, whatever the runtime turns out to have. bst_ok $S/shm-config-matches-runtime elif [ "$_s02" -ge 0 ] 2>/dev/null; then bst_ok $S/shm-config-matches-runtime else bst_notok $S/shm-config-matches-runtime "configure compiled the shm path in (HAVE_SHMAT=1) but shmget(IPC_PRIVATE) returns $_s02 errno $(val S03) on this arm. The link test answered a question about the toolchain, not about the target; XvMCGetDRInfo's local-connection probe cannot work here" fi rm -rf "$WORK"