Skip to content

Commit

Permalink
fix ecdh psi coredump
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Dec 10, 2024
1 parent 7d2ae78 commit 0da6e61
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 15 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/cpp_full_node_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,23 @@ jobs:
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-dbg
echo "Disk usage after delete files: "`df -lh`
make -j3
- name: upgradeDepends
if: runner.os == 'macOS'
run: |
wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
tar -xf automake-1.14.1.tar.gz
cd automake-1.14.1
./configure && make -j4 && make install
cd ..
- name: Build for macOS
if: runner.os == 'macOS'
run: |
bash -x cpp/tools/install_depends.sh -o macos
brew install libiconv m4
export PATH="/usr/local/opt/libiconv/bin:$PATH"
export DYLD_LIBRARY_PATH=/usr/local/opt/libiconv/lib:${DYLD_LIBRARY_PATH}
mkdir -p cpp/build && cd cpp/build
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
make -j3
- name: Publish Error
if: always()
Expand Down Expand Up @@ -125,9 +136,14 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: build-x64-osx-dbg-err.log
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
- name: Publish Error macos
if: always()
uses: actions/upload-artifact@v4
with:
name: autoconf-x64-osx-err.log
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/autoconf-x64-osx-err.log


build_centos:
name: build_centos full node
runs-on: ubuntu-latest
Expand Down Expand Up @@ -200,6 +216,13 @@ jobs:
df /tmp
du /tmp | sort -n
ls -lh /tmp
- name: upgradeDepends
run: |
wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
tar -xf automake-1.14.1.tar.gz
cd automake-1.14.1
./configure && make -j4 && make install
cd ..
- name: DependenciesBuild
run: |
bash -x cpp/tools/install_depends.sh -o centos
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
GW_DOCKER_TAG="fiscoorg/wedpr-gateway-service:${GW_DOCKER_TAG}"
echo "* Begin to build wedpr-gateway-service docker: ${GW_DOCKER_TAG}"
cd docker-files/cpp/
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-gateway-service -t ${GW_DOCKER_TAG} .
docker build --no-cache --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-gateway-service -t ${GW_DOCKER_TAG} .
echo "* Build wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
docker push ${GW_DOCKER_TAG}
echo "* Push wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
Expand Down
1 change: 0 additions & 1 deletion cpp/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
{
"name": "libxml2",
"version>=": "2.11.5#1",
"default-features": false,
"features": ["lzma", "zlib"]
},
"tarscpp",
Expand Down
16 changes: 12 additions & 4 deletions cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,23 @@ bool CalculatorCache::tryToFinalize()
{
continue;
}
auto data = getPlainDataByIndex(it.second.plainDataIndex);
if (it.second.plainDataIndex > 0)
{
m_intersectionResult.emplace_back(getPlainDataByIndex(it.second.plainDataIndex));
m_intersectionResult.emplace_back(data);
}
// means the header field, swap with the first element
if (it.second.plainDataIndex == 0)
{
m_intersectionResult.emplace_back(m_intersectionResult[0]);
m_intersectionResult[0] = getPlainDataByIndex(it.second.plainDataIndex);
// means the header field, swap with the first element
if (m_intersectionResult.size() > 0)
{
m_intersectionResult.emplace_back(m_intersectionResult[0]);
m_intersectionResult[0] = data;
}
else
{
m_intersectionResult.emplace_back(data);
}
}
}
m_cacheState = CacheState::Finalized;
Expand Down
27 changes: 21 additions & 6 deletions docker-files/cpp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fiscoorg/wedpr-component-vcpkg-cache:v3.0.0 as builder
FROM ubuntu:22.04 as builder

LABEL [email protected]

Expand All @@ -8,16 +8,31 @@ ARG SOURCE_BRANCH
ENV DEBIAN_FRONTEND=noninteractive \
SOURCE=${SOURCE_BRANCH:-main}

# free the diskspace
RUN rm -rf /vcpkg/buildtrees/*/*dbg && rm -rf /vcpkg/buildtrees/*/*src
# Note: depends on python3; default jdk for jni
RUN apt-get -q update && apt-get install -qy --no-install-recommends \
vim curl lcov git make nasm build-essential cmake wget libtool ca-certificates python3.11 python3-dev \
libgmp-dev flex bison patch libzstd-dev unzip ninja-build pkg-config zip tar ccache uuid-runtime automake autoconf \
m4 tcpdump net-tools gcc g++ default-jdk \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get install -qy --no-install-recommends tzdata \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/*

# install rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

ENV PATH="/root/.cargo/bin:${PATH}"

ENV VCPKG_FORCE_SYSTEM_BINARIES=1

RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component --recursive --depth=1 -b ${SOURCE}

RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component --recursive --depth=1 -b ${SOURCE} \
# ln the cached vcpkg and compile
RUN cd WeDPR-Component/cpp && rm -rf vcpkg && ln -s /vcpkg \
RUN cd WeDPR-Component/cpp \
&& mkdir -p build && cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON \
&& make -j8

FROM ubuntu:22.04 as wedpr-gateway-service
LABEL [email protected]

Expand Down

0 comments on commit 0da6e61

Please sign in to comment.