IRC channel logs
2026-06-27.log
back to list of logs
<damo22>solid_black: do you have time to help investigate the last failing test on user32? <damo22> "gnumach-test-failure MIG_TYPE_ERROR (0xfffffed4): host_get_time64" for test-mach_host <damo22>i think i may have found a bug in the ci <damo22>youpi: does mig need to install any headers or does it just create the mig binary? <damo22>for example, can i install mig32 into the same prefix as mig64? <youpi>afaik mig doesn't install headers <diegonc>Remote debugging using 127.0.0.1:1234 <diegonc>warning: Selected architecture i386 is not compatible with reported target architecture i386:x86-64 <diegonc>warning: Architecture rejected target-supplied description <diegonc>Remote 'g' packet reply is too long (expected 312 bytes, got 608 bytes): <diegonc>i get that messages trying to debug gnumach with gdb <diegonc>do i need some special gdb for user32? <damo22>i have had to close my CI browser to the public <diegonc>yeah, the module-mach_host file is a 32-bit ELF but gnumach is 64-bit <diegonc>seems ok, but I could have messed the building steps :/ <damo22>see the .forgejo/workflows/action.yaml for build steps <damo22>i wonder do we need to install i386 headers specifically to build mig32? <damo22>or are the gnumach headers agnostic to that <diegonc>ah, there's a gdb-multiarch. and with "set architecture i386:x86-64" gdb can connect to qemu's gdbserver \o/ <diegonc>but I can't step through the code :( <diegonc>it steps with show invalid memory addresses <damo22>i am trying to see why it returns MIG_TYPE_ERROR <damo22> const mach_msg_type_t current_timeCheck = { <damo22> .msgt_name = (unsigned char) MACH_MSG_TYPE_INTEGER_32, <damo22> if (mig_unlikely ((OutP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) || <damo22> ((msgh_size != sizeof(mig_reply_header_t)) || <damo22> (OutP->RetCode == KERN_SUCCESS))))) <damo22> mach_msg_type_t current_timeType; <damo22>52 bytes - 16 bytes for the time_value64_t leaves 36 bytes for the rest of the message <damo22>msgt_size : 8, <--- for 32 bit userland... this does not match what the comment says <solid_black>the above says that current_time is 4 times an int32 <damo22> * Note that for 64 bit userland, msgt_size only needs to be 8 bits long <damo22> * but for kernel compatibility with 32 bit userland we allow it to be <damo22>4 times a int32 is the same as 2 times a int64 right? <solid_black>the sizes would be the same, but the types are different <damo22>does mig even support INTEGER_64 ? <solid_black>I see type int64_t = MACH_MSG_TYPE_INTEGER_64; in std_types.defs, then type time_value64_t = struct { int64_t seconds; int64_t nanoseconds; }; in mach_types.defs <damo22>why would it be conditional on that? its the same size for both userlands <youpi>the rpc mechanism not only checks for size, but really coherency of types <youpi>depending on the target platforms it may have differing rules for the typing <solid_black>my (pissibly wrong, correct me) understanding is that for user32 setup, you would use two different toolchains (including two different migs), one targeting x86_64-gnu, you'd build gnumach with it, and the other one targeting i386-gnu, you'd build your userland with it <solid_black>but is damo22 trying to build the whole thing with the same toolchain and just passing -m32? <damo22>interesting $ ../configure --prefix=/part3/git/gnumach-sv/gnu64 --target=i686-gnu <solid_black>I mean, for building a mig that targets the 32-bit userspace <sam_>the distinction between --host and --target matters for toolchain packages, i don't know if it matters for mig specifically but i wouldn't be surprised <solid_black>host is where mig would run, target is what mig generates code for <solid_black>off topic, sam_, was it you who dropped G_GNUC_CONST? <damo22>solid_black: its committed to the repo in .forgejo/workflow/action.yaml <solid_black>I see jobs named "i386" and "x86_64", but not user32? <solid_black>so "gnu32" is the prefix, and "build32" is the build dir <sam_>i'm a bit surprised that is being used (but not looked at the workflow) <sam_>(which repo is this in?) <damo22>i wrote that script, it runs in my forgejo instance automatically <solid_black>so you're building an i686 gnumach with x86_64-linux-gnu-gcc / x86_64-linux-gnu-ld, by passing -m32 and -melf_i386 <damo22>it uses -m32 and -melf_i386 for the userspace tests <damo22>yeah so this basically tests all combinations <damo22>it passes on all these except the --enable-user32 tests <solid_black>when compiling the 32-bit userland against an 64-bit user32-configured kernel headers, is USER32 defined? where from? <damo22>do i need to add -DUSER32 or something <solid_black>is an i386-gnu userland supposed to be buildable against x86_64 user32 mach installation? <youpi>maybe for a start compare the userland production of 32/32 and 64/32 <youpi>to be actually sure on which side the error is <youpi>whether it's userland which is miscompiled on 64/32 <youpi>or it's the kernel that misbehaves in 64/32 <damo22>i am not compiling the entire userland <youpi>solid_black: the mach installation in the user32 case is supposed to be exactly the same as pure 32b <youpi>but again, to determine this it's a matter of just checking the produced mig stubs <youpi>whether they do have the same type in 64/32 and 32/32 <youpi>solid_black: they should be the same, yes <solid_black>aha, so there's USER_MIG, USER_CC, etc, and you're setting them <solid_black>could not wiping the build dir before reconfiguring affect it? <solid_black>single-stepping over 'syscall' in GDB on x86-64 gnu kills Mach <diegonc>I'm having a look at build-tree/kern/mach_host.server.c and it differs in the returned current_timeType and the expected one in build-tree/mig-out/mach_host.user.c <diegonc>the server part is returning a size of 72 and a type of (MACH_MSG_TYPE_INTEGER_64, 64 , 2) instead of INTEGER_32 based one in the user part <diegonc>there's no such difference in a pure i386 build <diegonc>is it that supposed to be ok? if yes, where is the server type translated to the user type? <diegonc>also, a full x86_64 build generates code in both server and user files using a size of 72 and a current_timeType of (INTEGER_64., 64. 2) <solid_black>MACH_MSG_TYPE_INTEGER_64 x2 is correct, INTEGER_32 x4 is unexpected <diegonc>solid_black,what I meant is that 32x4 is what you get from a mig32 (used for user side) and 64x2 comes from mig64 (used in server side). so the mix used by --enable-user32 is somewhat incompatible with each other (?) <solid_black>at least that's what it appeared to do in damo22's CI script/setup <solid_black>do you also get MACH_MSG_TYPE_INTEGER_32 x4 on pure i686? <diegonc>yeap, the CI script specifies both MIG and USER_MIG variables <diegonc>I'm not sure how gnumach uses them though <diegonc>tests/configfrag.ac:AC_ARG_VAR([USER_MIG], [Path to the mig tool for user-space tests]) <diegonc>configure.ac:AC_ARG_VAR([MIG], [Path to the mig tool]) <diegonc>and I guess the plain mig for the kernel <diegonc>> solid_black: do you also get MACH_MSG_TYPE_INTEGER_32 x4 on pure i686? <diegonc>I built gnumach on a i386 image and got 32x4 on both user and server side of the RPC <diegonc>unfortunately I tried readng mig code but couln't find where it's decided to use one or the other :( <solid_black>does any usage of time_value64_t result in 32x4? what about usage of int64_t? <youpi>it's expected that the server side is not the same as the user sid, in the user32 case <youpi>gnumach translates between the two <youpi>again, for a start check whether the generated user32 test files match the pure-32 test files <youpi>to determine whether it's mig which is bogus in the user32 case, or whether it's the translation between kernel64 and user32 which is bogus <diegonc>solid_black: routing test_int64_t (host: mach_port_t; out n: int64_t) <diegonc>compiling that on i386 I get a type check of 64x1 :/ <diegonc>youpi, I think they are the same. but I will check again starting with a clean slate on both environments <diegonc>solid_black: as soon as I place an int64_t into a struct I start getting 32x2 checks