You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to encode entry with string fields binary gets segmentation fault.
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(mfast0)
FIND_PACKAGE(mFAST REQUIRED COMPONENTS
coder ## needed only for FAST encoder/decoder
)
INCLUDE_DIRECTORIES(${MFAST_INCLUDE_DIR})
LINK_DIRECTORIES(${MFAST_LIBRARY_DIRS})
FASTTYPEGEN_TARGET(model test.xml)
set (CMAKE_CXX_STANDARD 20)
add_executable (mfast0 ${FASTTYPEGEN_model_OUTPUTS} mfast0.cpp)
target_link_libraries (mfast0 ${MFAST_LIBRARIES} )
docker-compose.yml
version: '3.4'services:
compiler:
image: compilerbuild:
context: .command: sh
Dockerfile
FROM madduci/docker-linux-cpp
RUN apt update
RUN apt upgrade -y
RUN apt install -y cmake curl git
RUN cd / && curl -L https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz | tar zx
# BOOOST.BOOTSTRAP!!!# Y U CANNO SPECIFY VERSION FOR CLANG++ ???!!!RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 90 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-12
RUN cd /boost_1_72_0 && ./bootstrap.sh -with-toolset=clang \
&& ./b2 && ./b2 install
RUN git clone --recursive https://github.com/objectcomputing/mFAST.git /mFAST && sleep 0
RUN mkdir /mFAST/build
RUN cd /mFAST/build \
&& cmake -DBOOST_ROOT=/boost_1_72_0 \
-DBoost_INCLUDE_DIR=/boost_1_72_0 \
-DCMAKE_C_COMPILER=/usr/bin/clang-12 \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 \
-DBUILD_SHARED_LIBS=ON \
.. \
&& make
RUN cd /mFAST/build && make install
RUN apt install -y gdb
ADD mfast0.cpp test.xml CMakeLists.txt /app/
WORKDIR /app
RUN mkdir build && cd build && cmake ..
RUN cd build && make && mv mfast0 ..
ENTRYPOINT []
docker-compose build compiler
docker-compose run --rm compiler bash
When I try ./mfast0 in container I get
Segmentation fault (core dumped)
With gdb ./mfast0 I can see SIGSEGV after run
bt is
#0 0x00007ffd14b990b0 in ?? ()
#1 0x0000000000408f08 in mfast::vector_mref_base<char>::reserve (this=0x7ffd14b987c0, n=3) at /mFAST/src/mfast/coder/encoder/../../vector_ref.h:441
#2 0x0000000000408dca in mfast::vector_mref_base<char>::assign<char const*> (this=0x7ffd14b987c0, first=0x13440a0 "bar", last=0x13440a3 "") at /mFAST/src/mfast/coder/encoder/../../vector_ref.h:326
#3 0x0000000000408d45 in mfast::vector_mref_base<char>::assign<char const*> (this=0x7ffd14b987c0, first=0x13440a0 "bar", last=0x13440a3 "") at /mFAST/src/mfast/coder/encoder/../../vector_ref.h:262
#4 0x00000000004250aa in mfast::string_mref_base<char>::as (this=0x7ffd14b987c0, s=...) at /mFAST/src/mfast/coder/encoder/../../string_ref.h:159
#5 0x0000000000424d06 in mfast::fast_ostream::save_previous_value<mfast::string_cref<char> > (this=0x1343000, cref=...) at /mFAST/src/mfast/coder/encoder/fast_ostream.h:237
#6 0x0000000000424c16 in mfast::encoder_detail::no_operator::encode_impl<mfast::string_cref<char> > (this=0x4566b0 <mfast::encoder_detail::no_operator_instance>, cref=..., stream=...) at /mFAST/src/mfast/coder/encoder/encoder_field_operator.cpp:95
#7 0x0000000000423dbd in mfast::encoder_detail::no_operator::encode (this=0x4566b0 <mfast::encoder_detail::no_operator_instance>, cref=..., stream=..., pmap=...) at /mFAST/src/mfast/coder/encoder/encoder_field_operator.cpp:120
#8 0x000000000040ea61 in mfast::fast_encoder_impl::visit<mfast::string_cref<char> > (this=0x1342f70, cref=...) at /mFAST/src/mfast/coder/encoder/fast_encoder.cpp:83
#9 0x000000000040e929 in mfast::detail::result_holder<void>::apply_visitor<mfast::fast_encoder_impl, mfast::string_cref<char> > (this=0x7ffd14b98998, v=..., ref=...) at /mFAST/src/mfast/coder/encoder/../../field_visitor.h:36
#10 0x000000000040dc5e in mfast::detail::field_accessor_adaptor<mfast::fast_encoder_impl, void>::visit (this=0x7ffd14b98998, inst=0x13430d0, storage=0x7ffd14b990b0) at /mFAST/src/mfast/coder/encoder/../../field_visitor.h:87
#11 0x000000000042ece6 in mfast::ascii_field_instruction::accept (this=0x13430d0, visitor=..., context=0x7ffd14b990b0) at /mFAST/src/mfast/field_instructions.cpp:22
#12 0x000000000040a45c in mfast::apply_accessor<mfast::fast_encoder_impl> (accessor=..., v=...) at /mFAST/src/mfast/coder/encoder/../../field_visitor.h:297
#13 0x00000000004096a0 in mfast::fast_encoder_impl::visit (this=0x1342f70, cref=..., force_reset=false) at /mFAST/src/mfast/coder/encoder/fast_encoder.cpp:199
#14 0x00000000004098b5 in mfast::fast_encoder::encode (this=0x7ffd14b990f0, message=..., buffer=0x7ffd14b98c00 "\030ba\362\006\177", buffer_size=1024, force_reset=false) at /mFAST/src/mfast/coder/encoder/fast_encoder.cpp:224
#15 0x0000000000407366 in main () at /mFAST/src/mfast/value_storage.h:108
The text was updated successfully, but these errors were encountered:
When I try to encode entry with string fields binary gets segmentation fault.
CMakeLists.txt
docker-compose.yml
Dockerfile
test.xml
mfast0.cpp
in host:
When I try
./mfast0
in container I getWith
gdb ./mfast0
I can seeSIGSEGV
after runbt
isThe text was updated successfully, but these errors were encountered: