Commit Graph

494 Commits

Author SHA1 Message Date
Norman Moeschter
3cf85f0e83
Changed RECIEVED to RECEIVED in log messages. 2018-12-04 07:27:08 +01:00
moneromooo-monero
4d71d46373
mlocker: remove early page size log
It comes before the logger is initialized, so gets displayed
even though it should not be by default, and apparenly comes
too early for (some versions of) Android, where it crashes.
2018-11-30 16:52:50 +00:00
moneromooo-monero
fc98f7a0a1
rpc: speedup get_outs.bin 2018-11-26 18:56:23 +00:00
Riccardo Spagni
299accd81f
Merge pull request #4819
7c298f5d No longer use a list for registering self references in the abstract tcp server (Martijn Otto)
2018-11-26 20:26:28 +02:00
Martijn Otto
1132436f97
Only show a single mlock() error, to avoid flooding the log 2018-11-26 09:37:07 +01:00
moneromooo-monero
40485a73b6
mlocker: fix access to global lock map after dtor on exit
as the lock, it now leaks
2018-11-22 01:43:42 +00:00
moneromooo-monero
96e6b43970
blockchain_stats: don't use gmtime_r on Windows
In some cases, it doesn't like it (I don't know the details).

Factor into a new epee function
2018-11-21 00:50:53 +00:00
moneromooo-monero
23829ebb09
mlocker: don't throw from lock/unlock
This prevents exceptions from showing up in various awkward
places such as dtors, since the only exception that can be
thrown is a lock failure, and nothing handles a lock failure
anyway.
2018-11-20 15:26:00 +00:00
moneromooo-monero
707c2f836b
Remove -Werror
It is an annoying piece of garbage
2018-11-17 13:15:03 +00:00
Riccardo Spagni
a3d0c7c55c
Merge pull request #4807
b620443b epee: log HTTP/RPC calls at info level (moneromooo-monero)
2018-11-16 11:17:18 +02:00
Riccardo Spagni
42dbb3aa1b
Merge pull request #4785
0cfd2ae5 mlocker: fix dtor ordering problem (moneromooo-monero)
2018-11-16 11:06:09 +02:00
Riccardo Spagni
3880cae134
Merge pull request #4775
741e4a11 epee: speed up json number parsing (moneromooo-monero)
2018-11-16 11:00:56 +02:00
Howard Chu
f6187cd811
epee: speed up parse_hexstr_to_binbuff a little 2018-11-15 23:34:15 +00:00
Martijn Otto
bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
moneromooo-monero
2b3595d0fe
various: do not propagate exception through dtor
Coverity 189689, 189690, 189692, 189695
2018-11-15 15:53:21 +00:00
Riccardo Spagni
59e8a4c306
Merge pull request #4753
157054b8 hardfork: initialize current_fork_index in ctor (moneromooo-monero)
2362baf7 network_throttle: initialize m_last_sample_time in ctor (moneromooo-monero)
d9400f69 serializtion: add missing mainnet and stagenet fields for 0mq (moneromooo-monero)
cbe0122b wallet2: initialize amount to 0 in tx_scan_info_t ctor (moneromooo-monero)
2018-11-14 21:33:02 +02:00
Martijn Otto
7c298f5d14
No longer use a list for registering self references in the abstract tcp
server

Updated assert message

Use a local variable that won't destruct at the end of the if-branch

Updated comment
2018-11-07 11:21:52 +01:00
Riccardo Spagni
fa56a09335
Merge pull request #4740
f067bb0c tests: fix MSYS2 warning 'MONERO_DEFAULT_LOG_CATEGORY redefined' (xiphon)
2018-11-06 21:32:18 +02:00
Riccardo Spagni
7ceeaec2e5
Merge pull request #4709
07c62809 epee: some minor speedup in parsing (moneromooo-monero)
2018-11-06 14:50:57 +02:00
Riccardo Spagni
dd973179ad
Merge pull request #3970
3381b651 abstract_tcp_server2: fix busy calling of idle IO service (moneromooo-monero)
2018-11-06 14:49:32 +02:00
moneromooo-monero
b620443b08
epee: log HTTP/RPC calls at info level
It's useful info to have when investigating logs
2018-11-05 16:14:06 +00:00
moneromooo-monero
0cfd2ae5e7
mlocker: fix dtor ordering problem
leak the mutex instead, it's a one off
2018-11-02 12:59:43 +00:00
moneromooo-monero
741e4a1172
epee: speed up json number parsing 2018-11-01 16:36:16 +00:00
moneromooo-monero
2362baf735
network_throttle: initialize m_last_sample_time in ctor
Coverity 136593
2018-10-29 16:23:14 +00:00
xiphon
f067bb0c8b tests: fix MSYS2 warning 'MONERO_DEFAULT_LOG_CATEGORY redefined' 2018-10-27 15:08:52 +00:00
Riccardo Spagni
442c58e994
Merge pull request #4573
8f3c7937 readline_buffer: fix "cursor in prompt" bug (moneromooo-monero)
2018-10-26 22:34:04 +02:00
moneromooo-monero
07c6280909
epee: some minor speedup in parsing 2018-10-24 08:34:25 +00:00
Riccardo Spagni
2c08fd472d
Merge pull request #4669
d3cda5ad console_handler: add a global log when exiting via EOF (moneromooo-monero)
2018-10-20 20:39:08 +02:00
Riccardo Spagni
6ef07b10b9
Merge pull request #4520
2e2daebc ANSI colors in Windows 10 (iDunk5400)
2018-10-20 20:34:47 +02:00
moneromooo-monero
d3cda5ad39
console_handler: add a global log when exiting via EOF
It's a common confusion point for users which run monerod
without stdin and with --detach
2018-10-20 09:13:55 +00:00
Riccardo Spagni
5ccd3d32b4
Merge pull request #4489
00901e9c epee: initialize a few data members where it seems to be appropriate (moneromooo-monero)
144a6c32 abstract_tcp_server2: move m_period to subclass (moneromooo-monero)
758d7684 connection_basic: remove unused floating time start time (moneromooo-monero)
e5108a29 Catch more exceptions in dtors (moneromooo-monero)
2018-10-15 13:37:18 +02:00
moneromooo-monero
8f3c793749
readline_buffer: fix "cursor in prompt" bug
It happens when readline displays a prompt just before switching
to a shorter one
2018-10-12 21:03:59 +00:00
moneromooo-monero
e736964a0c
Remove epee header dependency on cryptonote_core 2018-10-12 17:16:44 +00:00
iDunk5400
2e2daebcc9
ANSI colors in Windows 10 2018-10-08 14:56:16 +02:00
moneromooo-monero
00901e9c93
epee: initialize a few data members where it seems to be appropriate 2018-10-02 17:28:50 +00:00
moneromooo-monero
144a6c32c9
abstract_tcp_server2: move m_period to subclass
This is where it is actually used, and initialized
2018-10-02 17:28:48 +00:00
moneromooo-monero
758d768486
connection_basic: remove unused floating time start time 2018-10-02 17:28:46 +00:00
moneromooo-monero
e5108a294a
Catch more exceptions in dtors
Misc coverity reports
2018-10-02 17:28:44 +00:00
Riccardo Spagni
effcbf2060
Merge pull request #4459
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero)
3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero)
a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)
1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero)
fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero)
2e2139ff epee: do not propagate exception through dtor (moneromooo-monero)
0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero)
1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)
418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero)
ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero)
6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero)
53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)
e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero)
661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)
5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero)
7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero)
a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero)
d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)
02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)
c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-09-29 22:20:38 +02:00
Riccardo Spagni
b4ec67b2f7
Merge pull request #4443
b2972927 osx compilation fix: missing boost libs added (Dusan Klinec)
2018-09-29 22:20:09 +02:00
moneromooo-monero
bf9a0f4c65
epee: fix stack overflow on crafted input 2018-09-25 11:27:50 +00:00
moneromooo-monero
45683ee02c
epee: fix invalid memory write reading an array entry
Reported by Lilith Wyatt at Talos.

Since this is not needed in normal operation, I just let this
error out.
2018-09-25 11:27:48 +00:00
Riccardo Spagni
b88bbf59c3
Merge pull request #4377
4d52ec0c mlog: do not display http errors by default (moneromooo-monero)
2018-09-21 20:41:17 +02:00
Riccardo Spagni
bb3ff2bb36
Merge pull request #4209
26a42fe5 Added features to epee::span<T> :   - Support for classes   - Added `remove_prefix` function   - Added `to_mut_span` and `as_mut_byte_span` (Lee Clagett)
2018-09-21 20:30:36 +02:00
Riccardo Spagni
580497d5f9
Merge pull request #4306
56b50faa wallet: use wipeable_string in more places where a secret is used (moneromooo-monero)
07ec748c wipeable_string: add hex_to_pod function (moneromooo-monero)
2018-09-18 17:32:11 +02:00
Riccardo Spagni
9c40bc62fc
Merge pull request #3430
42397359 Fixup 32bit arm build (TheCharlatan)
a06d2581 Fix Windows build (TheCharlatan)
ecaf5b3f Add libsodium to the packages, the arm build was complaining about it. (TheCharlatan)
cbbf4d24 Adapt translations to upstream changes (TheCharlatan)
db571546 Updated pcsc url (TheCharlatan)
f0ba19fd Add lrelease to the depends (TheCharlatan)
cfb30462 Add Miniupnp submodule (TheCharlatan)
5f7da005 Unbound is now a submodule. Adapt depends for this. (TheCharlatan)
d6b9bdd3 Update readmes to reflect the usage of depends (TheCharlatan)
56b6e41e Add support for apple and arm building (TheCharlatan)
29311fd1 Disable stack unwinding for mingw32 depends build. (TheCharlatan)
8db3d573 Modify depends for monero's dependencies (TheCharlatan)
0806a23a Initial depends addition (TheCharlatan)
2018-09-18 16:33:21 +02:00
Riccardo Spagni
20087b3a9d
Merge pull request #4307
4469b0c4 abstract_tcp_server2: fix binding to the wrong IP (moneromooo-monero)
8eab6147 epee: use the socket::bind variant which does not throw (moneromooo-monero)
2018-09-14 12:46:08 +02:00
moneromooo-monero
4d52ec0ca4
mlog: do not display http errors by default
They're controllable by potential attackers and would just spam
2018-09-14 09:23:00 +00:00
moneromooo-monero
07ec748c82
wipeable_string: add hex_to_pod function 2018-09-12 09:26:09 +00:00
TheCharlatan
8db3d5731b Modify depends for monero's dependencies
Add readline, ldns, graphviz, unbound to depends packages

Add a cmake toolchain file to depends that is uniquely created for every build and placed in triple/share/toolchain.cmake
This file is then passed to cmake with -DCMAKE_TOOLCHAIN_FILE=/path/to/triple/share/toolchain.cmake

Add the boost locale package to depends

In the depends cmake toolchain file, a DEPENDS flag is added
to exclude, or change cmake checks done that are required for depends

Link miniupnpc and unwind from depends and not external

Add libiconv and icu4c to depends, required for mingw32 builds.

Headers (winsock) need to be lower case in order to compile on unix systems.
This should not affect building on windows.
2018-09-10 22:03:42 +02:00
moneromooo-monero
4469b0c41e
abstract_tcp_server2: fix binding to the wrong IP 2018-09-09 10:48:21 +00:00
luigi1111
77ed11e627
Merge pull request #4270
29dea03 epee: resize vectors where possible in serialization (moneromooo-monero)
76affd9 epee: some speedup in parsing (moneromooo-monero)
dc6c069 db_lmdb: speedup the get_output_distribution common case (moneromooo-monero)
76ac5a8 wallet2: ask for a binary output distribution, for speed (moneromooo-monero)
2018-09-04 13:19:58 -05:00
moneromooo-monero
8eab6147f4
epee: use the socket::bind variant which does not throw
When this throws in a loop, stack trace generation can take
a significant amount of CPU
2018-08-27 17:02:07 +00:00
luigi1111
140eb78231
Merge pull request #4179
262e391 mlog: handle filenames without parent directories (moneromooo-monero)
2018-08-22 20:39:09 -05:00
moneromooo-monero
76affd941b
epee: some speedup in parsing 2018-08-19 15:29:01 +00:00
moneromooo-monero
29dea03091
epee: resize vectors where possible in serialization
to avoid unnecessary repeated reallocation
2018-08-17 01:08:52 +00:00
moneromooo-monero
70271fa788
common: add a class to safely wrap mlock/munlock
This class will allow mlocking small objects, of which there
may be several per page. It adds refcounting so pages are only
munlocked when the last object on that page munlocks.
2018-08-16 11:57:46 +00:00
moneromooo-monero
e9ffa91257
store secret keys encrypted where possible
The secret spend key is kept encrypted in memory, and
decrypted on the fly when needed.

Both spend and view secret keys are kept encrypted in a JSON
field in the keys file. This avoids leaving the keys in
memory due to being manipulated by the JSON I/O API.
2018-08-16 11:57:43 +00:00
moneromooo-monero
ea37614efe
wallet: wipe seed from memory where appropriate 2018-08-16 09:17:52 +00:00
luigi1111
0415863747
Merge pull request #4177
e7c0fcd epee: set jsonrpc to '2.0' in parse error return data (moneromooo-monero)
2018-08-15 17:42:09 -05:00
luigi1111
3b409a3b8a
Merge pull request #4130
979105b abstract_tcp_server2: fix race on shutdown (moneromooo-monero)
2018-08-15 17:13:35 -05:00
luigi1111
dd966c8a3a
Merge pull request #4090
42f3b7c http_protocol_handler: catch invalid numbers when parsing (moneromooo-monero)
0a4a7da http_protocol_handler: fix HTTP/x.y parsing (moneromooo-monero)
2018-08-15 17:08:10 -05:00
Lee Clagett
26a42fe54a Added features to epee::span<T> :
- Support for classes
  - Added `remove_prefix` function
  - Added `to_mut_span` and `as_mut_byte_span`
2018-08-03 20:33:07 -04:00
moneromooo-monero
262e391fb1
mlog: handle filenames without parent directories
eg, --log-file=foo.log

This would otherwise throw and crash with a stack overflow
2018-07-26 22:49:54 +01:00
moneromooo-monero
e7c0fcd8f3
epee: set jsonrpc to "2.0" in parse error return data 2018-07-25 23:00:19 +01:00
moneromooo-monero
979105b298
abstract_tcp_server2: fix race on shutdown 2018-07-15 19:08:49 +01:00
moneromooo-monero
8d578f1f2d
memwipe: don't call the workhorse for 0 bytes
Some of them don't like it
2018-07-10 15:37:22 +01:00
moneromooo-monero
0a4a7da35c
http_protocol_handler: fix HTTP/x.y parsing
It was accepting any character for the dot (yeah, massive big I know)
2018-07-03 23:16:48 +01:00
moneromooo-monero
42f3b7cbca
http_protocol_handler: catch invalid numbers when parsing 2018-07-03 23:16:44 +01:00
Riccardo Spagni
c58758a016
Merge pull request #4080
dead780f abstract_tcp_server2: fix use after free (moneromooo-monero)
2018-07-03 15:24:01 +02:00
Riccardo Spagni
318fb23d7a
Merge pull request #3997
1a526ed5 abstract_tcp_server2: restart async accept on error (moneromooo-monero)
2018-07-03 15:16:04 +02:00
moneromooo-monero
dead780f8a
abstract_tcp_server2: fix use after free 2018-06-29 15:40:48 +01:00
stoffu
1d176473e9
epee.string_tools: add conversion between UTF-8 and UTF-16 2018-06-28 09:40:26 +09:00
luigi1111
c0c6102260
Merge pull request #3972
8766528 epee: fallback to a counter if gmtime fails when rotating logs (moneromooo-monero)
2018-06-25 15:21:25 -05:00
luigi1111
a2b08db9c9
Merge pull request #3971
4ecf714 epee: fix include for ofstream (moneromooo-monero)
2018-06-25 15:20:12 -05:00
luigi1111
8fad35f8e2
Merge pull request #3962
55c7fb8 epee: adaptive connection timeout system (moneromooo-monero)
2018-06-25 15:12:37 -05:00
luigi1111
c678413a89
Merge pull request #3902
f8dd433 epee: fix detection of 172.16.0.0/172.31.255.255 local IP range (moneromooo-monero)
5db9e3c unit_tests: add tests for local IP range detection (moneromooo-monero)
2018-06-20 14:22:44 -05:00
luigi1111
51cdd76bbd
Merge pull request #3897
63d0ab0 mlog: --max-log-files to set the max number of rotated log files (stoffu)
2018-06-20 14:19:30 -05:00
luigi1111
896512b2b6
Merge pull request #3878
5a412b7 disable file size sanity check when loading the wallet cache (moneromooo-monero)
2018-06-19 12:57:59 -05:00
luigi1111
f62399b88d
Merge pull request #3821
558d05b epee: log type name when a container size check fails (moneromooo-monero)
a2566db object_sizes: add a few useful types (moneromooo-monero)
2018-06-19 12:39:12 -05:00
moneromooo-monero
1a526ed571
abstract_tcp_server2: restart async accept on error 2018-06-18 23:34:01 +01:00
jcktm
b43b9a1304 wallet-rpc: added IPs to error logging in simple_http_connection_handler 2018-06-13 15:41:51 +10:00
stoffu
63d0ab09b5
mlog: --max-log-files to set the max number of rotated log files 2018-06-13 12:44:27 +09:00
moneromooo-monero
55c7fb87a9
epee: adaptive connection timeout system
a connection's timeout is halved for every extra connection
from the same host.

Also keep track of when we don't need to use a connection
anymore, so we can close it and free the resource for another
connection.

Also use the longer timeout for non routable local addresses.
2018-06-10 19:39:38 +01:00
moneromooo-monero
87665281ea
epee: fallback to a counter if gmtime fails when rotating logs 2018-06-09 19:23:48 +01:00
moneromooo-monero
4ecf71405f
epee: fix include for ofstream 2018-06-09 19:19:27 +01:00
moneromooo-monero
3381b6517e
abstract_tcp_server2: fix busy calling of idle IO service
This would make monerod use 100% CPU when running with torsocks
without Tor running
2018-06-09 12:38:29 +01:00
moneromooo-monero
f8dd433110
epee: fix detection of 172.16.0.0/172.31.255.255 local IP range 2018-06-01 21:47:21 +01:00
moneromooo-monero
5a412b7a3f
disable file size sanity check when loading the wallet cache 2018-05-28 14:58:22 +01:00
moneromooo-monero
dfd36bbebb
http_protocol_handler: limit the number of starting newlines 2018-05-27 09:43:54 +01:00
moneromooo-monero
4d15864728
abstract_tcp_server2: timeout on RPC connections 2018-05-26 20:18:36 +01:00
moneromooo-monero
885a117ddb
http_protocol_handler: speedup newline discarding 2018-05-26 20:18:33 +01:00
moneromooo-monero
6a58c88e2d
console_handler: fix start_default_console use of prompt parameter
It had not been updated to the function type change
2018-05-26 20:18:30 +01:00
moneromooo-monero
558d05b47e
epee: log type name when a container size check fails 2018-05-17 10:40:08 +01:00
Riccardo Spagni
5bca8c6998
Merge pull request #3667
53a1962d epee: Drop deprecated Boost.Thread header (Jan Beich)
2018-04-28 17:01:32 +02:00
moneromooo-monero
18c2f6e21d
mlog: fix setting no logs 2018-04-25 20:42:11 +01:00
Jan Beich
53a1962da1 epee: Drop deprecated Boost.Thread header
In file included from src/cryptonote_basic/hardfork.cpp:33:
In file included from src/blockchain_db/blockchain_db.h:42:
In file included from src/cryptonote_basic/hardfork.h:31:
contrib/epee/include/syncobj.h:37:10: fatal error: 'boost/thread/v2/thread.hpp' file not found
#include <boost/thread/v2/thread.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/rpc/daemon_handler.cpp:29:
In file included from src/rpc/daemon_handler.h:36:
In file included from src/p2p/net_node.h:41:
In file included from contrib/epee/include/net/levin_server_cp2.h:32:
In file included from contrib/epee/include/net/abstract_tcp_server2.h:324:
contrib/epee/include/net/abstract_tcp_server2.inl:44:10: fatal error: 'boost/thread/v2/thread.hpp' file not found
#include <boost/thread/v2/thread.hpp> // TODO
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

contrib/epee/include/math_helper.h: In member function 'bool epee::math_helper::average<val, default_base>::set_base()':
contrib/epee/include/syncobj.h:227:56: error: 'sleep_for' is not a member of 'boost::this_thread'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^
contrib/epee/include/syncobj.h:227:56: note: in definition of macro 'CRITICAL_REGION_LOCAL'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^~~~~~~~~
contrib/epee/include/syncobj.h:227:56: note: suggested alternative: 'sleep'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^
contrib/epee/include/syncobj.h:227:56: note: in definition of macro 'CRITICAL_REGION_LOCAL'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^~~~~~~~~
2018-04-19 09:15:09 +00:00
Dimitris Apostolou
57c0b1ed9f Fix typos in various files 2018-03-15 18:25:38 +02:00
rbrunner7
430268224d Wallet2 + CLI wallet: UTF-8 support for filenames and paths under Windows 2018-02-25 12:57:58 +01:00
Riccardo Spagni
854a87d633
Merge pull request #3289
4789f859 wipeable_string: don't try to wipe an empty buffer (moneromooo-monero)
2018-02-20 17:48:16 +02:00