1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-26 22:12:53 -05:00

Compare commits

..

16 Commits

Author SHA1 Message Date
Tony Butler
0f55fa18a9 Merge 5ac6d438fa into a7be8cb80c 2024-06-06 07:26:34 +08:00
XMRig
a7be8cb80c Remove chdir call after fork. 2024-06-05 03:45:37 +07:00
XMRig
2ce16df423 Create signal handles after fork() call, replace #3492. 2024-06-05 03:23:58 +07:00
XMRig
5eaa6c152e v6.21.4-dev 2024-04-23 16:51:58 +07:00
XMRig
6972f727c1 Merge branch 'master' into dev 2024-04-23 16:50:58 +07:00
XMRig
7897f10c48 v6.21.3 2024-04-23 16:27:24 +07:00
XMRig
da2fb331b3 Merge branch 'dev' 2024-04-23 16:26:18 +07:00
xmrig
57f3e9c3da Update CHANGELOG.md 2024-04-23 16:17:26 +07:00
xmrig
1efe7e9562 Merge pull request #3462 from SChernykh/dev
RandomX: correct memcpy size for JIT initialization
2024-04-14 17:01:16 +07:00
SChernykh
caae7c64f0 RandomX: correct memcpy size for JIT initialization
No buffer overflow, better fix for `_FORTIFY_SOURCE`
2024-04-14 09:13:00 +02:00
xmrig
9fbdcc0ef0 Merge pull request #3461 from SChernykh/dev
RandomX: check pointer sizes during JIT initialization
2024-04-14 05:38:53 +07:00
SChernykh
c7c26d97fe RandomX: check pointer sizes during JIT initialization 2024-04-13 20:32:16 +02:00
XMRig
1f7e635b04 Use internal logger for error message. 2024-03-26 21:46:18 +07:00
XMRig
1c5786e3c5 v6.21.3-dev 2024-03-23 16:21:54 +07:00
XMRig
44eb4f0038 Merge branch 'master' into dev 2024-03-23 16:20:24 +07:00
Tony Butler
5ac6d438fa pause-on-battery: Support macsmc-battery driver and sysfs node 2023-07-12 02:06:54 -06:00
12 changed files with 32 additions and 31 deletions

View File

@@ -1,3 +1,6 @@
# v6.21.3
- [#3462](https://github.com/xmrig/xmrig/pull/3462) RandomX: correct memcpy size for JIT initialization.
# v6.21.2 # v6.21.2
- The dependencies of all prebuilt releases have been updated. Support for old Ubuntu releases has been dropped. - The dependencies of all prebuilt releases have been updated. Support for old Ubuntu releases has been dropped.
- [#2800](https://github.com/xmrig/xmrig/issues/2800) Fixed donation with GhostRider algorithm for builds without KawPow algorithm. - [#2800](https://github.com/xmrig/xmrig/issues/2800) Fixed donation with GhostRider algorithm for builds without KawPow algorithm.

View File

@@ -6,8 +6,8 @@
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd> * Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh> * Copyright 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib> #include <cstdlib>
#include <uv.h> #include <uv.h>
@@ -61,13 +60,13 @@ int xmrig::App::exec()
return 2; return 2;
} }
m_signals = std::make_shared<Signals>(this);
int rc = 0; int rc = 0;
if (background(rc)) { if (background(rc)) {
return rc; return rc;
} }
m_signals = std::make_shared<Signals>(this);
rc = m_controller->init(); rc = m_controller->init();
if (rc != 0) { if (rc != 0) {
return rc; return rc;

View File

@@ -5,8 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh> * Copyright 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib> #include <cstdlib>
#include <csignal> #include <csignal>
#include <cerrno> #include <cerrno>
@@ -53,16 +52,9 @@ bool xmrig::App::background(int &rc)
return true; return true;
} }
i = setsid(); if (setsid() < 0) {
if (i < 0) {
LOG_ERR("setsid() failed (errno = %d)", errno); LOG_ERR("setsid() failed (errno = %d)", errno);
} }
i = chdir("/");
if (i < 0) {
LOG_ERR("chdir() failed (errno = %d)", errno);
}
return false; return false;
} }

View File

@@ -1,6 +1,6 @@
/* XMRig /* XMRig
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> * Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -25,6 +25,8 @@
#include "base/crypto/keccak.h" #include "base/crypto/keccak.h"
#include "base/io/Env.h" #include "base/io/Env.h"
#include "base/io/json/Json.h" #include "base/io/json/Json.h"
#include "base/io/log/Log.h"
#include "base/io/log/Tags.h"
#include "base/kernel/Base.h" #include "base/kernel/Base.h"
#include "base/tools/Chrono.h" #include "base/tools/Chrono.h"
#include "base/tools/Cvt.h" #include "base/tools/Cvt.h"
@@ -39,7 +41,6 @@
#include <thread> #include <thread>
#include <iostream>
namespace xmrig { namespace xmrig {
@@ -81,8 +82,7 @@ static rapidjson::Value getResources(rapidjson::Document &doc)
xmrig::Api::Api(Base *base) : xmrig::Api::Api(Base *base) :
m_base(base), m_base(base),
m_timestamp(Chrono::currentMSecsSinceEpoch()), m_timestamp(Chrono::currentMSecsSinceEpoch())
m_httpd(nullptr)
{ {
base->addListener(this); base->addListener(this);
@@ -118,7 +118,8 @@ void xmrig::Api::start()
if (!m_httpd) { if (!m_httpd) {
m_httpd = new Httpd(m_base); m_httpd = new Httpd(m_base);
if (!m_httpd->start()) { if (!m_httpd->start()) {
std::cerr << "HTTP server failed to start." << std::endl; LOG_ERR("%s " RED_BOLD("HTTP API server failed to start."), Tags::network());
delete m_httpd; // Properly handle failure to start delete m_httpd; // Properly handle failure to start
m_httpd = nullptr; m_httpd = nullptr;
} }

View File

@@ -1,6 +1,6 @@
/* XMRig /* XMRig
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh> * Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@@ -169,6 +169,12 @@ bool xmrig::Platform::isOnBatteryPower()
return (status == "Discharging"); return (status == "Discharging");
} }
} }
std::ifstream f("/sys/class/power_supply/macsmc-battery/status");
if (f.is_open()) {
std::string status;
f >> status;
return (status == "Discharging");
}
return false; return false;
} }

View File

@@ -1078,6 +1078,6 @@ void JitCompilerA64::h_NOP(Instruction& instr, uint32_t& codePos)
{ {
} }
InstructionGeneratorA64 JitCompilerA64::engine[257] = {}; InstructionGeneratorA64 JitCompilerA64::engine[256] = {};
} }

View File

@@ -74,7 +74,7 @@ namespace randomx {
void enableWriting() const; void enableWriting() const;
void enableExecution() const; void enableExecution() const;
static InstructionGeneratorA64 engine[257]; static InstructionGeneratorA64 engine[256];
private: private:
const bool hugePages; const bool hugePages;

View File

@@ -1443,6 +1443,6 @@ namespace randomx {
emitByte(0x90, code, codePos); emitByte(0x90, code, codePos);
} }
alignas(64) InstructionGeneratorX86 JitCompilerX86::engine[257] = {}; alignas(64) InstructionGeneratorX86 JitCompilerX86::engine[256] = {};
} }

View File

@@ -81,7 +81,7 @@ namespace randomx {
void enableWriting() const; void enableWriting() const;
void enableExecution() const; void enableExecution() const;
alignas(64) static InstructionGeneratorX86 engine[257]; alignas(64) static InstructionGeneratorX86 engine[256];
private: private:
int registerUsage[RegistersCount] = {}; int registerUsage[RegistersCount] = {};

View File

@@ -260,7 +260,7 @@ typedef void(randomx::JitCompilerX86::* InstructionGeneratorX86_2)(const randomx
#define JIT_HANDLE(x, prev) do { \ #define JIT_HANDLE(x, prev) do { \
const InstructionGeneratorX86_2 p = &randomx::JitCompilerX86::h_##x; \ const InstructionGeneratorX86_2 p = &randomx::JitCompilerX86::h_##x; \
memcpy(randomx::JitCompilerX86::engine + k, &p, sizeof(p)); \ memcpy(randomx::JitCompilerX86::engine + k, &p, sizeof(randomx::JitCompilerX86::engine[k])); \
} while (0) } while (0)
#elif (XMRIG_ARM == 8) #elif (XMRIG_ARM == 8)

View File

@@ -22,7 +22,7 @@
#define APP_ID "xmrig" #define APP_ID "xmrig"
#define APP_NAME "XMRig" #define APP_NAME "XMRig"
#define APP_DESC "XMRig miner" #define APP_DESC "XMRig miner"
#define APP_VERSION "6.21.2" #define APP_VERSION "6.21.4-dev"
#define APP_DOMAIN "xmrig.com" #define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com" #define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2024 xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2024 xmrig.com"
@@ -30,7 +30,7 @@
#define APP_VER_MAJOR 6 #define APP_VER_MAJOR 6
#define APP_VER_MINOR 21 #define APP_VER_MINOR 21
#define APP_VER_PATCH 2 #define APP_VER_PATCH 4
#ifdef _MSC_VER #ifdef _MSC_VER
# if (_MSC_VER >= 1930) # if (_MSC_VER >= 1930)