-
hyc
gingeropolous: no I'm offline now, done with that for the moment
-
hyc
at this point my only thought is to wrap write() and assert if it's writing into the LMDB fd from outside of liblmdb
-
moneromooo
If you think it's that again, maybe dup2 the lmdb fd to something like 80 or so. Very unlikely to be reused.
-
moneromooo
Way less than 2 or 1 anyway.
-
hyc
yeah, that occurred to me too
-
hyc
but when we're running interactively, non-detached, it's not going to be 1 or 2 anyway
-
hyc
the problem is that it occurs so infrequently, using dup2 to assign a larger fd won't ever tell us where the actual bug is
-
hyc
I prefer to detect it and assert() so we can kill the bug
-
moneromooo
You can do both.
-
moneromooo
Actually, one thing I don't get. You did close 2 in your previous patch. 1 and 2 are the only things you write to you don't open.
-
moneromooo
So it seems odd it's the same thing again, no ?
-
hyc
yes, quite odd
-
hyc
-
hyc
we discovered the bug was a redundant close in Heimdal Kerberos that time
-
moneromooo
I'm not familiar with the stdio mapping to fds. Maybe reopening the fd is transparent to the stdio layer.
-
hyc
stdio always uses 1=stdout and 2=stderr
-
hyc
you can use freopen() to reassign them
-
hyc
but otherwise, it's always 1 and 2
-
moneromooo
Right, so closing the fd is ineffective as it can be reopened. Or rather, only effective till the next open.
-
hyc
yes
-
hyc
my previous patch was to *reopen* 2. it was left closed and the next open that came along got #2
-
moneromooo
Ah. OK, that makes sense.
-
hyc
and the previous code has always been wrong. Every canonical example of fork() has always shown close 1-2, open /dev/null.
-
hyc
anyway, selsta already confirmed before that he wasn't running demonized, so the previous patch was not expected to fix it
-
hyc
we just still had no idea where the writes were coming from
-
hyc
I'm a little suspicious about whether this one is an errant write() though. the text didn't begin on a page boundary, like in the previous bug.
-
hyc
so on my own monerod right now, [012] are /dev/tty, 3 is the logfile, [456] are LMDB fds
-
hyc
what if it's a logfile rotation bug
-
gingeropolous
hyc, well there's a monerod running that we can't control
-
gingeropolous
but its ok, working around it
-
infinitejest-_
can anyone help "xie" in #monero? he's the binance dev trying to update their stuff but seems shy to come out.
-
hyc
-
hyc
my ban list is still growing
-
hyc
~50 now
-
hyc
-
hyc
gingeropolous, selsta - try this
paste.debian.net/1119035
-
hyc
note that since it closes the lockfile fd, it probably is unsafe to use more than one process at a time
-
hyc
also, probably whatever is doing the bogus writes isn't checking its return code. just making an unwritable FD may not be enough to detect the culprit.
-
hyc
hm, wait, ignore that one
-
hyc
-
selsta
so will this patch the issue might not happen anymore?
-
selsta
I’ll run it but it will be difficult to verify I guess
-
selsta
with*
-
hyc
right
-
hyc
I guess I can try working up a patch to assert on the bogus writes instead
-
hyc
but from previous straces we never actually saw any writes to the wrong FDs
-
hyc
so it's hard to figure out what to actually wrap and assert on
-
hyc
another possibility is to replace the FDs with a pipe, and have another thread assert if it ever receives data on it
-
hyc
but that probably won't stop the process soon enough; whichever thread does the write will probably have moved on already
-
hyc
still, could be worth a try. what do you think?
-
hyc
selstat try this one then
paste.debian.net/1119040
-
hyc
run under gdb, or make sure core files are enabled
-
dEBRUYNE
There are a few PRs on the merge list that need review, would appreciate if people would have a look at them
-
dEBRUYNE
Needs review:
-
dEBRUYNE
6040 6048 6050 6053 6061 6094 6095 6096 6102
-
dEBRUYNE
^ The list
-
selsta
13:38 <hyc> run under gdb, or make sure core files are enabled <-- will try once I have time
-
hyc
ok cool
-
hyc
I guess we shoulf get gingeropolous and Snipa too
-
gingeropolous
whats this one gonna do?
-
gingeropolous
kinda don't wanna mess with xmrchain node, but if its for science, then.... FOR SCIENCE!
-
hyc
it should abort if any thread tries to write into the LMDB data files
-
hyc
except that it moves the LMDB filedescriptors so that the file should not get corrupted
-
hyc
Since Snipa had so many affected nodes, we might get the fastest result if he deploys it
-
hyc
but dunno what that would do to whatever depends on his nodes ...
-
rbrunner
Is the "pop blocks" functionality of "monero-blockchain-import" influenced by any other of the options of that tool? Or, on other words: What's the *fastest* way to drop blocks? I guess just that option, but you never know
-
moneromooo
If you want to pop a LOT, might be quicker to delete and sync up to what you want.
-
moneromooo
Popping's now slow due to the 100k median. Adding one is a cached special case that's fast, but removing one isn't.
-
rbrunner
I had the idea to repeatedly drop 10,000 blocks, from current top down to genesis, and sync 200 blocks at every 10,000 block stop, to get relative sync speeds depending on height.
-
rbrunner
I thought that's better than just downloading 70 gigs, maybe repeatedly. But dropping 10,000 blocks takes a surprising amount of time, several minutes inside my VM
-
rbrunner
(Better for my ISP and the Internet in general, I don't like to waste bandwidth.)
-
moneromooo
If you have the space, you can keep a copy of the chain maybe ?
-
moneromooo
Also, syncing 200 blocks is likely to not give good timings, too small a number.
-
moneromooo
Are you planning on including a table in monero that says "this portion takes about that much on my machine", and use that to guess at time remaining ?
-
rbrunner
More or less, but of course generalized, by using factors: "A post-RingCT block uses x time, a pre-RingCT block uses only x/2 time", "small 2015 blocks use only x/5 time" and so on
-
rbrunner
So the idea to sample at each 10,000 block, around 200 samples
-
rbrunner
And yes, I have a copy of the full blockchain, to easily repeat such experiments
-
rbrunner
By the way, does the following mean that I am heavy CPU-bottle-necked?: Synced 1930181/1980019 (97%, 49838 left) (71.919106 sec, 0.278090 blocks/sec), 100.355591 MB queued in 259 spans, stripe 8 -> 8
-
rbrunner
That queue gets longer and longer while I sync the 200 blocks
-
moneromooo
No. It could be disk.
-
iDunk
As long as it's not much over 100 MB in the queue, it's OK.
-
» iDunk shuts up
-
rbrunner
Anyway, my hope is tha
-
rbrunner
t my config does not matter that much to catch *relative* block processing speeds
-
rbrunner
I know that of course a ton of factors influence absolute sync speed, but that does not interest me here, I want speed differences, depending on where I am in the blockchain
-
iDunk
"If I sell you my computer, you will sync in x amount of time on it"
-
rbrunner
Future computer vendor advertising spiel? :)
-
iDunk
Woosh
-
rbrunner
I think I still may be out of luck with this method if one factor strongly dominates. If 95% of time goes to disk writes I won't be able to see CPU speed differences pre/post RingCT, or pre/post Bulletproofs ...
-
rbrunner
Which may matter on other peoples' systems
-
moneromooo
Do you have a tmpfs /tmp ?
-
moneromooo
Though I suppose it'd only help for the start of the chain ^_^
-
rbrunner
Yes I have, but only small ones, probably because of default install
-
kovri-slack2
<woodser> compiling easylogging++ for webassembly produces errors [1]. mymonero got around this by replacing easylogging++ with vtlogger [2] in misc_log_ex.h [3]. any reason we can’t do the same or similar in monero-project? [1]
paste.debian.net/1119053 [2]
github.com/mymonero/monero-core-cus…2b78a86e2cd716f4e8fd5f3375/vtlogger [3]
-
kovri-slack2
-
rbrunner
Why do you think syncing through 200 blocks gives no good average? What would need more blocks "to settle down" into some kind of long-time average?
-
endogenic
woodser yeah this is an example of one of those deps
-
endogenic
which must be extracted so others can use that code
-
endogenic
i'm excited for your work btw
-
moneromooo
Would fixing it instead not be much simpler, avoid rewriting a fair amount of monero code (unless this is the secret motive), and generally be more sensible ?
-
moneromooo
Is there another reason why you want to replace it ?
-
kovri-slack2
<woodser> my only motivation is to run in a webassembly environment
-
kovri-slack2
<woodser> I’ll spend some time trying to get the existing easylogging.cc to compile
-
moneromooo
Looking at the code, it just needs either (1) finding a getenv replacement or (2) returning an empty string.
-
kovri-slack2
<woodser> seems like a PR to replace it would be contained to adding the vtlogger directory and only modifying misc_log_ex.h
-
moneromooo
OK, sounds plausible. What are the vtlogger advantages (beyond "it works out of the box with webassembly" ?)
-
kovri-slack2
<woodser> maybe @endogenic knows more about vtlogger?
-
moneromooo
How do you compile monero in webassembly ?
-
kovri-slack2
<woodser> using emscripten
-
moneromooo
I was thinking more detailed. I've never done this before.
-
moneromooo
ie, if I was going to go fix what I can, how would I go about getting those errors myself ?
-
kovri-slack2
<woodser> one creates a CMakeLists file (e.g.
github.com/monero-ecosystem/monero-…ob/wasm53_after_send/CMakeLists.txt) which defines the linker flags to the emscripten compiler, emcc. My understanding is the emcc compiler basically wraps the normal compilation process to be compatible in webassembly
-
moneromooo
If I were to try to help fix building monero with this, it'd be of general usefulness, right ?
-
kovri-slack2
<woodser> It would.
-
moneromooo
Does emscripten have another name ? I don't find that name in fedora.
-
moneromooo
Oh I found webassembly. Must be that.
-
asymptotically
afaik emcc isn't in most distro repos because it uses the new webassembly target in llvm which only recently got released
-
moneromooo
Ah. Scratch VM then. Thanks.
-
moneromooo
vtlogger is LGPL. Not for us then.
-
zelest
What licence(s) do monero prefer?
-
moneromooo
BSD.
-
moneromooo
MIT also fine.
-
zelest
Now I love monero even more. :D
-
zelest
I still need to figure out how to compile it on OpenBSD though, as the readme instructions seems to be outdated/fail.
-
moneromooo
I dunno, I like GPL. It's like active defense instead of just curling up and taking punches.
-
zelest
Hehe, I believe in the idea in truely free software, as long as you credit the author. Not a lot of clauses where you can't do whatever you want with the code, that's not free. :/
-
moneromooo
They were replaced recently. Maybe the previous ones will work better :)
-
zelest
I'll give it a try once I have the time.. and if it needs fixing, I'll submit a PR :)
-
kovri-slack2
<woodser> some of the compile errors are due to the environment not being unix or windows, like this condition:
github.com/monero-project/monero/bl…ng%2B%2B/easylogging%2B%2B.cc#L1194
-
zelest
:o
-
zelest
In my case, I had some errors about some noexecheap flag
-
zelest
havn't had the time to look into it though
-
moneromooo
Seems even easier. Upstream's got emscripten support. I'll merge it.
-
moneromooo
-
moneromooo
Turned out to be pretty simple :)
-
hyc
you'll still fail when it comes time to compile RandomX
-
kovri-slack2
<woodser> that helps a lot. it is compiling but failing on linking elStorage.
-
moneromooo
Can still do wallet only.
-
kovri-slack2
<woodser> right, wallet only
-
moneromooo
Can you paste the error on some pastebin site ?
-
kovri-slack2
-
kovri-slack2
<woodser> wait I think I just need to add the source in the cmakelists
-
hyc
at this point, the wallet's pay-for-RPC feature also requires the PoW code
-
moneromooo
Heh, good point...
-
moneromooo
woodser: are you defining AUTO_INITIALIZE_EASYLOGGINGPP in your custom makefile ?
-
kovri-slack2
<woodser> nevermind easylogging.cc is already added as a source file
-
kovri-slack2
<woodser> no
-
moneromooo
Well, you should.
-
moneromooo
It's enough to define it just for easylogging++.cc.
-
moneromooo
(I think)
-
kovri-slack2
<woodser> that did the trick :)
-
bertptrs
Hey all, I'm looking into replacing epee for serialization in the RPC server (as it is macro-laden madness) and I'm currently looking at nlohmann/json. Would that theoretically be an acceptable replacement?
-
bertptrs
Pros: header only, C++11 compatible, serialization doesn't have to be in a header file, widely used and well tested
-
bertptrs
Cons: slightly more verbose than json_dto (which I previously suggested for the job), requires reimplementing the serialization
-
moneromooo
Is it faster ? Does it fix some bugs in the current one without adding more ? Other advantages ?
-
moneromooo
I'd also consider nice advantages: substantially decreases memory needed to build wallet2, and substantially speeds up the build.
-
bertptrs
Faster? Probably similar, but compilation may be faster since the headers will be smaller.
-
moneromooo
Can you give an indication (with the uderstanding that it's just on one particular machine) ?
-
bertptrs
You mean an indication of how much faster it would be to compile? Hard to tell without actually implementing it.
-
hyc
how is it both header-only and "serialization doesn't have to be in a header" ?
-
moneromooo
I guess it means the serialization of actual structures. I don't think epee requires that either, unless they're called from elsewhere.
-
bertptrs
hyc: the library itself is header only, but for serialization of custom types, you'd need to write code for that. But that part does not have to be in a header.
-
bertptrs
Or what moneromooo said
-
hyc
if it actually allows a significant amount of work to be moved into source files instead of header files, I'd be inclined to at least investigate it
-
hyc
right now you can't even build a debug windows binary on a 32bit machine any more
-
moneromooo
Hmm. I just thought of a way to split wallet2 without massive diffs.
-
vtnerd
bertptrs why that over rapidjson, which we already have checked into the codebase?
-
bertptrs
Other nice things would be: more idiomatic C++ so it's easier to read for newcomers (and veterans), no macros
-
vtnerd
macros are not the issue
-
moneromooo
Have new wallet2_1.cpp and wallet2.cpp that just include wallet2.cpp (which is removed from the build) with #define WALLET2_1 (or WALLET2_2), and exclude half wallet2.cpp based on the define ^_^
-
vtnerd
possibly the maze of c++, which can probably be simplified, are the issue
-
bertptrs
vtnerd: rapidjson is nice, but it using it for serialization is a bit verbose, which is (I think) you now use epee to reduce the repetition somewhat
-
bertptrs
-repeated it, + why after "which is"
-
vtnerd
rapidjson is not used within epee, it is completely custom
-
bertptrs
nlohmann/json could be used to replace both while having a similar interface
-
vtnerd
replace both? what do you mean?
-
moneromooo
Take out both epee's serializtion and the rapidjson code in wallet2 I think.
-
bertptrs
Correct.
-
bertptrs
rapidjson is not used within epee, it is completely custom < I'm looking something up about this, so I may be a little slow to reply
-
vtnerd
my first glance at this library is a nack
-
vtnerd
it should be possible to do stuff without wasting cycles on creating a DOM
-
hyc
sounds like it's aimed at web browsers then
-
moneromooo
Anyway, my view is "not unless advantages are found". "Header only" doesn't sound like one (and epee also is). "C++11" either, since epee also is. Being able to put serialization in .cc files, could be. Advantages I'd like are: faster exec, faster build, less memory hungry, fixes bugs while not adding more.
-
vtnerd
it should be possible to do this in the existing structure with some refactoring, but the read side is a bit tricky
-
moneromooo
Otherwise, it's just churn.
-
hyc
agreed
-
vtnerd
yeah moo, Ive been looking at all 3
-
moneromooo
FWIW, serialization load is starting to become noticeable in perf top in some cases.
-
vtnerd
the issue is that every json library allocates tons of memory, the unordered fields of an object are quite problematic for most interfaces/parsers
-
vtnerd
yeah I think I have a way to help with that, without much hassle
-
moneromooo
IIRC, fast to read/write was one of the draws to 0MQ as well.
-
moneromooo
Shame it's so different though.
-
vtnerd
you'll have to endue the "slice" object going into the reader so that many of the string copies become ref count changes
-
moneromooo
I'd be fine with that if it gives us a substantial speed boost.
-
vtnerd
it should, and it will be dead simple to measure at least
-
moneromooo
In fact, I did it (but I got snagged at needing C++14 for it to make a difference in practice)
-
vtnerd
hmm. you tried this in epee?
-
moneromooo
Yes. You NAKed that patch even :D
-
moneromooo
Because it ended up mostly churn since a copy was needed at the very end :(
-
moneromooo
(unless C++14)
-
bertptrs
vtnerd: It appears I was mistake I thought epees json serialization went through RapidJSON objects
-
moneromooo
That was in the std::map find IIRC
-
vtnerd
its merged with the custom binary format of the p2p
-
moneromooo
(and the NAK was a good decision, I might add)
-
vtnerd
ah right, the C++14 map lookup. I'll have to find that NAK then so I don't make the same mistake
-
vtnerd
were you using the non-owning "span" in the map?
-
vtnerd
no it had to be something else, span is an easy lookup
-
moneromooo
IIRC I made my own object which had optional memory backing.
-
moneromooo
Since it sometimes needed to. I'll find it.
-
vtnerd
yeah whats weird is that we are allocating temporary strings anyway sometimes
-
vtnerd
for those `get_value` calls
-
hyc
does any of this have any impact on the binary p2p serialization?
-
vtnerd
yes unfortunately
-
vtnerd
I mean it would improve it, but it touches the code sadly
-
hyc
ah
-
vtnerd
Ive tried to figure out a way around this, and you can improve it without touching p2p side
-
vtnerd
but you only reduce the temporary strings for the json values, not the keys themselves
-
moneromooo
-
moneromooo
See the last comment from you there about that last std::string ctor.
-
vtnerd
yeah, that interface gotcha is a pain
-
vtnerd
because its dead simple on the map implementation side
-
moneromooo
Anyway, I got to doing that because I found it in a profile IIRC. So speeding this up substantially would be an advantage.
-
vtnerd
this was merged though? did you revert?
-
moneromooo
There were two patches, the second one got merged only.
-
moneromooo
BTW I try to often add "substantially" to avoid "I can gain 0.1%, so let's rewrite it all" ^_^
-
vtnerd
hmm, I have an idea that will help a small bit (probably not substantial), but should also be an easy review
-
vtnerd
theres a few key places that should be moves instead of copies - the original code seems to be strictly C++03
-
hyc
-
hyc
so much for app stores being a trusted code provider
-
gingeropolous
uh oh, they are called "Chameleon apps"
-
hyc
yeah, so much for that name :P
-
gingeropolous
hyc, should I run debug for that patch?
-
gingeropolous
why am i even asking.
-
moneromooo
Yes please.
-
moneromooo
The assert will generate no code if not a debug build.
-
hyc
sorry looks like my connection dropped for a bit. gingeropolous did I miss anything?
-
selsta
hyc: ok running debug monerod in lldb now with your patch
-
gingeropolous
nope, just me asking stupid questions
-
selsta
I guess now we have to wait :P
-
hyc
yeah, now we wait
-
moneromooo
woodser: I have a sinking feeling I need to build all the deps myself. Boost, openssl, etc. Am I correct ?
-
hyc
and there's no guarantee that it will trip
-
moneromooo
If so, where does it stop ? syscalls ?
-
gingeropolous
in an effort to increase the number of stderror writes im using set_log 4. is this logical?
-
hyc
gingeropolous: probably will have no effect
-
hyc
pretty sure it's only error logs directly from libunbound
-
gingeropolous
ah
-
hyc
but ... all guesswork
-
luigi1111w
wallet is claiming two inputs are from the same transaction even though none of the blocks are the same right above that
-
moneromooo
Details ?
-
luigi1111w
Warning: Some input keys being spent are from the same transaction, which can break the anonymity of ring signature. Make sure this is intentional!
-
luigi1111w
that warning
-
luigi1111w
you want txid or what details?
-
moneromooo
Let me look at the code for that message first.
-
moneromooo
Yes, please paste me all the info you have on that.
-
luigi1111w
it comes up on every transaction so far
-
moneromooo
-
luigi1111w
hmm
-
luigi1111w
I have another funky thing: it looks like one of the random outs in another tx was pulled from at least the same block (if not the same tx); both are market with * as being the real out
-
luigi1111w
marked*
-
moneromooo
The * is based on height IIRC.
-
moneromooo
Guess having two * increases the uncertainty about the real input ^_^
-
luigi1111w
makes sense; should be a rare side effect
-
luigi1111w
haha
-
luigi1111w
even the sender doesn't know!
-
moneromooo
Indeed based on height, I found the code.