Fix Coverity build failure: libmessage_filter_hooks.so built with empty source list causes objcopy failure

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 7.0.39
    • Affects Version/s: None
    • Component/s: None
    • None
    • R&D Security
    • ALL
    • v7.0
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      The nightly Coverity scan for v7.0-staging fails when building libmessage_filter_hooks.so.

      Root Cause

      The SERVER-127419 commit introduced libmessage_filter_hooks.so with source=[] (no source files) for enterprise Linux builds. On enterprise Linux, the real hook implementations live in libmessage_filter_hooks_enterprise.so; the transport-level wrapper was intentionally left source-less to avoid duplicate symbol definitions.

      When Coverity's cov-build intercepts a pure link command with no compiled object files, it produces a non-ELF stub file rather than running the real linker. The subsequent SCons debug post-processing step fails because the Coverity stub is not a valid ELF:

      {{
      objcopy: libmessage_filter_hooks.so: can't dump section '.debug_str' - it does not exist: file format not recognized\n}}\n\nThis causes the SCons target to fail with Error 1, aborting the Coverity build.\n\n## Fix\n\nAdded src/mongo/transport/message_filter_hooks_enterprise_shim.cpp — a minimal placeholder file with no function definitions — and updated src/mongo/transport/SConscript to use it as the enterprise Linux source instead of source=[].\n\nThis ensures Coverity always sees a real compilation command and produces a valid ELF with proper debug sections, without shadowing the enterprise implementations in libmessage_filter_hooks_enterprise.so.\n\n## Affected Versions\n\nv7.0-staging (after SERVER-127419 backport commit 7c402cfdc96)

            Assignee:
            Jason Hills
            Reporter:
            Jason Hills
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: