1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Fix windows validator-engine.exe runtime access violation error (#387)

* Fix runtime access violation error on Windows
This commit is contained in:
neodiX42 2022-06-03 15:01:55 +02:00 committed by GitHub
parent 845cbca1e5
commit 65e3177def
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 262 additions and 54 deletions

View file

@ -1,4 +1,4 @@
name: Build Docker Ubuntu Image name: Docker Ubuntu 18.04 image
on: on:
workflow_dispatch: workflow_dispatch:
@ -12,34 +12,28 @@ env:
jobs: jobs:
build-and-push: build-and-push:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- - name: Checkout
name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- - name: Set up QEMU
name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- - name: Set up Docker Buildx
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- - name: Login to GitHub Container Registry
name: Login to GitHub Container Registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- - name: Build and push
name: Build and push
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
push: true push: true
context: ./docker context: ./docker
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

View file

@ -1,6 +1,10 @@
name: C/C++ CI macOS-10.15 Compile name: C/C++ CI macOS-10.15 Compile
on: [push,workflow_dispatch] on:
workflow_dispatch:
push:
branches:
- 'master'
jobs: jobs:
build: build:
@ -36,4 +40,4 @@ jobs:
uses: actions/upload-artifact@master uses: actions/upload-artifact@master
with: with:
name: ton-macos-binaries name: ton-macos-binaries
path: artifacts path: artifacts

View file

@ -0,0 +1,60 @@
name: macOS-10.15 tonlib-java
on:
workflow_dispatch:
push:
branches:
- 'wallets'
jobs:
build:
runs-on: macos-10.15
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Compile OpenSSL
run: |
git clone https://github.com/openssl/openssl openssl_1_1_1
cd openssl_1_1_1
git checkout OpenSSL_1_1_1-stable
./Configure --prefix=/usr/local/macos darwin64-x86_64-cc -static -mmacosx-version-min=10.15
make build_libs -j4
- name: Configure & Build
run: |
rootPath=`pwd`
export CC=$(which clang)
export CXX=$(which clang++)
export CCACHE_DISABLE=1
export JAVA_AWT_LIBRARY=NotNeeded
export JAVA_JVM_LIBRARY=NotNeeded
export JAVA_INCLUDE_PATH=${JAVA_HOME}/include
export JAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
export JAVA_INCLUDE_PATH2=${JAVA_HOME}/include/darwin
cd example/android/
mkdir build
cd build
cmake -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=$rootPath/openssl_1_1_1/include -DOPENSSL_CRYPTO_LIBRARY=$rootPath/openssl_1_1_1/libcrypto.a -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DTON_ONLY_TONLIB=ON ..
cmake --build . --target prepare_cross_compiling
cmake --build . --target native-lib --config Release
- name: find & copy binaries
run: |
mkdir -p artifacts/tonlib-java
cp example/android/src/drinkless/org/ton/TonApi.java artifacts/tonlib-java/
cp example/android/build/libnative-lib.dylib artifacts/tonlib-java/
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: tonlib-macos-java
path: artifacts

View file

@ -12,28 +12,21 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: 'recursive' submodules: 'recursive'
- name: Run Cppcheck
uses: Bedzior/run-cppcheck@master - name: Install libraries
with:
enabled checks: all
enable inconclusive: true
generate report: true
- name: Upload report
uses: actions/upload-artifact@v1
with:
name: report
path: output
- name: mkdir
run: | run: |
sudo apt update
sudo apt install -y build-essential git make cmake clang libgflags-dev zlib1g-dev libssl-dev libreadline-dev libmicrohttpd-dev pkg-config libgsl-dev python3 python3-dev ninja-build
- name: Configure & Build
run: |
export CC=$(which clang)
export CXX=$(which clang++)
export CCACHE_DISABLE=1
mkdir build mkdir build
- name: cmake all
run: |
cd build cd build
cmake -DCMAKE_BUILD_TYPE=Release .. cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
- name: make all ninja fift func tonlib tonlibjson tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork
run: |
cd build
make -j4 fift func tonlib tonlibjson tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork
- name: find & copy binaries - name: find & copy binaries
run: | run: |

View file

@ -0,0 +1,31 @@
name: Ubuntu 18.04 TON ccpcheck
on:
workflow_dispatch:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Run Cppcheck
uses: Bedzior/run-cppcheck@master
with:
enabled checks: all
enable inconclusive: true
generate report: true
- name: Upload report
uses: actions/upload-artifact@v1
with:
name: ton-ccpcheck-report
path: output

View file

@ -0,0 +1,50 @@
name: Ubuntu 18.04 tonlib-java
on:
workflow_dispatch:
push:
branches:
- 'wallets'
jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install libraries
run: |
sudo apt update
sudo apt install -y build-essential git make cmake clang libgflags-dev zlib1g-dev libssl-dev libreadline-dev libmicrohttpd-dev pkg-config libgsl-dev python3 python3-dev ninja-build
- name: Configure & Build
run: |
export JAVA_AWT_LIBRARY=NotNeeded
export JAVA_JVM_LIBRARY=NotNeeded
export JAVA_INCLUDE_PATH=${JAVA_HOME}/include
export JAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
export JAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux
cd example/android/
mkdir build
cd build
cmake -DTON_ONLY_TONLIB=ON ..
cmake --build . --target prepare_cross_compiling
cmake --build . --target native-lib
- name: find & copy binaries
run: |
mkdir -p artifacts/tonlib-java
cp example/android/src/drinkless/org/ton/TonApi.java artifacts/tonlib-java/
cp example/android/build/libnative-lib.so artifacts/tonlib-java/
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: tonlib-ubuntu-java
path: artifacts

View file

@ -1,6 +1,10 @@
name: C/C++ CI Windows Server 2019 x64 Compile name: C/C++ CI Windows Server 2019 x64 Compile
on: [push,workflow_dispatch] on:
workflow_dispatch:
push:
branches:
- 'master'
defaults: defaults:
run: run:
@ -49,8 +53,8 @@ jobs:
cmake -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%root%\zlib -DZLIB_LIBRARY=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%root%/openssl-1.1/x64/include -DOPENSSL_CRYPTO_LIBRARY=%root%/openssl-1.1/x64/lib/libcrypto.lib -DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj /W0" .. cmake -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%root%\zlib -DZLIB_LIBRARY=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%root%/openssl-1.1/x64/include -DOPENSSL_CRYPTO_LIBRARY=%root%/openssl-1.1/x64/lib/libcrypto.lib -DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj /W0" ..
- name: Build - name: Build
run: | run: |
cd build cd build
cmake --build . --target fift func tonlib tonlibjson tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork --config Release cmake --build . --target fift func tonlib tonlibjson tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork --config Release
- name: Show executables - name: Show executables
@ -69,6 +73,7 @@ jobs:
run: | run: |
mkdir artifacts mkdir artifacts
for /f %%a in ('dir *.exe /b /a /s') do copy /Y %%a artifacts for /f %%a in ('dir *.exe /b /a /s') do copy /Y %%a artifacts
copy build\tonlib\Release\tonlibjson.dll artifacts
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@master uses: actions/upload-artifact@master

View file

@ -0,0 +1,71 @@
name: Windows 2019 tonlib-java
on:
workflow_dispatch:
push:
branches:
- 'wallets'
defaults:
run:
shell: cmd
jobs:
build:
runs-on: windows-2019
steps:
- name: Get Current OS version
run: |
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
- name: Check out current repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Check out zlib repository
uses: actions/checkout@v2
with:
repository: desktop-app/zlib
path: zlib
- name: Setup msbuild.exe
uses: microsoft/setup-msbuild@v1.0.2
- name: Compile zlib Win64
run: |
cd zlib\contrib\vstudio\vc14
msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v142
- name: Install precompiled OpenSSL Win64
run: |
curl -Lo openssl-1.1.1o.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-1.1.1o.zip
jar xf openssl-1.1.1o.zip
- name: Configure & Build
run: |
set JAVA_AWT_LIBRARY=NotNeeded
set JAVA_JVM_LIBRARY=NotNeeded
set JAVA_INCLUDE_PATH=${JAVA_HOME}/include
set JAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
set JAVA_INCLUDE_PATH2=${JAVA_HOME}/include/win32
set root=%cd%
echo %root%
cd example/android
mkdir build
cd build
cmake -DZLIB_FOUND=1 -DZLIB_INCLUDE_DIR=%root%\zlib -DZLIB_LIBRARY=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib -DOPENSSL_FOUND=1 -DOPENSSL_INCLUDE_DIR=%root%/openssl-1.1/x64/include -DOPENSSL_CRYPTO_LIBRARY=%root%/openssl-1.1/x64/lib/libcrypto.lib -DTON_ONLY_TONLIB=ON -DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj /W0" ..
cmake --build . --target native-lib --config Release
- name: Find & copy binaries
run: |
mkdir tonlib-java
cp example/android/build/Release/native-lib.dll tonlib-java/
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: tonlib-win64-java
path: tonlib-java

View file

@ -865,7 +865,7 @@ bit$_ _:(## 1) = Bit;
The serialization of source and destination addresses is defined by the following TL-B scheme: The serialization of source and destination addresses is defined by the following TL-B scheme:
\begin{verbatim} \begin{verbatim}
addr_none$00 = MsgAddressExt; addr_none$00 = MsgAddressExt;
addr_extern$01 len:(## 8) external_address:(len * Bit) addr_extern$01 len:(## 9) external_address:(len * Bit)
= MsgAddressExt; = MsgAddressExt;
anycast_info$_ depth:(## 5) rewrite_pfx:(depth * Bit) = Anycast; anycast_info$_ depth:(## 5) rewrite_pfx:(depth * Bit) = Anycast;
addr_std$10 anycast:(Maybe Anycast) addr_std$10 anycast:(Maybe Anycast)

View file

@ -2277,7 +2277,7 @@ The ``global variables'' may be helpful in implementing some high-level smart-co
The message and address manipulation primitives listed below serialize and deserialize values according to the following TL-B scheme (cf.~\ptref{sp:tlb.brief}): The message and address manipulation primitives listed below serialize and deserialize values according to the following TL-B scheme (cf.~\ptref{sp:tlb.brief}):
\begin{verbatim} \begin{verbatim}
addr_none$00 = MsgAddressExt; addr_none$00 = MsgAddressExt;
addr_extern$01 len:(## 8) external_address:(bits len) addr_extern$01 len:(## 9) external_address:(bits len)
= MsgAddressExt; = MsgAddressExt;
anycast_info$_ depth:(#<= 30) { depth >= 1 } anycast_info$_ depth:(#<= 30) { depth >= 1 }
rewrite_pfx:(bits depth) = Anycast; rewrite_pfx:(bits depth) = Anycast;

View file

@ -3031,9 +3031,9 @@ void Collator::register_new_msgs(block::Transaction& trans) {
} }
/* /*
* *
* Generate (parts of) new state and block * Generate (parts of) new state and block
* *
*/ */
bool store_ext_blk_ref_to(vm::CellBuilder& cb, const ton::BlockIdExt& id_ext, ton::LogicalTime end_lt) { bool store_ext_blk_ref_to(vm::CellBuilder& cb, const ton::BlockIdExt& id_ext, ton::LogicalTime end_lt) {
@ -3166,7 +3166,7 @@ bool Collator::create_mc_state_extra() {
" contains an invalid configuration in its data, IGNORING CHANGES"; " contains an invalid configuration in its data, IGNORING CHANGES";
ignore_cfg_changes = true; ignore_cfg_changes = true;
} else { } else {
cfg0 = cfg_dict.lookup_ref(td::BitArray<32>(1 - 1)); cfg0 = cfg_dict.lookup_ref(td::BitArray<32>{(long long) 0});
} }
bool changed_cfg = false; bool changed_cfg = false;
if (cfg0.not_null()) { if (cfg0.not_null()) {
@ -4041,9 +4041,9 @@ void Collator::return_block_candidate(td::Result<td::Unit> saved) {
} }
/* /*
* *
* Collator register methods * Collator register methods
* *
*/ */
td::Result<bool> Collator::register_external_message_cell(Ref<vm::Cell> ext_msg, const ExtMessage::Hash& ext_hash) { td::Result<bool> Collator::register_external_message_cell(Ref<vm::Cell> ext_msg, const ExtMessage::Hash& ext_hash) {

View file

@ -150,9 +150,9 @@ void ValidateQuery::finish_query() {
} }
/* /*
* *
* INITIAL PARSE & LOAD REQUIRED DATA * INITIAL PARSE & LOAD REQUIRED DATA
* *
*/ */
void ValidateQuery::start_up() { void ValidateQuery::start_up() {
@ -982,9 +982,9 @@ bool ValidateQuery::check_this_shard_mc_info() {
} }
/* /*
* *
* METHODS CALLED FROM try_validate() stage 0 * METHODS CALLED FROM try_validate() stage 0
* *
*/ */
bool ValidateQuery::compute_prev_state() { bool ValidateQuery::compute_prev_state() {
@ -1844,9 +1844,9 @@ bool ValidateQuery::check_utime_lt() {
} }
/* /*
* *
* METHODS CALLED FROM try_validate() stage 1 * METHODS CALLED FROM try_validate() stage 1
* *
*/ */
// almost the same as in Collator // almost the same as in Collator
@ -4956,7 +4956,7 @@ bool ValidateQuery::check_config_update(Ref<vm::CellSlice> old_conf_params, Ref<
return reject_query("no important parameters have been changed, but the block is marked as a key block"); return reject_query("no important parameters have been changed, but the block is marked as a key block");
} }
vm::Dictionary dict1{ocfg_root, 32}; vm::Dictionary dict1{ocfg_root, 32};
auto param0 = dict1.lookup_ref(td::BitArray<32>{1 - 1}); auto param0 = dict1.lookup_ref(td::BitArray<32>{(long long) 0});
if (param0.is_null()) { if (param0.is_null()) {
if (cfg_acc_changed) { if (cfg_acc_changed) {
return reject_query("new state of old configuration smart contract "s + old_cfg_addr.to_hex() + return reject_query("new state of old configuration smart contract "s + old_cfg_addr.to_hex() +
@ -5431,10 +5431,10 @@ bool ValidateQuery::check_mc_block_extra() {
} }
/* /*
* *
* MAIN VALIDATOR FUNCTION * MAIN VALIDATOR FUNCTION
* (invokes other methods in a suitable order) * (invokes other methods in a suitable order)
* *
*/ */
bool ValidateQuery::try_validate() { bool ValidateQuery::try_validate() {