Jump to page: 1 24  
Page
Thread overview
FreeBSD 13 : wrong kernel version and size of kevent_t
Dec 19, 2021
eugene
Dec 20, 2021
rempas
Dec 21, 2021
eugene
Dec 21, 2021
eugene
Dec 21, 2021
rempas
Dec 21, 2021
Johan
Dec 21, 2021
rempas
Dec 21, 2021
eugene
Dec 21, 2021
eugene
Dec 21, 2021
rempas
Dec 21, 2021
eugene
Dec 21, 2021
eugene
Dec 21, 2021
rempas
Dec 21, 2021
eugene
Dec 21, 2021
rempas
Dec 21, 2021
eugene
Dec 21, 2021
rempas
Dec 21, 2021
eugene
Dec 21, 2021
rempas
Dec 21, 2021
eugene
Dec 22, 2021
Johan
Dec 22, 2021
eugene
Dec 22, 2021
rempas
Dec 22, 2021
eugene
Dec 22, 2021
rempas
Dec 22, 2021
eugene
Dec 22, 2021
rempas
Dec 22, 2021
eugene
Dec 21, 2021
eugene
Dec 21, 2021
eugene
Dec 21, 2021
eugene
Dec 21, 2021
eugene
December 19, 2021

test program:

import std.stdio;
import core.sys.freebsd.config;
import core.sys.freebsd.sys.event;

void main(string[] args) {
    writefln("FreeBSD_version = %s", __FreeBSD_version);
    writefln("sizeof(kevent_t) = %s", kevent_t.sizeof);
}

output:

@bsd:~/d> ./freebsdver
FreeBSD_version = 1104000
sizeof(kevent_t) = 32

@bsd:~/d> uname -K
1300139

/usr/include/d/dmd/core/sys/freebsd/sys/event.h do contain correct definition of kevent_t for versions 12+ (with ulong[4] ext field), but because of wrong kernel version size of kevent_t is also incorrect.

December 20, 2021

On Sunday, 19 December 2021 at 09:49:29 UTC, eugene wrote:

>

test program:

import std.stdio;
import core.sys.freebsd.config;
import core.sys.freebsd.sys.event;

void main(string[] args) {
    writefln("FreeBSD_version = %s", __FreeBSD_version);
    writefln("sizeof(kevent_t) = %s", kevent_t.sizeof);
}

output:

@bsd:~/d> ./freebsdver
FreeBSD_version = 1104000
sizeof(kevent_t) = 32

@bsd:~/d> uname -K
1300139

/usr/include/d/dmd/core/sys/freebsd/sys/event.h do contain correct definition of kevent_t for versions 12+ (with ulong[4] ext field), but because of wrong kernel version size of kevent_t is also incorrect.

I don't have FreeBSD and I can't check the output and header files myself but from what you are saying this seems to me as a bug. I would recommend you to file an issue just so the developers themself can notice it. We have nothing to loss in any case

December 21, 2021

On Monday, 20 December 2021 at 21:19:43 UTC, rempas wrote:

>

I don't have FreeBSD and I can't check the output and header

I have it VirtualBox

>

files myself but from what you are saying this seems to me as a bug. I would recommend you to file an issue just so the developers themself can notice it

Ok.

December 21, 2021

On Monday, 20 December 2021 at 21:19:43 UTC, rempas wrote:

>

I would recommend you to file an issue just so the developers themself can notice it.

filed an issue, see
https://issues.dlang.org/show_bug.cgi?id=22615

December 21, 2021

On Tuesday, 21 December 2021 at 10:28:15 UTC, eugene wrote:

>

filed an issue, see
https://issues.dlang.org/show_bug.cgi?id=22615

Nice! Hope they see and fix it soon! Love for open source Operating Systems!!

December 21, 2021

On Tuesday, 21 December 2021 at 10:28:15 UTC, eugene wrote:

>

On Monday, 20 December 2021 at 21:19:43 UTC, rempas wrote:

>

I would recommend you to file an issue just so the developers themself can notice it.

filed an issue, see
https://issues.dlang.org/show_bug.cgi?id=22615

Please add which compiler(s) you have tried in the bug report.

I think the fix is needed here: https://github.com/dlang/dmd/blob/ad8412530e607ffebec36f2dbdff1a6f2798faf7/src/dmd/target.d#L362-L372

-Johan

December 21, 2021

On Tuesday, 21 December 2021 at 17:00:06 UTC, Johan wrote:

>

Please add which compiler(s) you have tried in the bug report.

Yeah, you are right! Please eugene use LDC2 and check confirm that the behavior is the same there.

>

I think the fix is needed here: https://github.com/dlang/dmd/blob/ad8412530e607ffebec36f2dbdff1a6f2798faf7/src/dmd/target.d#L362-L372

Yeah, I think it is very clear as there is no case for FreeBSD 13. So probably this will be easily fixed

December 21, 2021

On Tuesday, 21 December 2021 at 17:32:44 UTC, rempas wrote:

>

On Tuesday, 21 December 2021 at 17:00:06 UTC, Johan wrote:

>

Please add which compiler(s) you have tried in the bug report.

>

Yeah, you are right! Please eugene use LDC2 and check confirm that the behavior is the same there.

I have. Same picture.

>

Yeah, I think it is very clear as there is no case for FreeBSD 13. So probably this will be easily fixed

Yes, one need to let compiler see actual OS version.
I just do not know how to do it and do it correctly.

December 21, 2021

On Tuesday, 21 December 2021 at 17:32:44 UTC, rempas wrote:

>

Please eugene use LDC2 and check confirm that the behavior is the same there.

Phobos that shipped with LDC, does not have core.sys.freebsd.config
So

import std.stdio;
//import core.sys.freebsd.config;
import core.sys.freebsd.sys.event;

void main(string[] args) {
//        writefln("FreeBSD_version = %s", __FreeBSD_version);
        writefln("sizeof(kevent_t) = %s", kevent_t.sizeof);
}

and

@bsd:~/d> ldc2 freebsdver.d
@bsd:~/d> ./freebsdver
sizeof(kevent_t) = 32

As you see, sizeof struct kevent_t is also wrong, must be 64:

exerpt from /usr/include/sys/event.h

struct kevent {
        __uintptr_t     ident;          // identifier for this event
        short           filter;         // filter for event
        unsigned short  flags;          // action flags for kqueue
        unsigned int    fflags;         // filter flag value
        __int64_t       data;           // filter data value
        void            *udata;         // opaque user data identifier
        __uint64_t      ext[4];         // extensions
};

#if defined(_WANT_FREEBSD11_KEVENT)
// Older structure used in FreeBSD 11.x and older.
struct kevent_freebsd11 {
        __uintptr_t     ident;          // identifier for this event
        short           filter;         // filter for event
        unsigned short  flags;
        unsigned int    fflags;
        __intptr_t      data;
        void            *udata;         // opaque user data identifier
};
#endif
December 21, 2021

I would love to see more full (and correct) support for FreeBSD, OpenBSD and DragonflyBSD from Dlang! Maybe one day..

« First   ‹ Prev
1 2 3 4