05:57:26 andyf do you know why we get those *.o.s files in usr/src/test/bhyve-tests/tests/inst_emul ? 05:57:43 or pmooney ? 13:19:16 tsoome - I don't think I've seen any .o.s files 13:19:28 hm, interesting... 13:19:51 just checking some build trees 13:20:23 https://paste.ec/paste/9rmNRCQI#cJvAmn+rBUbhjDBW0IODeKO0XVUQycP8k74bpwcgJiw 13:22:51 mine were created oct 3rd. well. no idea then:) 14:16:07 tsoome: I don't see files like that either 14:16:37 truth be told, it was kind of tricky to get the wildcard rules right to compile those tests properly 15:10:12 i've not found anything obvious (but there's enough code I might have missed it) -- is there an easy way to force a mac ring to poll (for testing)? 16:01:20 Great to see some people still use IRC :). I'm trying to cross-compile Illumos for aarch64/risc-v and have encountered a problem with the cross-build lex (following the instructions at https://github.com/n-hys/illumos-gate/wiki#building). I'm trying to cross-build on Ubuntu (20.04.4 LTS or 22.04 on x86-64). The cross "lex" crashes in l.344 in 16:01:20 parser.y when lexing .../cross/src/geniconvtbl/itm_comp.l – the code in parser.y seems a bit suspicious? 16:01:21 p = (CHR *)c; 16:01:21 free(p); 16:01:22 Did one of you encounter a similar problem? I could work around this by using the native Ubuntu byacc/flex (with a number of hacks due to different data types for yacc), but that's obviously less than ideal... 16:01:58 Btw., is anyone working on a port to either Apple M1/M2 or Ampere Altra aarch64 systems? 16:04:23 (not sure if a quick intro is common here for newcomers, please let me know if you're interested...) 16:18:33 pmooney it really does smell like artefact from some manual run of make... 16:19:15 I thought so, too, but I did a fresh checkout of the source and tried on two different machines... 16:20:13 MichaelEngel I did not see the crash last time I was building it. 16:21:16 MichaelEngel atm not working on hw support, this whole thing needs a lot of work to get it actually usable. 16:25:07 The port to the Allwinner D1 RISC-V/Nezha works amazingly well (but I didn't try to run large jobs on the machine) 16:25:14 MichaelEngel I'm seeing random crashes on qemu atm (I suspect that reading cpu freq can return bogus data on qemu) 16:25:38 for aarch64, that is. 16:26:06 Right, haven't tried aarch64 so far, that was the next step. Wanted to get the cross-compile to work cleanly first :) 16:26:47 ah, that crash was with RISC-V? there it may get into alignment restrictions 16:30:55 The crash was with the lex that is used to cross-build the system, so the crashing lex is a native x86-64 Linux ELF (built from Solaris sources in illumos-gate/usr/src/cross/src/lex) that is built in the cross-building process. It crashes while lexing geniconvtbl/itm_comp.l (or I completely misunderstood how the cross-compile process works, but I 16:30:55 don't think so...) 16:33:58 do you have pstack core ? 16:34:30 err, that linux... so gdb and bt from that core 16:37:41 Whoops, network fail. 16:38:21 MichaelEngel so gdb and bt from that core 16:38:38 Yep, have to add -g to the makefile to get useful output 16:40:13 (gdb) run ../geniconvtbl/itm_comp.l 16:40:13 Starting program: /home/me/Projects/solaris/illumos-gate/usr/src/cross/src/lex/lex ../geniconvtbl/itm_comp.l 16:40:14 [Thread debugging using libthread_db enabled] 16:40:14 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 16:40:15 Program received signal SIGSEGV, Segmentation fault. 16:40:15 0x00007ffff7e1347e in __GI___libc_free (mem=0x555b5bd0) at ./malloc/malloc.c:3368 16:40:16 3368 ./malloc/malloc.c: No such file or directory. 16:40:16 (gdb) bt 16:40:17 #0 0x00007ffff7e1347e in __GI___libc_free (mem=0x555b5bd0) 16:40:17     at ./malloc/malloc.c:3368 16:40:18 #1 0x000055555555df29 in yylex () 16:40:18     at /home/me/Projects/solaris/illumos-gate/usr/src/cross/src/lex/parser.y:344 16:40:19 #2 0x0000555555560582 in yyparse () 16:40:19     at /home/me/Projects/solaris/illumos-gate/usr/src/cross/lib/yaccpar:299 16:40:20 pastebin:) 16:40:27 Argh, sorry, yep 16:41:05 https://pastebin.com/siyGrZgz 16:42:27 parser.y line 344 is the strange free of the pointer p that was assigned in the line before this to p = (CHR *)c; – removing the call to free results in a later crash somewhere else in the lex code... 16:44:15 The lex file that is processed is this one – https://github.com/n-hys/illumos-gate/blob/osport/v2021.07/usr/src/cross/src/geniconvtbl/itm_comp.l 16:48:21 that parse.y line 344 is weird, but I do not see why it should crash... 16:48:36 that is, it does allocate memory and free it.... 16:49:27 myalloc() is calloc() with little warning added. 16:50:18 it is possible, something else is rotten in heap. 16:51:03 ou 16:51:05 ou 16:51:06 I think so. When commenting out the free (or the malloc...free lines), lex crashed in slength. https://pastebin.com/LgyQyqeY 16:53:43 c = (int)myalloc(i,1); by itself is interesting, because c is not pointer, but CHR, so this code is not 64bit safe (hope it is building 32-bit) 16:54:11 Nope, it builds a 64 bit binary... 16:54:17 ;) 16:54:39 so, your 64-bit pointer is cut to 32-bit. 16:54:51 ouch :) 16:54:55 or even less, depening on size of CHR 16:55:04 I'll try building with -m32 first 16:55:39 lex in illumos is built 32-bit 16:56:28 hm, CHR is either char or wchar_t 16:56:54 what the h- 16:57:00 I did not want to see that code:D 16:57:52 It smells a bit rotten :) 16:58:29 I'm not really sure why does not it crash even as 32-bit x86. optimized out maybe? 16:59:16 Might be. I'll see if I can get the lex to compile as 32-bit binary, but I have to find the missing deb packages for the 32 bit libs first... 16:59:38 tsoome: that looks wrong in all sorts of ways 16:59:48 pmooney yep:) 16:59:48 good find, though 17:00:37 shocking that compiler updates didn't turn this into some flavor of UB weirdness 17:01:56 Ok, of course lex needs a liby to build, so I have to build a 32 bit yacc... 17:09:35 A 32 bit lex (built with a 32 bit liby.a) built with gcc-9 (gcc-11 was unable to find the 32 bit crt*.o files...) works. Whow. 17:09:49 in any case it seeme that useless myalloc + free can be dropped 17:14:52 for a starter, I'd suggest to build lex without all of those -W-no-* switches:D 17:18:05 It's amazing that the lex source isn't 64 bit clean... I remember buying our first 64 bit UltraSPARC 1 in late 1995. But, of course, Solaris 2.5.1 wasn't 64 bit back then :) 17:19:00 large portion of userspace is 32-bit 17:19:19 thats the curse of having mixed 32/64 bit support. 17:20:34 Yep, I never noticed this even though I ran Solaris for more than a decade on Sparc and x86... back to SunOS 4 where everything is nice and easy, I guess :D  (still have my trusty old 3/60 sitting in a corner) 17:21:45 eh... 17:24:32 So I'm always looking for OS-related projects for my students here (Bamberg University in Germany) and working on Solaris would be a nice exercise. We have some M1/M2 aarch64 Macs here and will hopefully receive some HPE Proliant Ampere servers soon. Both would be nice platforms for Illumos, I think. By coincidence, I'm also looking for a PhD 17:24:33 student :) 17:26:36 [illumos-gate] 15054 libc: using the result of an assignment as a condition without parentheses -- Toomas Soome 17:30:29 Considering how long I did my MSc, I should not consider PhD:D 17:32:09 Oh well, I also studied for far too many years... well, I'm still at a university 30 years later, not sure if this is progress :) 17:32:23 but for example the same 32 to 64 bit transitions could be nice student projects 17:32:44 But we had lots of fun with all sorts of crazy Unix machines in the '90s, you could learn so much. 17:35:04 The 32/64 bit bugs might also be a good starting point to introduce the students to tools for static code analysis. 17:35:08 I was in uni for quite some time, but eventually had to start to earn some... :) 17:37:40 OK, now there's a strange yacc-related error when building dtrace, but that will have to wait until tomorrow. Need to finish my lecture slides for tomorrow :) 17:37:48 Thanks a lot for all your help! 17:39:56 yw. what lecture it would be?:) 17:41:17 This semester it's a course on virtualization, tomorrow's lecture is on CPU emulation from interpreter to static/dynamic binary translation. The course covers all levels of virtualization from CPU (e.g. Transmeta) over system level to high-level VMs (e.g. for Java or Webassembly). 17:41:33 I see. 17:43:29 [illumos-gate] 15005 Tests for btree implementation used by range trees -- John Wren Kennedy 17:48:46 We have an OS engineering course in the summer term where students build their own little preemptive multitasking RISC-V OS from scratch. This is also a lot of fun. 17:49:34 nice 17:53:04 [illumos-gate] 15093 SMB error after Win10 tries FSCTL_PIPE_WAIT -- Gordon Ross 17:54:08 MichaelEngel: M1/M2 and Ampere are two different beasts. The built bootfiles I made for Qemu run on Ampere if you can find a passable bootloader or get loader compiled for UEFI mode on aarch64 17:55:17 As for the M1 you will need a custom bootloader chain to conform to apple boot I think the Asahi Linux installer creates a chain that is UEFI compatible and then you can chain to loader but if not you will need to make a custom bootloader for the M1 17:57:02 toasterson: yes, I know they are quite a bit different – more work for my students :). I'll try the Ampere stuff as soon as I receive the hardware, for the M1 I will check out the OpenBSD code (7.2 supports all M1/M2 models), though I think they also rely on the Asahi Linux bootloader. 17:57:06 yeah, lex isn't clean, and also isn't _clean_ 18:00:53 I assume the Illumos lex is derived from the old SVR4 version and not (closely) related to bison or Berkeley yacc? 18:01:18 it's not related to flex, it might be related to berkeley lex 18:01:22 but I don't know 18:01:28 it certainly has the structure of something from new jersey 18:03:49 if you're not wanting to fix it for fun, you might want to wait until the native cross-build works? 18:03:55 what a weird sentence 18:04:00 "the cross-build from another illumos platform" 18:04:31 Modifying the makefiles to build yacc and lex as 32 bit seems to be a workaround that's good enough for now. 18:04:54 well, I missed what your goal is, to be honest. 18:05:14 but a "proper" illumos build of aarch64 is something very much actively work in progress right now among some folks 18:05:34 Another bug that showed up is that a SIGSTKSZ was included in a list of signals by accident, this patch fixes it. https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=39d53d04357606a15efd400147fa7369d71baf2c;hp=46039d3632e32d9a404c1f18cf55f14c894e4627 18:06:09 Yeah, I read that the native linker seems to be a roadblock right now? 18:06:27 The port of that is probably 95% complete. 18:07:59 I haven't implemented thread-local storage just yet, because only a couple of things need it and they're not themselves needed just yet 18:08:09 the _major_ pain in the ass is libm 18:27:04 maths is hard 18:56:39 I don't know if it's hard, or I'm bad at it, but yes. 18:56:43 the code is also very bad. 18:56:50 and the only quad code we have is big endian 18:56:56 and also... uh, optimized circa the 90s 18:57:43 so it's a mix of math I can't do myself, implemented confusingly 18:58:34 but things are going pretty well toward a target of "being illumos-y" so people can help 19:00:04 and it's keeping me away from debating whether modifying compilers is a priori a bad thing 19:00:08 so that's a great feature 20:09:42 [illumos-gate] 15068 diskinfo crash in nvlist_free() -- Andy Fiddaman 20:12:10 richlowe: I can debate that for you :) 20:14:03 On another topic. Can somebody give me some instructions on disassembling the instruction that generated the trap for #15088 !fenix 20:14:04 BUG 15088: Kernel panic in TUN device unvailable when mounting NFS share over tailscale TUN network (New) 20:14:04 ↳ https://www.illumos.org/issues/15088 20:14:44
/i or ::dis 20:15:32 so tun_frame+211/i will give you just that instruction, or you could disassemble all of tun_frame with tun_frame::dis and get some context 20:15:58 so open the core with mdb -> fffffe000f13aa60/i ? 20:16:33 no, that's the stack frame 20:16:43 literally 'tun_frame+211/i' 20:17:14 so that give something like `tun_frame+0x211:movdqa (%rsi),%xmm0` 20:17:35 is that what would help? Or you think some more would be nice? 20:17:57 I'd dissassemble the whole function, but if it's actually using SSE like that implies that's definitely going to go wrong 20:18:20 but hopefully I spaced on something and gave you bad info 20:18:57 but it does look like it's using SSE and probably got built with -mno-sse etc, etc, etc. 20:19:05 see STAND_FLAGS in usr/src/Makefile.master 20:19:27 built _without_ -mno-sse etc 20:21:49 (I'm not saying that's why it's crashing, but it's certainly pretty suspicious) 20:21:50 Ok, added the info. Thanks for the tutorial :) 20:24:28 The options that omnios uses for building it are here, if that helps: https://github.com/citrus-it/omnios-build/blob/master/build/tuntap/build.sh#L32 20:28:49 oh, right thats a userland module........ brb 20:29:16 also if you type exit in mdb it shows me the dissasembled output XD 20:29:39 $q quits (if you're in kmdb, it may also reboot) 20:29:59 if you type an address like 'exit', without a command, it runs the last command on the new address 20:30:05 a great and exciting way to absolutely hose yourself by mistake :) 20:33:12 thankfully I was in a core :) 20:57:06 hmmm `'-mindirect-branch=thunk-extern' and '-mcmodel=large' are not compatible` 20:57:35 mcmodel should be kernel no? 20:59:05 hmmm it gets set somewhere.... 21:00:08 ah, i also need patches... 21:04:40 andyf: from where are you getting your tuntap package sources from? 21:05:38 we get ours from github.com/kaizawa/tuntap 21:05:41 -mcmodel=kernel for the kernel on i86 yes 21:06:20 your flags should be exactly what you see from STAND_FLAGS (in Makefile.master), and the addenda in Makefile.uts 21:06:28 It will be from https://mirrors.omnios.org/tuntap/ 21:06:31 or you're going to have weirdness 21:17:16 richlowe: is `-Wu,-save_args` gcc related? 21:17:40 it's Sun Studio option, cw translates it to -msave-args 21:20:24 ok, so `-msave-args` is also needed for illumos-gate 21:54:38 ok, so far stable with the right CFLAGS 21:54:49 thanks for the pointers 23:53:56 [illumos-gate] 15118 bhyve too strict over vmm_data lengths -- Patrick Mooney