From: Richard Weinberger <richard@nod.at>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xenomai <xenomai@lists.linux.dev>
Subject: Re: [PATCH] Add build time guard to detect off_t mismatch
Date: Thu, 7 May 2026 14:32:51 +0200 (CEST) [thread overview]
Message-ID: <1863085876.2350.1778157171370.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <945cb32c-88ea-41fa-8223-f3d1e639e9d9@siemens.com>
----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
> An: "richard" <richard@nod.at>, "xenomai" <xenomai@lists.linux.dev>
> Gesendet: Donnerstag, 7. Mai 2026 14:26:37
> Betreff: Re: [PATCH] Add build time guard to detect off_t mismatch
> On 07.05.26 14:23, Richard Weinberger wrote:
>> When Xenomai is built without _FILE_OFFSET_BITS=64 on a 32 bit system,
>> which is the default, but the Xenomai application itself is built later
>> with _FILE_OFFSET_BITS=64, we get a nasty ABI mismatch. Since only very
>> few cobalt syscalls use off_t, the mismatch goes undiscovered for a
>> surprisingly long time. In my case it surfaced only after a realtime
>> application which uses mmap() failed sometimes at mmap() depending on
>> what functions it called before mmap(). In the good cases it used to
>> work by chance since the extra bytes used for off_t on the stack were
>> zero.
>>
>> To save the next person in the same situation a lot of time, compute
>> the size of off_t at configure time and compare it against the
>> application's sizeof(off_t) via a static assertion in a new generated
>> header, which is included when building Xenomai applications.
>>
>
> This should have been resolved (but apparently we missed most of it) by
> 0bb6608b6fa7129de1ff4213ddf31298616cbf23. Can you name some of the
> remaining mismatches?
In my case it was just mmap(). But wouldn't it hurt at any function
or data structure exposed by Xenomai which uses off_t?
So, I suggest applying my change as safeguard mechanism.
Thanks,
//richard
next prev parent reply other threads:[~2026-05-07 12:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 12:23 [PATCH] Add build time guard to detect off_t mismatch Richard Weinberger
2026-05-07 12:26 ` Jan Kiszka
2026-05-07 12:32 ` Richard Weinberger [this message]
2026-05-07 12:54 ` Jan Kiszka
2026-05-07 12:55 ` Richard Weinberger
2026-05-07 14:02 ` Jan Kiszka
2026-05-07 14:10 ` Richard Weinberger
2026-05-07 14:16 ` Jan Kiszka
2026-05-07 14:26 ` Richard Weinberger
2026-05-12 13:01 ` Richard Weinberger
2026-05-12 13:08 ` Jan Kiszka
2026-05-12 13:15 ` Richard Weinberger
2026-05-12 14:26 ` Florian Bezdeka
2026-05-12 15:04 ` Richard Weinberger
2026-05-12 15:27 ` Florian Bezdeka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1863085876.2350.1778157171370.JavaMail.zimbra@nod.at \
--to=richard@nod.at \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.