[docker-sonic-vs] Restore ASAN VS image as a healthy sonic-swss vstest base (libasan8, supervisor contract, VS orchagent shims)#28108
Merged
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
securely1g
force-pushed
the
fix/vs-syncd-libasan8
branch
from
June 27, 2026 18:32
d6b1820 to
fde71a9
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
lguohan
reviewed
Jun 27, 2026
securely1g
added a commit
to securely1g/sonic-buildimage
that referenced
this pull request
Jun 27, 2026
buffermgrd.sh is now copied from docker-orchagent via the shared build-context include (COPY --from=orchagent). The local copy in docker-sonic-vs was stale (diverged from orchagent's version, missing peripheral_table.json handling) and is no longer used, so remove it. Addresses review feedback on PR sonic-net#28108. Signed-off-by: securely1g <securely1g@users.noreply.github.com>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
lguohan
reviewed
Jun 27, 2026
lguohan
reviewed
Jun 28, 2026
Collaborator
|
merge last two commits. |
securely1g
force-pushed
the
fix/vs-syncd-libasan8
branch
from
June 28, 2026 03:02
aeb134d to
4d4b836
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
Contributor
Author
|
Squashed the last two commits (ASIC_VENDOR env + buffermgrd.sh removal) into a single commit |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw retry |
lguohan
previously approved these changes
Jun 28, 2026
Collaborator
|
Retrying failed(or canceled) jobs... |
Collaborator
|
No failed(or canceled) stages or jobs found in the most recent build 1150942. |
Collaborator
|
/azpw retry |
Collaborator
|
Retrying failed(or canceled) jobs... |
securely1g
force-pushed
the
fix/vs-syncd-libasan8
branch
from
July 1, 2026 07:15
9c5f938 to
f5b6d4d
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
securely1g
force-pushed
the
fix/vs-syncd-libasan8
branch
from
July 1, 2026 07:25
f5b6d4d to
6e915a6
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
securely1g
force-pushed
the
fix/vs-syncd-libasan8
branch
from
July 1, 2026 07:39
6e915a6 to
c4de16f
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
lguohan
previously approved these changes
Jul 1, 2026
theasianpianist
previously approved these changes
Jul 1, 2026
orchagent.sh VS-only platform overrides so sonic-swss vstests select the right ASIC path on the virtual switch; all no-ops on real hardware. Guard all of these shims on ASIC_VENDOR=vs, which is set once via the docker-sonic-vs image ENV. That is a stable "this is the Virtual Switch" identity even when .asic_type from swss_vars is empty (e.g. voq linecard roles), and it is never set on real hardware, so none of the overrides below can fire off-VS. Inside that block, platform is pinned to vs first (restoring the legacy orchagent.sh fallback for the empty-asic_type voq role) and may then be reassigned per test: 1. HWSKU=Mellanox-SN2700 -> platform=mellanox: the swss mirror_ipv6_separate vstest pins HWSKU=Mellanox-SN2700 and expects the Mellanox split-table mirror layout (separate v4 MIRROR + v6 MIRRORV6 tables), which aclorch selects from platform=mellanox. 2. broadcom-dnx / PFC_DLR VS env shims: honor DVS_ENV ASIC_TYPE=broadcom-dnx (export platform=broadcom, sub_platform=broadcom-dnx) and PFC_DLR_INIT_ENABLE (export pfcDlrInitEnable) so orchagent selects the broadcom-dnx shared-egress-ACL path and PfcWdAclHandler on the VS switch (tests/test_pfcwd_shared_egress_acl_table.py). Because the single guard keys off ASIC_VENDOR (not the mutated platform), the SN2700/broadcom-dnx reassignments cannot leak the shims onto non-VS platforms even if the triggering HWSKU/env vars happen to be present. Signed-off-by: securely1g <securely1g@users.noreply.github.com>
Add a gearsyncd_dependent_startup guard (default true) in docker-orchagent/supervisord.conf.common.j2 wrapping only gearsyncd's dependent_startup lines, and set it false in platform/vs/docker-sonic-vs/supervisord.conf.j2 before the swss include, so the VS image does not auto-start gearsyncd via the dependent-startup plugin. On non-gearbox HWSKUs gearsyncd SIGABRTs with no gearbox_config, and the resulting core dump trips the chassis crash gate. Non-VS dockers keep the default (true), so their gearsyncd startup behavior is unchanged. Signed-off-by: securely1g <securely1g@users.noreply.github.com>
The VS syncd deb (syncd-vs) and libsairedis (and its derived SAI libs: libsaivs, libsaimetadata, ...) are cache-keyed via *_DEP_FLAGS without $(ENABLE_ASAN). ENABLE_ASAN is not part of SONIC_COMMON_FLAGS_LIST, so toggling it does not change the GIT_CONTENT_SHA cache key for these packages and does not invalidate their rcache entries. As a result, a syncd-vs/libsairedis deb built once with ENABLE_ASAN=y is restored from cache into a later ENABLE_ASAN=n build. The shipped docker-sonic-vs then contains an ASAN-instrumented syncd (NEEDED libasan.so.8, __asan_* symbols) while the rootfs is a non-ASAN image that does not ship libasan.so.8, so syncd fails to start: /usr/bin/syncd: error while loading shared libraries: libasan.so.8: cannot open shared object file: No such file or directory Observed on official build 1153324 (ENABLE_ASAN=n banner, yet [ cached ] libsairedis and an ASAN-linked syncd-vs deb). Fix: append $(ENABLE_ASAN) to the cache-key DEP_FLAGS of syncd-vs and libsairedis, mirroring rules/syncd.dep. Setting it on the LIBSAIREDIS parent covers its derived packages (libsaivs, libsaimetadata, dbgsym) which share the same source build. Signed-off-by: securely1g <securely1g@users.noreply.github.com>
The PR pipeline (azure-pipelines.yml, BuildVS stage) invokes azure-pipelines-build.yml with an inline jobGroups entry for 'vs' that carried no variables, so asan_image kept the top-level default 'no' and the ENABLE_ASAN=y branch in the 'Build sonic image' step was skipped. The nightly VS pipeline (official-build.yml) passes no jobGroups and therefore falls through to the template's default jobGroups block, where the vs group sets asan_image: yes -- which is why nightly produces target/docker-sonic-vs-asan.gz but PR builds did not. Set asan_image: yes on the vs jobGroup so PR VS builds also produce docker-sonic-vs-asan.gz (published via the existing 'mv target/*' step). Signed-off-by: securely1g <securely1g@users.noreply.github.com>
securely1g
force-pushed
the
fix/vs-syncd-libasan8
branch
from
July 1, 2026 18:53
d003f07 to
52d6953
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
lguohan
approved these changes
Jul 1, 2026
This was referenced Jul 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
This PR restores
docker-sonic-vsas a healthy base image for the sonic-swss DVS (vstest) suite. It fixes the ASAN-linkedsyncdruntime regression and a set of related VS composition/startup/config issues that surfaced once the VS image was rebuilt from the current master sources. Grouped by area:1. ASAN
syncdruntime is missing (libasan.so.8)The VS container (
docker-sonic-vs) base is Debian bookworm (gcc-12), whose AddressSanitizer runtime is provided bylibasan8(libasan.so.8).platform/vs/docker-sonic-vs/Dockerfile.j2installedlibasan6(gcc-10 / buster–bullseye era), which does not exist in bookworm repos, so theapt-get installsilently failed to provide the ASAN runtime.This was latent until the VS
syncdbecame ASAN-linked. WithENABLE_ASAN=y, thesyncdbinary requireslibasan.so.8at runtime. Because onlylibasan6was requested, the image shipped nolibasan.so.8:syncdexits 127 and supervisord drives it to FATAL after retries. Withsyncddown there is noASIC_DB, which breaks the entiresonic-swssDVS (vstest) suite that runs againstdocker-sonic-vs. (This is the regression that forced sonic-swss to pin its vstest base image; see sonic-net/sonic-swss commit8259676a.)Every other bookworm container in this repo already pins
libasan8==12.2.0-14+deb12u1(e.g.platform/vs/docker-syncd-vs/buildinfo/versions/versions-deb); only this hand-written literal was stale.2. ASAN image not actually produced / cache-poisoned as ASAN
azure-pipelines.yml, BuildVS stage) invoked the build template with an inlinevsjobGroup that carried no variables, soasan_imagekept the top-level defaultnoand theENABLE_ASAN=ybranch was skipped. Nightly (official-build.yml) falls through to the template default wherevssetsasan_image: yes, which is why only nightly produceddocker-sonic-vs-asan.gz. Now the PRvsjobGroup setsasan_image: yestoo.syncd-vs/libsairedis(and derivedlibsaivs/libsaimetadata/dbgsym) are cache-keyed via*_DEP_FLAGSwithout$(ENABLE_ASAN), andENABLE_ASANis not inSONIC_COMMON_FLAGS_LIST, so toggling it did not invalidate their rcache entries. An ASAN-builtsyncd-vsdeb could then be restored into a non-ASAN build, shipping an ASAN-linkedsyncdon a rootfs with nolibasan.so.8. Fixed by appending$(ENABLE_ASAN)to the cache-key DEP_FLAGS ofsyncd-vsandlibsairedis, mirroringrules/syncd.dep.3. VS supervisor / startup contract for vstest
start.shcontract: the sonic-swss vstest harness (tests/conftest.py) requires supervisor programstart.shto reachEXITED. The recomposed VS image used[program:start]; this restores thestart.shsupervisor contract and updates dependent-startup waits tostart.sh:exited.dependent_startup_wait_for=rsyslogd:running, which is too weak for the composed VS image — it could start before ConfigDB PORT data was loaded (seen as DPU port-init instability / HOSTIF readiness failures in DPU-2P/DASH vstests). Parameterized the shared SWSS template (portsyncd_dependent_startup_wait_for, defaultrsyslogd:running) and overrode it tosyncd:runningonly in the VS image.gearbox_config, and the core dump trips the chassis crash gate. Added agearsyncd_dependent_startupguard (default true) in the shared template and set it false only for the VS image, so VS does not auto-start gearsyncd. Non-VS dockers are unchanged.4. VS
ASIC_VENDOR/ orchagent path selection for vstestASIC_VENDOR=vs: set once via image ENV so every daemon (buffermgrd,orchagent/neighorch) and anysupervisorctl restartsees it under the DVS/vstest harness (which startsdocker-sonic-vsdirectly, not viadocker_image_ctl.sh). Also dropped the localbuffermgrd.sh, now provided by docker-orchagent via the shared build-context include (the local copy had diverged and was missingperipheral_table.jsonhandling).orchagent.shunconditionally appended-q tcp://127.0.0.1for non-SmartSwitch platforms (from [Orchagent] Enable ZMQ on orchagent route table. #23028), routing DASH orchs to ZMQ instead of redisDPU_APPL_DB(db 15). The swss DASH DVS tests feed config via ProducerStateTable into db 15, so those writes were never ingested (SAI_OBJECT_TYPE_VIP_ENTRYnever created). Skip-qwhenasic_type==vs; real SmartSwitch/DPU hardware still enables ZMQ.voqempty-asic_type→platform=vsfallback so VS-only checks fire; (b)HWSKU=Mellanox-SN2700 → platform=mellanoxfor themirror_ipv6_separatevstest (separate v4 MIRROR + v6 MIRRORV6 tables); (c) honorDVS_ENVASIC_TYPE=broadcom-dnxandPFC_DLR_INIT_ENABLEso orchagent selects the broadcom-dnx shared-egress-ACL path andPfcWdAclHandler. Shims (b)/(c) are guarded byif [ "$platform" == "vs" ].How I did it
platform/vs/docker-sonic-vs/Dockerfile.j2:libasan6→libasan8(gated onENABLE_ASAN == "y"); setASIC_VENDOR=vsvia ENV.platform/vs/docker-sonic-vs/supervisord.conf.j2: restorestart.shprogram/contract; overrideportsyncd_dependent_startup_wait_for=syncd:running; setgearsyncd_dependent_startup=false.dockers/docker-orchagent/supervisord.conf.common.j2: parameterizeportsyncd_dependent_startup_wait_forand addgearsyncd_dependent_startupguard (defaults keep standalone docker-orchagent unchanged).orchagent.sh: skip northbound DASH-qonasic_type==vs; add VS-only voq/Mellanox/broadcom-dnx/PFC_DLR platform shims.platform/vs/docker-sonic-vs/buffermgrd.sh(provided by docker-orchagent include).$(ENABLE_ASAN)tosyncd-vs/libsairediscache-key DEP_FLAGS; setasan_image: yeson the PRvsjobGroup inazure-pipelines.yml.How to verify it
ASAN
syncdruntime, on the affected masterdocker-sonic-vsASAN image:ldd /usr/bin/syncd→libasan.so.8 => not found;supervisorctl status syncd→FATAL (exit 127); whole vstest suite aborts (no ASIC_DB).lddresolves,supervisorctl start syncd→ RUNNING and stays up,ASIC_DBinitializes.libasan8andsyncdis RUNNING there.Local DVS validation (2026-06-26), Ubuntu 22.04 runner container with docker.sock,
/lib/modules, and/var/run/redis-vsmounted, hostteammodule loaded:Focused DVS smoke against the combined runtime delta:
DASH DVS, on a 1152313-based image with libasan8 present: with the ZMQ change
dash/test_dash_acl.pygoes from 1 passed / 12 ERROR to 13 passed; the running DUT shows orchagent started without-qand ASICVIP_ENTRY=1.The from-source local image build is still blocked in the dirty csonic2 workspace by an unrelated scapy/python-wheel versions-lock issue (
Invalid requirement: =). To avoid conflating that with this fix, the runtime deltas were validated by constructing images from the broken official image and applying only the package/template deltas above.Once a fixed ASAN image build is available, sonic-swss can revert its vstest pin (
runId: 1141167) back tolatestFromBranch.Description for the changelog
[docker-sonic-vs] Restore the ASAN VS image as a healthy sonic-swss vstest base: install
libasan8(bookworm) so the ASAN-linkedsyncdhas its runtime and stops FATAL-ing (exit 127); includeENABLE_ASANinsyncd-vs/sairediscache keys and enable the ASAN VS image in the PR pipeline; preserve thestart.shsupervisor contract; orderportsyncdaftersyncdand gategearsyncdoff for VS; setASIC_VENDOR=vs; and add VS-onlyorchagent.shshims (DASH-on-redis, voq/Mellanox/broadcom-dnx/PFC_DLR) for the DVS suite. All shared-template and orchagent changes are no-ops on real hardware / standalone docker-orchagent.