Compare commits

...

11 Commits

Author SHA1 Message Date
SChernykh a8582b2a0f p2pool v3.9
C/C++ CI / build-alpine-static (map[arch:aarch64 flags:-flto=2 -fuse-linker-plugin -ffunction-sections -Wno-error=inline -mfix-cortex-a53-835769 -mfix-cortex-a53-843419]) (push) Has been cancelled
C/C++ CI / build-alpine-static (map[arch:x86_64 flags:-flto=2 -fuse-linker-plugin -ffunction-sections -Wno-error=inline]) (push) Has been cancelled
C/C++ CI / build-ubuntu (map[c:gcc-11 cpp:g++-11 os:ubuntu-20.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu (map[c:gcc-12 cpp:g++-12 os:ubuntu-22.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu-static-libs (map[flags:-flto=2 -fuse-linker-plugin -ffunction-sections -Wno-error=inline]) (push) Has been cancelled
C/C++ CI / build-ubuntu-aarch64 (map[flags:-flto=2 -fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 os:ubuntu-20.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu-aarch64 (map[flags:-flto=2 -fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 os:ubuntu-22.04]) (push) Has been cancelled
C/C++ CI / build-windows-msys2 (map[c:clang cxx:clang++ flags:-flto -ffunction-sections -fuse-ld=lld -Wno-unused-command-line-argument]) (push) Has been cancelled
C/C++ CI / build-windows-msys2 (map[c:gcc cxx:g++ flags:-flto=2 -fuse-linker-plugin -ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[os:2019 rx:OFF upnp:OFF vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[os:2019 rx:OFF upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[os:2019 rx:ON upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-macos (push) Has been cancelled
C/C++ CI / build-macos-aarch64 (push) Has been cancelled
C/C++ CI / build-freebsd (map[architecture:x86-64 host:ubuntu-22.04 name:freebsd version:12.4]) (push) Has been cancelled
C/C++ CI / build-openbsd (map[architecture:x86-64 host:ubuntu-22.04 name:openbsd version:7.2]) (push) Has been cancelled
clang-tidy / clang-tidy (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
cppcheck / cppcheck-ubuntu (push) Has been cancelled
cppcheck / cppcheck-windows (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
source-snapshot / source-snapshot (push) Has been cancelled
Sync test / sync-test-ubuntu-tsan (push) Has been cancelled
Sync test / sync-test-ubuntu-msan (push) Has been cancelled
Sync test / sync-test-ubuntu-ubsan (push) Has been cancelled
Sync test / sync-test-ubuntu-asan (push) Has been cancelled
Sync test / sync-test-macos (push) Has been cancelled
Sync test / sync-test-windows-debug-asan (push) Has been cancelled
Sync test / sync-test-windows-leaks (push) Has been cancelled
2023-11-26 16:17:46 +01:00
SChernykh 8493dbc47b Fixed cppcheck errors 2023-11-26 09:52:24 +01:00
SChernykh 602b9e2ae9 Merge pull request #294 from felixonmars/patch-1
Update Arch Linux package URL in README.md
2023-11-21 09:22:32 +01:00
Felix Yan 103a2cbd4f Update Arch Linux package URL in README.md
The old URL returns 404 now.
2023-11-21 09:15:03 +02:00
SChernykh e4b11ecab4 Merge pull request #286 from hinto-janai/master
Add `gupax.io` to DNS seed nodes
2023-11-07 16:20:40 +01:00
SChernykh 781606bec5 Enabled SEH for MSVC builds 2023-11-07 13:09:24 +01:00
SChernykh f4d709c0dd Util: more checks in get_dns_txt_records_base 2023-11-07 12:34:36 +01:00
SChernykh 8699e1887c Debug: print call stack of unhandled exceptions 2023-11-07 11:00:39 +01:00
hinto.janai bf39319cbb add gupax.io to DNS seed nodes 2023-11-06 17:05:33 -05:00
SChernykh e92ce0a5f3 Log: fixed broken output redirection on Windows 2023-11-05 18:28:11 +01:00
SChernykh f7b90b3808 Fixed sync test 2023-11-02 21:42:03 +01:00
12 changed files with 108 additions and 37 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ on:
jobs:
cppcheck-ubuntu:
timeout-minutes: 50
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
@@ -60,7 +60,7 @@ jobs:
cppcheck-windows:
timeout-minutes: 50
timeout-minutes: 60
runs-on: windows-latest
steps:
+6 -4
View File
@@ -349,13 +349,15 @@ jobs:
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=Debug p2pool.vcxproj
- name: Run p2pool
shell: cmd
run: |
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
cd build/Debug
mkdir data
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 1"
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 2"
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 3"
./p2pool.exe --host xmrnode.facspro.net --rpc-port 18089 --zmq-port 18084 --host xmr2.rs.me --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
start python ../../tests/src/stratum_dummy.py 1
start python ../../tests/src/stratum_dummy.py 2
start python ../../tests/src/stratum_dummy.py 3
p2pool.exe --host xmrnode.facspro.net --rpc-port 18089 --zmq-port 18084 --host xmr2.rs.me --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
+1 -1
View File
@@ -244,7 +244,7 @@ cmake ..
make -j$(nproc)
```
### [Arch Linux](https://archlinux.org/packages/community/x86_64/p2pool/)
### [Arch Linux](https://archlinux.org/packages/extra/x86_64/p2pool/)
```
pacman -S p2pool
+1 -1
View File
@@ -67,7 +67,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
endif()
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(GENERAL_FLAGS "/MP")
set(GENERAL_FLAGS "/MP /EHa")
set(WARNING_FLAGS "/Wall /WX /sdl")
set(SECURITY_FLAGS "/GS /guard:cf")
set(OPTIMIZATION_FLAGS "/O2 /Oi /Ob2 /Ot /DNDEBUG /GL")
+1 -1
View File
@@ -19,7 +19,7 @@
#ifdef _MSC_VER
#pragma warning(disable : 4005 4061 4324 4365 4464 4619 4625 4626 4668 4710 4711 4804 4820 5039 5045 5220 5246 5264)
#pragma warning(disable : 4005 4061 4324 4365 4464 4619 4625 4626 4668 4710 4711 4714 4804 4820 5039 5045 5220 5246 5264)
#define FORCEINLINE __forceinline
#define NOINLINE __declspec(noinline)
#define LIKELY(expression) expression
+1
View File
@@ -93,6 +93,7 @@ void generate_keys(hash& pub, hash& sec)
ge_p3_tobytes(pub.h, &point);
}
// cppcheck-suppress constParameterReference
void generate_keys_deterministic(hash& pub, hash& sec, const uint8_t* entropy, size_t len)
{
uint32_t counter = 0;
+72 -7
View File
@@ -44,8 +44,66 @@ bool CONSOLE_COLORS = true;
#ifdef _WIN32
static const HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
static const HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
static const HANDLE hStdErr = GetStdHandle(STD_ERROR_HANDLE);
#endif
#if defined(_MSC_VER) && !defined(NDEBUG)
#include <DbgHelp.h>
#pragma comment(lib, "Dbghelp.lib")
LONG WINAPI UnhandledExceptionFilter(_In_ _EXCEPTION_POINTERS* exception_pointers)
{
constexpr size_t MAX_FRAMES = 32;
void* stack_trace[MAX_FRAMES] = {};
DWORD hash;
CaptureStackBackTrace(1, MAX_FRAMES, stack_trace, &hash);
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)] = {};
PSYMBOL_INFO pSymbol = reinterpret_cast<PSYMBOL_INFO>(buffer);
pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO);
pSymbol->MaxNameLen = MAX_SYM_NAME;
IMAGEHLP_LINE64 line{};
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
const HANDLE h = GetCurrentProcess();
const uint32_t code = (exception_pointers && exception_pointers->ExceptionRecord) ? exception_pointers->ExceptionRecord->ExceptionCode : 0;
fprintf(stderr, "\n\nUnhandled exception %X at:\n", code);
fflush(stderr);
for (size_t j = 0; j < MAX_FRAMES; ++j) {
const DWORD64 address = reinterpret_cast<DWORD64>(stack_trace[j]);
DWORD t = 0;
if (SymFromAddr(h, address, nullptr, pSymbol) && SymGetLineFromAddr64(h, address, &t, &line)) {
fprintf(stderr, "%s (%s, line %lu)\n", line.FileName, pSymbol->Name, line.LineNumber);
fflush(stderr);
}
}
fprintf(stderr, "\n\n");
fflush(stderr);
// Normal logging might be broken at this point, but try to log it anyway
LOGERR(0, "Unhandled exception " << log::Hex(code) << " at:");
for (size_t j = 0; j < MAX_FRAMES; ++j) {
const DWORD64 address = reinterpret_cast<DWORD64>(stack_trace[j]);
DWORD t = 0;
if (SymFromAddr(h, address, nullptr, pSymbol) && SymGetLineFromAddr64(h, address, &t, &line)) {
LOGERR(0, line.FileName << " (" << static_cast<const char*>(pSymbol->Name) << ", line " << static_cast<size_t>(line.LineNumber) << ')');
}
}
Sleep(1000);
return EXCEPTION_CONTINUE_SEARCH;
}
#endif // _MSC_VER && !NDEBUG
#endif // _WIN32
class Worker
{
@@ -62,6 +120,11 @@ public:
, m_started{ false }
, m_stopped(false)
{
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
SetUnhandledExceptionFilter(UnhandledExceptionFilter);
SymInitialize(GetCurrentProcess(), NULL, TRUE);
#endif
set_main_thread();
std::setlocale(LC_ALL, "en_001");
@@ -140,6 +203,10 @@ public:
#endif
m_logFile.close();
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
SymCleanup(GetCurrentProcess());
#endif
}
FORCEINLINE void write(const char* buf, uint32_t size)
@@ -245,12 +312,7 @@ private:
strip_colors(p, size);
}
#ifdef _WIN32
DWORD k;
WriteConsole((severity == 1) ? hStdOut : hStdErr, p, size, &k, nullptr);
#else
fwrite(p, 1, size, (severity == 1) ? stdout : stderr);
#endif
if (m_logFile.is_open()) {
if (c) {
@@ -289,6 +351,9 @@ private:
m_logFile.open(log_file_name, std::ios::app | std::ios::binary);
}
}
fflush(stdout);
fflush(stderr);
} while (1);
}
+1 -5
View File
@@ -18,7 +18,7 @@
#include "common.h"
// Simple memory leak detector for Windows users, works best in RelWithDebInfo configuration.
#if defined(_WIN32) && defined(DEV_TRACK_MEMORY)
#if defined(_WIN32) && defined(DEV_TRACK_MEMORY) && defined(_MSC_VER) && !defined(NDEBUG)
#include "uv_util.h"
#include <atomic>
@@ -270,8 +270,6 @@ void memory_tracking_start()
// Trigger std::ostream initialization to avoid reporting it as leaks
std::cout << "Memory leak detection = " << 1 << std::endl;
SymInitialize(GetCurrentProcess(), NULL, TRUE);
using namespace p2pool;
uv_replace_allocator(malloc_hook, realloc_hook, calloc_hook, free_hook);
@@ -307,8 +305,6 @@ bool memory_tracking_stop()
printf("No memory leaks detected\n\n");
}
SymCleanup(h);
return (total_leaks == 0);
}
+2 -2
View File
@@ -34,8 +34,8 @@
LOG_CATEGORY(P2PServer)
static constexpr char saved_peer_list_file_name[] = "p2pool_peers.txt";
static const char* seed_nodes[] = { "seeds.p2pool.io", "main.p2poolpeers.net", ""};
static const char* seed_nodes_mini[] = { "seeds-mini.p2pool.io", "mini.p2poolpeers.net", "" };
static const char* seed_nodes[] = { "seeds.p2pool.io", "main.p2poolpeers.net", "main.gupax.io", "" };
static const char* seed_nodes_mini[] = { "seeds-mini.p2pool.io", "mini.p2poolpeers.net", "mini.gupax.io", "" };
static constexpr int DEFAULT_BACKLOG = 16;
static constexpr uint64_t DEFAULT_BAN_TIME = 600;
+1 -1
View File
@@ -375,7 +375,7 @@ bool StratumServer::on_submit(StratumClient* client, uint32_t id, const char* jo
}
if (found) {
BlockTemplate& block = m_pool->block_template();
const BlockTemplate& block = m_pool->block_template();
uint64_t height, sidechain_height;
difficulty_type mainchain_diff, sidechain_diff;
+19 -12
View File
@@ -508,22 +508,29 @@ bool get_dns_txt_records_base(const std::string& host, Callback<void, const char
}
#ifdef _WIN32
PDNS_RECORD pQueryResults;
if (DnsQuery(host.c_str(), DNS_TYPE_TEXT, DNS_QUERY_STANDARD, NULL, &pQueryResults, NULL) != 0) {
return false;
}
try {
PDNS_RECORD pQueryResults;
if (DnsQuery(host.c_str(), DNS_TYPE_TEXT, DNS_QUERY_STANDARD, NULL, &pQueryResults, NULL) != 0) {
return false;
}
for (PDNS_RECORD p = pQueryResults; p; p = p->pNext) {
for (size_t j = 0; j < p->Data.TXT.dwStringCount; ++j) {
const char* s = p->Data.TXT.pStringArray[j];
const size_t n = strlen(s);
if (n > 0) {
callback(s, n);
for (PDNS_RECORD p = pQueryResults; p; p = p->pNext) {
for (size_t j = 0; j < p->Data.TXT.dwStringCount; ++j) {
const char* s = p->Data.TXT.pStringArray[j];
if (s) {
const size_t n = strlen(s);
if (n > 0) {
callback(s, n);
}
}
}
}
}
DnsRecordListFree(pQueryResults, DnsFreeRecordList);
DnsRecordListFree(pQueryResults, DnsFreeRecordList);
}
catch (...) {
return false;
}
return true;
#elif defined(HAVE_RES_QUERY)
+1 -1
View File
@@ -35,7 +35,7 @@
namespace p2pool {
#define P2POOL_VERSION_MAJOR 3
#define P2POOL_VERSION_MINOR 8
#define P2POOL_VERSION_MINOR 9
#define P2POOL_VERSION_PATCH 0
extern const char* VERSION;