Skip to content

Commit 7ecb18a

Browse files
committed
fix ecdh psi coredump
1 parent 7d2ae78 commit 7ecb18a

File tree

5 files changed

+52
-15
lines changed

5 files changed

+52
-15
lines changed

.github/workflows/cpp_full_node_workflow.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ jobs:
8686
if: runner.os == 'macOS'
8787
run: |
8888
bash -x cpp/tools/install_depends.sh -o macos
89+
brew install libiconv m4 automake autoconf libtool
90+
echo "## m4:"`which m4`
91+
export DYLD_LIBRARY_PATH=/usr/local/opt/libiconv/lib:${DYLD_LIBRARY_PATH}
8992
mkdir -p cpp/build && cd cpp/build
90-
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 ../
93+
cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
9194
make -j3
9295
- name: Publish Error
9396
if: always()
@@ -125,9 +128,14 @@ jobs:
125128
uses: actions/upload-artifact@v4
126129
with:
127130
name: build-x64-osx-dbg-err.log
128-
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
131+
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
132+
- name: Publish Error macos
133+
if: always()
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: autoconf-x64-osx-err.log
137+
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/autoconf-x64-osx-err.log
129138

130-
131139
build_centos:
132140
name: build_centos full node
133141
runs-on: ubuntu-latest
@@ -200,6 +208,13 @@ jobs:
200208
df /tmp
201209
du /tmp | sort -n
202210
ls -lh /tmp
211+
- name: upgradeDepends
212+
run: |
213+
wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
214+
tar -xf automake-1.14.1.tar.gz
215+
cd automake-1.14.1
216+
./configure && make -j4 && make install
217+
cd ..
203218
- name: DependenciesBuild
204219
run: |
205220
bash -x cpp/tools/install_depends.sh -o centos

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
GW_DOCKER_TAG="fiscoorg/wedpr-gateway-service:${GW_DOCKER_TAG}"
7070
echo "* Begin to build wedpr-gateway-service docker: ${GW_DOCKER_TAG}"
7171
cd docker-files/cpp/
72-
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-gateway-service -t ${GW_DOCKER_TAG} .
72+
docker build --no-cache --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-gateway-service -t ${GW_DOCKER_TAG} .
7373
echo "* Build wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
7474
docker push ${GW_DOCKER_TAG}
7575
echo "* Push wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"

cpp/vcpkg.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
{
128128
"name": "libxml2",
129129
"version>=": "2.11.5#1",
130-
"default-features": false,
131130
"features": ["lzma", "zlib"]
132131
},
133132
"tarscpp",

cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiCache.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,23 @@ bool CalculatorCache::tryToFinalize()
328328
{
329329
continue;
330330
}
331+
auto data = getPlainDataByIndex(it.second.plainDataIndex);
331332
if (it.second.plainDataIndex > 0)
332333
{
333-
m_intersectionResult.emplace_back(getPlainDataByIndex(it.second.plainDataIndex));
334+
m_intersectionResult.emplace_back(data);
334335
}
335-
// means the header field, swap with the first element
336336
if (it.second.plainDataIndex == 0)
337337
{
338-
m_intersectionResult.emplace_back(m_intersectionResult[0]);
339-
m_intersectionResult[0] = getPlainDataByIndex(it.second.plainDataIndex);
338+
// means the header field, swap with the first element
339+
if (m_intersectionResult.size() > 0)
340+
{
341+
m_intersectionResult.emplace_back(m_intersectionResult[0]);
342+
m_intersectionResult[0] = data;
343+
}
344+
else
345+
{
346+
m_intersectionResult.emplace_back(data);
347+
}
340348
}
341349
}
342350
m_cacheState = CacheState::Finalized;

docker-files/cpp/Dockerfile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM fiscoorg/wedpr-component-vcpkg-cache:v3.0.0 as builder
1+
FROM ubuntu:22.04 as builder
22

33
44

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

11-
# free the diskspace
12-
RUN rm -rf /vcpkg/buildtrees/*/*dbg && rm -rf /vcpkg/buildtrees/*/*src
11+
# Note: depends on python3; default jdk for jni
12+
RUN apt-get -q update && apt-get install -qy --no-install-recommends \
13+
vim curl lcov git make nasm build-essential cmake wget libtool ca-certificates python3.11 python3-dev \
14+
libgmp-dev flex bison patch libzstd-dev unzip ninja-build pkg-config zip tar ccache uuid-runtime automake autoconf \
15+
m4 tcpdump net-tools gcc g++ default-jdk \
16+
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
17+
&& apt-get install -qy --no-install-recommends tzdata \
18+
&& dpkg-reconfigure --frontend noninteractive tzdata \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# install rust
22+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
23+
24+
ENV PATH="/root/.cargo/bin:${PATH}"
25+
26+
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
27+
28+
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component --recursive --depth=1 -b ${SOURCE}
1329

14-
RUN git clone https://github.com/WeBankBlockchain/WeDPR-Component --recursive --depth=1 -b ${SOURCE} \
1530
# ln the cached vcpkg and compile
16-
RUN cd WeDPR-Component/cpp && rm -rf vcpkg && ln -s /vcpkg \
31+
RUN cd WeDPR-Component/cpp \
1732
&& mkdir -p build && cd build \
1833
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON \
1934
&& make -j8
20-
35+
2136
FROM ubuntu:22.04 as wedpr-gateway-service
2237
2338

0 commit comments

Comments
 (0)