13:50:31 richlowe: I'm seeing stacks similar to illumos#14722 on a platform which should include that fix, do you want me to comment on the original bug or open a new one? 16:42:43 jperkin: I'd probably suggest opening a new bug. 16:45:42 ok 16:46:27 Mostly because if there is a problem, we'll want a new bug to describe it anyways. 16:56:18 rmustacc: 16 512-bit ZMM registers 16:56:21 heh, actually, 32 16:57:12 I am a bit worried there are still some bugs in the kernel FPU path, though. The parity calculations in ZFS have been utilizing this for a while, haven't they? 17:12:17 KungFuJesus: are you referring to my comment on 15254? 17:12:44 And when you say the kernel fpu path, what do you actually mean? 17:27:15 yes, and I mean the kernel corrupting userspace's register state for ymm* 17:27:20 and zmm* I guess 17:32:23 KungFuJesus: Because the kernel is using the FPU or something else? 17:32:28 Do you have anything more for me to go on? 17:32:59 The signal handling issue is a serious one that I'm trying to get turned around and solved. 18:32:33 jperkin: do you have the objects etc? 18:39:12 jperkin: bugger-ld or whatever would help 18:40:05 jperkin: you could also check `strings libld.so.4 | grep 'Link Editor'` to be sure you got both bits at the right version. 18:49:38 jperkin: Can you also try running elftest and tell me if the tests I added fail? 19:41:43 ah yeh, lemme get a bugger-ld run 19:43:23 rmustacc: sorry, went and grabbed lunch. I'm only surmising what that bug report already claims 19:43:49 jperkin: super interested in the test run too 19:44:06 your analysis does indicate that it's an issue relegated to signal handling, so perhaps that's not the biggest bug surface 19:44:08 the bits from that bug I have here work. 19:44:24 KungFuJesus: you're making a limited amount of sense, I think you missed what is affected and how. 19:44:53 the problem is that when a user process takes a signal, its avx state isn't saved so if the signal handler uses avx that state is corrupt when we return from the signal. 19:45:11 nothing in the kernel, except that that's where signals are implemented. 19:45:18 Perhaps? My understanding is that the kernel is corrupting the state of the FPU when the kernel context switches out of a signal interrupt 19:45:57 meaning, the FPU state is not properly restored after the kernel clobbers those vector registers 19:47:09 Now from what I understand, this only happens in the scenario that the kernel makes use of those registers, which is limited to the very limited use case where the kernel does hardware floating point math (almost never), or needs to use the vector registers (e.g. SIMD vectorized parity calculations, AES-NI for crypto, etc) 19:48:30 no, the kernel isn't clobbering them because it's using them 19:48:38 it's clobbering them because the _user signal handler_ is using them. 19:48:48 they're not being actively corrupted, they're being passively not saved when they should be 19:48:53 ooof, I see 19:49:35 this is similar to say, addressing an xmm register is a ymm register, where the upper half is going to be undefined 19:49:39 I've been bit by that one, before 19:49:45 as a* 19:54:49 Yes, none of this is due to kernel use. It requires a rather exacting combination of things. 19:55:18 well that's at least a good limited surface area for the bug, anyway 19:55:37 After a fashion, I guess. 19:56:12 It's true it can always be worse, but I don't feel good about what appears to a user program as arbitrary data corruption and that's why I'm trying to write up how it gets fixed, the nuances, and the challenges. 19:58:05 but yeah, so the hazard is something like user program context switches, kernel runs proper xsave to dump register state to stack, user program sends signal, signal handling logic calls older fxsave or equivalent behavior, leaving half of the vectore register state on the stack as undefined 19:58:22 No. 19:58:35 It is not that. 19:58:41 richlowe: bugger-ld tarball posted to the issue, stupid elftests question, can I just run them in an illumos-gate checkout on a non-build machine? 19:59:32 you don't need a build machine, you don't need an illumos checkout, you need the package and the test runner. It defaults to testing /bin/ld 19:59:51 oh, and a compiler/assembler. 20:00:01 FWIW, all passing for me right now. 20:00:08 me too 20:00:12 where do I find them then? 20:00:29 In smartos land they're in the proto area, but not in the ramdisk. 20:00:35 I don't actually know smartos-ishly, danmcd do you make this convenient? 20:00:58 jperkin: /opt/elf-tests and /opt/test-runner, conventionally 20:01:00 I already have an illumos-gate checkout on the host, just wondering if I can run them from there 20:01:01 and in the proto 20:01:19 jperkin: Maybe if you lofs mount it into /opt 20:01:28 I have been known to link the proto area copy into /opt 20:01:37 I don't know if it'll run outside of there, because of test-runner stuff 20:02:04 I'll pull your tarball down when this build/test cycle for another thing is finished 20:02:13 I'm sorry I seem to have screwed it up somehow. 20:03:28 don't take this as any indication that things were fine before and now they're breaking, it's just that I only now actually have time to start filing bugs for stuff that previously I'd have just rm /cores/* ;) 20:06:26 no, but it means the fix was incomplete or bad. 20:09:26 KungFuJesus: The kernel is only saving an fxsave state and retreiving it across the signal handler. It uses that to update the xsave state. So it the upper register state is well defined to be whatever was in the FPU. So if the signal handler doesn't use it, it'll not be touched. 20:11:34 jperkin: this might be a different bug that crashes in a similar place 20:11:44 and/or a bug I introduced fixing the other 20:28:54 since this is rust, has anyone else seen this? 20:28:58 oxide people? 20:30:28 jperkin: so I have suspicions, but I don't know why an entire company isn't shouting at me about this if I'm right :\ 20:32:18 jclulow: Do you know how to influence the flags rustc passes to ld? 20:32:19 so looking at the other cores the others are from rust programs too (devel/git-cliff, www/zola), still looking to see if there are others.. 20:32:37 jperkin: right, I don't see why this isn't making oxide _real_ angry 20:32:41 which is interesting in its own right 20:33:01 jperkin: I want you to try something for me, but I don't know what that something is 20:33:14 but there are also hundreds of other rust programs that build fine.. 20:33:51 jperkin: see dm 20:33:56 richlowe: A lot of it is pretty hard-coded I believe in the target type 20:34:10 jclulow: well I tihnk I know what's happening here, but I don't know why it's not happening to you 20:36:23 jclulow: can I ask you questions about how y'all build stuff, or are you busy? 20:36:39 I'm always pretty busy haha but fire away 20:48:12 (richlowe: SOrry I've been away... if you need something built on SmartOS I'm here-ish now, modulo me upgrading Kebecloud to the Triton update we cut last night.) 20:49:33 I believe, rich, you need to be in a zone that can build smartos-live to do what you wish. 20:49:37 (/bin/ld is there, e.g.) 21:11:04 it feels like the only real path to a fix in finite time is a bit shit 21:37:27 at least I have a fix for pkgsrc, with the added benefit of ensuring rust stuff has CTF now 21:38:33 What do you mean there? 21:39:03 Are you generating a subste of rust types as CTF or something where stuff with things partially built from rust has problems. 21:39:47 removing -Wl,--strip-all avoids the ld bug and ensures I can ctfconvert stuff before pkgsrc does its own strip handling 21:40:11 Ah, gotcha. 21:42:31 jperkin: I can give you a fix to try in a little bit too 21:42:56 sure, though will definitely be tomorrow now, nearly zzz 21:43:04 same, I have to stop typing soon 21:43:15 _a_ fix is easy, convincing someone to approve it might not be 21:43:58 rmustacc: if you're playing along at home this is #15260 (fenix?) 21:43:59 BUG 15260: ld segfault similar to 14722 (New) 21:44:00 ↳ https://www.illumos.org/issues/15260 21:46:47 Oh. That's going to be a thing. 21:46:59 I will try to carve out some thoughts after I get through this fpu write up. 21:48:11 luckily, it appears to only happen if you explicit configure a rust profile with strip=true, or otherwise use ld -s 21:54:59 tsoome: replied again about cw, you might want to try to attract some attention that isn't me, too :) 21:55:11 I'm much more open to "in a followup" than other people might be 21:58:49 richlowe, tsoome: Is there something you'd like me to look at? 21:59:24 rmustacc absolutely. https://code.illumos.org/c/illumos-gate/+/2541 21:59:25 → CODE REVIEW 2541: 15230 cw: add support for clang (NEW) | https://www.illumos.org/issues/15230 21:59:58 OK. Can you add me to it? It might take me a bit to get there as this fpu issues is... gnarly. 22:02:13 I'll add some background to issue too -- this feature would just be there to make it possible for people to start poking clang -- and I still need to push some tools patches too to make it even remotely possible:D 22:02:40 richlowe that followup sounds really reasonable, however. 22:03:00 be it real followup, or just update to this patch:) 22:06:51 jperkin: sent you the branch and binaries to try out 22:07:30 if anyone doesn't like the awful conservative approach, I look forward to them trying to untangle what is less conservative but also provably safe 22:07:32 because I sure can't. 23:40:01 commenting on mastodon (subtooting?) is an acceptable way to let you know your proc(1) man page is missing some proc tools, right? https://fosstodon.org/@alanc/109520277885645860 23:50:02 [illumos-gate] 15207 libfmd_agent: memory leak in fmd_agent_nvl_ioctl -- Yuri Pankov