-
moneromooo
woodser: does this work ? Looks like in the end it's all that ought to be needed for mlock:
paste.debian.net/hidden/4c51cad5
-
kovri-slack2
<woodser> @moneromooo the patch does not prevent what is commented out in this diff from executing, and so still hangs
-
kovri-slack2
-
moneromooo
Get me an all thread stack trace please.
-
moneromooo
Hrm. Can you actually do that with js ?
-
kovri-slack2
<woodser> that would be really nice but I do not know how to do that from js to webassembly
-
kovri-slack2
<woodser> I will research
-
moneromooo
I guess we can define out pretty much everything, but if possible I'd prefer to understand where it's hanging.
-
moneromooo
mlock is undefined on windows, and that one doesn't hang AFAIK.
-
kovri-slack2
<woodser> I recall from building and debugging that CRITICAL_REGION_LOCAL seemed to be the problem point
-
moneromooo
Did you change that ?
-
kovri-slack2
<woodser> yes
-
moneromooo
Did you change anything else ?
-
kovri-slack2
<woodser> yes. all changes to mlocker.cpp are in the diff I linked
-
moneromooo
What you linked doesn't include any changes to CRITICAL_REGION_LOCAL.
-
moneromooo
So you didn't change it, you just commented out the calls to it ?
-
kovri-slack2
<woodser> right
-
moneromooo
Plenty of other places in monero use it. Do they hang ?
-
kovri-slack2
<woodser> none of the others have needed to be commented out, but I’m also not using the included the http client, so I’m not certain it’s being called elsewhere
-
moneromooo
Or you can try replacing :mutex with :recursive_mutex in: static boost::mutex *vmutex = new boost::mutex(); in: contrib/epee/src/mlocker.cpp
-
moneromooo
The code looks right wrt recursion though.
-
kovri-slack2
<woodser> still locks
-
moneromooo
Another way if you can't get a stack trace is to modify the macro to print the file/line where the calls happens alog with the calling thread, *both* before and after the lock call, and in the object dtor (with thread too).
-
kovri-slack2
<woodser> how should I print the calling thread?
-
kovri-slack2
<woodser> you mean print the caller before calling it, or is there a way to access the thread info to print?
-
moneromooo
Print the line number from the macro (__LINE__) in the ctor. For the thread id, you're on your own.
-
moneromooo
Oh, easylogging.cc will have it, since it uses it and supports emscripten.
-
moneromooo
Hmm, looks like std::this_thread::get_id(); might work.
-
kovri-slack2
<woodser> it hangs on the call to CRITICAL_REGION_LOCAL(mutex()) in get_page_size() which is called from lock()
-
kovri-slack2
-
moneromooo
Can you paste the output ?
-
kovri-slack2
<woodser> what object constructor should output be printed from?
-
moneromooo
critical_region_t
-
moneromooo
__LINE__ should be in the macro itself, not the ctor.
-
kovri-slack2
-
moneromooo
The very first call hangs ? WTF.
-
kovri-slack2
<woodser> yeah
-
moneromooo
That points to boost or emscripten being buggy.
-
moneromooo
Or my code being buggy in a way I've not figured out yet :)
-
moneromooo
The mutex is returned as a ref to a static. I don't think anything else does that.
-
kovri-slack2
<woodser> I’m only building with boost system, thread, and chrono
-
moneromooo
It returns from the sleep, right ? It's an old debug thing (and is meant to sleep for 0 unless debugging).
-
kovri-slack2
<woodser> it doesn’t return from sleep
-
kovri-slack2
<woodser> I have a warning: undefined symbol: _ZN5boost24scoped_static_mutex_lockC1ERNS_12static_mutexEb
-
kovri-slack2
<woodser> it could be something with my setup
-
moneromooo
That looks like it should be an error, unless it's doing weak linkage and it gets resolved later. Looks weird to me anyway.
-
kovri-slack2
<woodser> emscripten is configured to not fail on undefined symbols
-
moneromooo
What does it do it undefined ? Leave the ref to point to some random memory ?
-
kovri-slack2
<woodser> I’ve seen runtime errors when it hits an undefined symbol
-
kovri-slack2
<woodser> with a helpful error message saying something to the effect
-
kovri-slack2
<woodser> linking to boost_regex resolved the warning but not the hanging issue. err and errx are the only undefined symbol warnings now
-
moneromooo
Hmm. These are esoteric libc routines.
-
kovri-slack2
<woodser> perhaps multithreading needs to be enabled using pthreads
-
kovri-slack2
<woodser> I’ll experiment more with that. it’s part of emscripten’s build process
-
moneromooo
monero definitely needs multithreading to work.
-
hyc
monero-blockchain-prune running for over 3 hours now on my geekbox. 2GB RAM, microSD cards. def not an ideal setting.
-
moneromooo
It's probably running lmdb with bad settings, it's been repotred to be pretty slow before.
-
hyc
well, the SDcard appears to be maxed out reading at 15MB/s so that can't e helping
-
hyc
it's just a slow machine
-
hyc
I think this SDcard is a few years old. could probably swap in a newer faster one
-
hyc
seems to me we shouldn't be seeing "LMDB Mapsize increased" in this tool. you know the size of the original blockchain. could just pick a new size that's 40% of that.
-
hyc
anyway that's a minor poitn, not a huge perf impact