00:28:58 afungible[m]: we looked into the issue a while ago, it's unclear if this is a bug in RandomX code or not, hyc and sech1 think it's a bug in macOS SDK 00:29:27 it looks like the cache doesn't get invalidated but we do call `sys_icache_invalidate` as explained here: https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon 00:29:59 it worked fine before macOS 13 00:31:39 there's also no segfault at a specific place, since it's cache / JIT related the crash always happens at a different place 00:35:29 I've begun to think it never crashed with the old SDK because building with the OLD SDK just always disables the new API feature 00:35:52 so even on newer Macs it always uses the old code 04:15:27 "KDF must be resistant to..." <- Right, hence the “multiple rounds” I mentioned. It seems like it would be slightly easier to screw up key derivation when mishmashing a bunch of hash functions together instead of applying one known very secure fast hash function over and over again, which is quite a common practice. 07:56:06 "there's also no segfault at a..." <- Thanks for the explanation. It could be that it uses the same internal API call at different points in the code, reason it crashes at different places points. Then we'd want to find which API that might be. Just a guess. 08:50:38 hyc selsta I just realized the current RandomX code doesn't follow Apple's docs strictly: https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon - sys_icache_invalidate() must be called _after_ pthread_jit_write_protect_np and we do it _before_ 08:50:46 hyc can you check if it fixes the issue? 08:57:09 by the way, XMRig does it in the correct order: https://github.com/xmrig/xmrig/blob/master/src/crypto/common/VirtualMemory_unix.cpp#L113 09:47:49 wait, RandomX master branch doesn't even call sys_icache_invalidate() anywhere, lol 09:54:42 @hyc https://github.com/tevador/RandomX/pull/259 10:36:29 I'll try it 10:50:40 sech1: we use the gcc __builtin___clear_cache() which calls sys_icache_invalidate() on MacOS 10:55:28 same in clang https://codebrowser.dev/llvm/compiler-rt/lib/builtins/clear_cache.c.html 10:56:57 yes, but it was called in the wrong place 10:59:44 I have the same issue with p2pool, let's see if he replies: https://github.com/SChernykh/p2pool/issues/217 11:03:01 sech1: xmrig master still crashes 11:03:16 I don't recall ever reproducing the problem locally. randomx-benchmark works here on master 11:03:17 damn apple 11:03:21 so it's not only the correct order 11:03:31 hyc: you have to update to macOS 13 11:04:05 ah. I'm on 12.0.1 11:05:57 in any case, that sys_icache_invalidate() must be there according to Apple's own docs 11:06:04 so this PR makes sense 11:06:24 we can put all blame on Apple after this :P 18:15:53 I have collected these miscellaneous functions in my seraphis library and don't know where to put them: https://github.com/UkoeHB/monero/blob/seraphis_lib/src/seraphis_crypto/sp_misc_utils.h . Any suggestions? Just leave it where it is? It can't go in `src/seraphis` because the dependency goes `misc utils -> src/seraphis_crypto -> src/seraphis`. 18:21:22 Also, I'm planning to start PR-ing stuff out of my seraphis lib to trim it down. The PRs will build off each other but won't impact any production code, so the PR stuff will look 'dead' until seraphis is fully online (except some multisig stuff could be used to improve existing multisig - mainly key image proofs). So now is the time to decide whether to go all-in on seraphis and allow changes to master. 18:23:13 For a preview, my initial PRs are looking to be: blake2b, x25519, twofish, crypto/generators.*, sp_transcript, sp_hash_functions, sp_generator_factory, sp_crypto_utils, sp_misc_utils, dual base vector proof (for multisig stuff), a bunch of multisig utilities (these will take ages to get reviewed, best to start asap) 18:28:13 Basically if no one stops me, I will start making PRs lol 18:31:57 Make those before someone can stop you :) 18:33:38 lol gotcha 21:53:34 UkoeHB: Where will your pull requests be to look at? 21:54:55 on the main repo? 21:56:02 Thanks 22:06:45 selsta: https://github.com/actions/runner-images/issues/6002