Project

General

Profile

Actions

Bug #6793

open

Unit tests failed to build on Solaris

Added by Martin Rehak 8 months ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Hello,

I am trying to prepare a package for suricata on current Oracle Solaris. Till now I had few issues which I was able to resolve so I have suricata built and running on x86 and on sparv9 platforms. When I get rules updated from emerging threats it just analyses and fills my fast.log with alerts as expected.

I wanted to have unit tests passing on both mentioned platforms as a baseline for pre-integration testing, but 'gmake check' fails to build with following output:

(cd /scratch/userland-gate/components/suricata/build/amd64 ; \
        /usr/bin/env  \
        /usr/gnu/bin/make \
         check)
make[1]: Entering directory '/scratch/userland-gate/components/suricata/build/amd64'
Making check in libhtp
...
Making check in rust
gmake[1]: Entering directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
\
    CARGO_HOME="/scratch/userland-gate/i386/home/.cargo" \
    CARGO_TARGET_DIR="/scratch/userland-gate/components/suricata/build/amd64/rust/target" \
    /usr/bin/cargo build --release  \
        --features "  " 
    Finished release [optimized + debuginfo] target(s) in 0.25s
if test -e ../rust/target/release/suricata.lib; then \
    gcp -a ../rust/target/release/suricata.lib \
        ../rust/target/release/libsuricata_rust.a; \
fi
if test -e ../rust/target/release/libsuricata.a; then \
    gcp -a ../rust/target/release/libsuricata.a \
        ../rust/target/release/libsuricata_rust.a; \
fi
gmake gen/rust-bindings.h
gmake[2]: Entering directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
gmake[2]: 'gen/rust-bindings.h' is up to date.
gmake[2]: Leaving directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
CARGO_HOME="/scratch/userland-gate/i386/home/.cargo"  \
    CARGO_TARGET_DIR="/scratch/userland-gate/components/suricata/build/amd64/rust/target" \
    /usr/bin/cargo test --all --release --features "  " 
   Compiling suricata v7.0.3 (/scratch/userland-gate/components/suricata/build/amd64/rust)
error: linking with `gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/usr/lib/amd64/rustlib/x86_64-pc-solaris/bin:/usr/bin::/home/mrehak/usr/bin/SunOS:/home/mrehak/usr/bin:/home/mrehak/.local/bin:/opt/onbld/bin:/opt/teamware/bin:/usr/sbin" VSLANG="1033" "gcc" "-m64" "/tmp/rustcE81VVf/symbols.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.0.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.11.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.12.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.13.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.14.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.15.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.2.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.3.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.4.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.5.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.6.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.7.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.9.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.3o1ovxi1wh2jza4u.rcgu.o" "-Wl,-z,ignore" "-L" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps" "-L" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib" "-Wl,-Bstatic" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libhex-39cf8b5364cf42da.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbase64-549b3850469b8ea3.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libtest-0088594108d6a425.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libgetopts-64775d4981add77d.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libunicode_width-57f8445e86412ecb.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_std_workspace_std-6389237b254ee400.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liblibc-d55eaed147db23a0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsha1-6e6822496c10b6e4.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liblzma_rs-336ec0cf2d9a5de6.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbendy-90afbad3a5eb78ae.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libfailure-1fc39296d52208a2.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum-d239d672c6934b41.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_rational-5218853e13af5d36.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_iter-c310695acf6c2ed5.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_complex-570b06e258c869ee.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_bigint-ca80c2fdfeb1c21f.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsha2-46cb9a82e7842d22.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libhkdf-cdf4edb8eff6268b.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libhmac-c631d811c6e0b468.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaes_gcm-3ad6afc2b9c38e9e.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libghash-cf5f86bb63d80184.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libpolyval-eb52c47f1bd6f640.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libuniversal_hash-e521422013d7c92a.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libctr-b4af0898c9b23d23.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaead-c2a75f5d0f04cfbd.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaes-6b7debe472d468a3.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcpufeatures-201eea5cdd0bf7d7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libopaque_debug-02666893334404ac.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcipher-c9f901a85e7bedb6.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libflate2-396652743ce92cd1.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libminiz_oxide-f3e37dd62fefca7d.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libadler-7b8e764e1faff175.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcrc32fast-00bbcc1b182a0196.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbrotli-4676a459bd6641df.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbrotli_decompressor-dbb35c86bdcf2391.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liballoc_stdlib-0c992bfaaedc10b4.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liballoc_no_stdlib-33bc76ac7f4434a0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libmd5-ddf25a85c01c3802.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcfg_if-36de6f95beab3be7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libdigest-182b75b2bebe06fa.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsubtle-3848acc728152901.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libblock_buffer-96170bbf979ac4f1.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcrypto_common-ec449dc18acd1f4f.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libgeneric_array-4042697e6768f8d8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libtypenum-526debf6ab24a6d0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsawp_modbus-ed3f7f90ead1b971.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_enum-fac5f910347b682c.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsawp-a4029e0879b457d8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsawp_flags-4133fdece585dead.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libregex-45fdfac86b97d2b0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaho_corasick-304063c7decc5f40.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libregex_syntax-f1eed4ba8a13d2fd.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libuuid-fb25ff75ee77436a.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libntp_parser-d8835790568d53ab.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsnmp_parser-29361034bbc91ea6.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libipsec_parser-a05d3ab584d300dc.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libx509_parser-9bc76bd90d2ba058.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libdata_encoding-8ee8c8a8e1fb6bda.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liblazy_static-e5dca1d7e3b0ade7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liboid_registry-51a08b888abad762.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libtls_parser-d0b17c95bd4248ba.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libphf-576e600cd83bcf3a.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libphf_shared-2dd331082d8ff1d3.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsiphasher-4bf82afe3ea9c74e.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libenum_primitive-9ab86f02341ed759.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_traits-9ab6ed4d795e915c.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnom_derive-18e33adaea22c5f8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libkerberos_parser-fd144182e07db8a8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libder_parser-0e374560c2b00542.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libder_parser-98df17ecbb8e1d55.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_bigint-685828623ccd24f7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_integer-5d4561288a6710fb.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libasn1_rs-dd1bde06da0931d8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libthiserror-05d85fe54ea38da9.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/librusticata_macros-a796b07296697106.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnom-eafe5fbd36dbdff4.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_traits-e3b56d5229f7609c.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libtime-25ab7864cd2e26a0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libitoa-f4211105b6598274.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libwidestring-6e0f878e96e26547.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libmemchr-6d2005ae5c00832b.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcrc-1e800284c720093b.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbyteorder-1b698e50a1244e54.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbitflags-9fa967c817c98f7b.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libstd-c2675ffd3ef69749.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libpanic_unwind-134c5b652bf21c2a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libobject-a704be805bff979c.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libmemchr-8172626ee379f52b.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libaddr2line-bce76ac9675c4dcf.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libgimli-472c05c711a649b5.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_demangle-eaa79fd006b0fec6.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libstd_detect-c2dfc4d2d7c6ae2d.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libhashbrown-01a0f48ea205b14a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libminiz_oxide-ba32891df7cb9d0a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libadler-5f7c65198b9c943a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_std_workspace_alloc-564ff9fc23fcb2d4.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libunwind-655be21158a0e2a8.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libcfg_if-1316e793f61a66fd.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/liblibc-013b442a87660a87.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/liballoc-8bca0a1964c59102.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_std_workspace_core-c017c49da4dac27d.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libcore-1c06a9a737a16920.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libcompiler_builtins-621aca4cd2d5caed.rlib" "-Wl,-Bdynamic" "-lsendfile" "-llgrp" "-lsocket" "-lposix4" "-lpthread" "-lresolv" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "-L" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib" "-o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee" "-nodefaultlibs" 
  = note: Undefinedfirst referenced
           symbol      in file
          HttpRangeAppendData                 /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.4.rcgu.o
          AppLayerProtoDetectPMRegisterPatternCSwPP /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
          AppLayerParserSetStreamDepth        /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
          AppLayerRequestProtocolTLSUpgrade   /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.11.rcgu.o
          FileFlowFlagsToFlags                /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
          AppLayerProtoDetectConfProtoDetectionEnabledDefault /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.15.rcgu.o
          AppLayerProtoDetectConfProtoDetectionEnabled /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          FlowGetSourcePort                   /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          SRepCatGetByShortname               /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.14.rcgu.o
          AppLayerParserConfParserEnabled     /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          AppLayerFrameSetLengthById          /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          StringToAppProto                    /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          AppLayerFrameAddEventById           /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.3.rcgu.o
          HttpRangeContainerOpenFile          /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
          FlowGetFlags                        /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          AppLayerParserStateIssetFlag        /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          AppLayerProtoDetectPPParseConfPorts /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
          FlowGetLastTimeAsParts              /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          ConfGetChildValueBool               /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
          ConfGet                             /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
          HTTP2MimicHttp1Request              /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.4.rcgu.o
          ConfGetNode                         /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
          AppLayerRegisterParserAlias         /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.2.rcgu.o
          AppLayerRegisterProtocolDetection   /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          AppLayerParserStateSetFlag          /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          AppLayerProtoDetectPPRegister       /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
          AppLayerProtoDetectPMRegisterPatternCS /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.15.rcgu.o
          FlowGetDestinationPort              /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
          ld: fatal: symbol referencing errors
          collect2: error: ld returned 1 exit status

error: could not compile `suricata` (lib test) due to previous error
gmake[1]: *** [Makefile:578: check] Error 101
gmake[1]: Leaving directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
gmake: *** [Makefile:493: check-recursive] Error 1

All these symbols looks like they are contained by rust/target/release/libsuricata_rust.a:

$ nm ./rust/target/release/libsuricata_rust.a | grep HttpRangeAppendData
[1013]  |                   0|                   0|NOTY |GLOB |0    |UNDEF  |HttpRangeAppendData
[2042]  |                   0|                   0|NOTY |GLOB |0    |UNDEF  |HttpRangeAppendData

I see that libsuricata_rust.a is copied by a command above and is present on the place, but is not used in the 'gcc' command. If I add ./rust/target/release/libsuricata_rust.a into the command line above and re-run the results is same.

Any advice?

Thank you,
Martin

Actions #1

Updated by Jason Ish 8 months ago

I'm going to guess you'll get the same if you cd rust; cargo test? Would isolate the problem just a little bit.

I don't know anything about linking on Solaris, but when the Rust unit tests are run, code in the C library is referenced, but not available. On Linux, Windows, Mac and few others we test like FreeBSD, this is OK as long as any execution path in a test does not depend on these functions. However, on Solaris it appears to be complaining that these references, while unused in test context, don't exist.

I'd first look at the RUST_LDADD flags in configure.ac. I'm pretty sure the Solaris flags haven't not been updated since we added Rust. In fact, as I'm looking at it right now, you could try adding:

RUST_LDADD="-ldl" 

as that will have some affect on the linking here.

Actions #2

Updated by Martin Rehak 8 months ago

Hi Jason,

thanks for quick answer.

Yes, cd rust; cargo test is enough to replicate the issue.

Regardless what I am putting into RUST_LDADD the result is still same. And I don't think it complains about missing system library, but it rather cannot find rust/target/release/libsuricata_rust.a which contains all undefined symbols. The file is on the place where it has been copied by cp above.

/scratch/userland-gate/components/suricata/build/amd64$ file rust/target/release/libsuricata_rust.a
rust/target/release/libsuricata_rust.a: current ar archive, 32-bit symbol table

But it is 32-bit though C code was built using -m64 to generate 64-bit binaries.
$ file ./src/.libs/suricata
./src/.libs/suricata:   ELF 64-bit LSB dynamic lib AMD64 Version 1, position-independent executable, dynamically linked, not stripped

Also if I browse through rust/target subdirs there are huge mix of 32 and 64 bit archives and dynamic libraries. I don't know anything about Rust and Cargo, but I would say asking ld to link 32 and 64 bit libraries together should fail.

What I don't understand at all is where all the compiled rust code ends up. I don't see anything rust related in deliverables, so the only options are that it is not delivered at all or are part of suricata binary. I thought suricata uses some rust code during runtime according to this:

https://suricata.io/2017/08/01/rust-and-suricata/

Do I need rust at all?

Could you throw more light into this, please?

Thank you,
m.

Actions #3

Updated by Jason Ish 8 months ago

So by seeing it fail in `cargo test`, you can forget about all the C stuff, this is pure Rust and where you should focus.

`cargo test` does not build any C. What you would be looking for is Rust (or more likely llvm) options that allow code to reference symbols that don't exist when they are not used.

But yes, Rust is required.

Unfortunately, Solaris isn't in our support matrix at all (https://docs.suricata.io/en/latest/support-status.html), and its only in Rust's tier 2 support so its possible that we're trigging something that is broken, or doing something that simply won't work on Solaris.

Actions #4

Updated by Victor Julien 8 months ago

  • Target version changed from 7.0.3 to TBD
  • Affected Versions 7.0.3 added
Actions

Also available in: Atom PDF