Re: Memory protection between compilation units?

Liste des GroupesRevenir à cl c 
Sujet : Re: Memory protection between compilation units?
De : mateusz (at) *nospam* not.gonna.tell (Mateusz Viste)
Groupes : comp.lang.c
Date : 14. Jun 2025, 23:22:12
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102ksmk$evka$1@dont-email.me>
References : 1 2 3 4
User-Agent : PhoNews/3.13.3 (Android/14)
On 14.06.2025 01:31, Tim Rentsch wrote:
It isn't wrong to think of bitwise-and as masking-in (or possibly
masking-out) of certain bits, but it still isn't a modulo.  A modulo
operation is what is desired;
By "different viewpoints," I meant that while you approach the problem by
 applying a modulo operation to the index so it fits the array size, I tend
 to think in terms of ensuring the index correctly maps to a location within
 an n-bit address space. Naturally, the array should accommodate the maximum
 possible index for the given address space, and that’s where the original
 code fell short. And you're absolutely right that hardcoded values are
 problematic, the size of the array should have been linked with the n-bits
 address space expectation.

I think you have misunderstood the point of my comments.  In some
cases one is confronted with a symptom that defies one's best
efforts to diagnose what is causing the symptom.  Looking for known
classes of errors is another arrow in the quiver of techniques for
discovering what is causing the observed behavior.
My remark was tongue-in-cheek, but we’re clearly on the same wavelengt, no
 worries. Digging into “known classes of errors” when facing bit-fiddling
 gremlins is precisely how I pinpointed the root cause, and proactively
 tracking other similar mistakes is on my todo. But this is an obvious,
 mechanical and uninteresting subject. As I mentioned to Michael earlier,
 improving code quality is a long-term, essential aspect of our work,
 there’s no question about that. But alongside this continuous effort, I’m
 always exploring strategies to be more defensive towards the current,
 non-ideal code.  In this case, my initial thought was to split the program into smaller
 components that communicate via IPC. This approach would allow a faulty
 component to crash with a segfault without compromising the memory of other
 parts and greatly easing the debugging process. An IPC is much more
 limiting and slower than a function call, so it made me wonder if it is
 possible to achieve a similar level of isolation within a single program.
 That question led me to post here.  While there is no magic solution yet, Kaz suggested a clever workaround
 using mprotect(), a compromise I’m considering applying in a few places.
Mateusz

Date Sujet#  Auteur
11 Jun 25 * Memory protection between compilation units?53Mateusz Viste
11 Jun 25 +* Re: Memory protection between compilation units?6Josef Möllers
12 Jun 25 i+* Re: Memory protection between compilation units?2Michael S
13 Jun 25 ii`- Re: Memory protection between compilation units?1Mateusz Viste
12 Jun 25 i`* Re: Memory protection between compilation units?3Richard Heathfield
16 Jun 25 i `* Re: Memory protection between compilation units?2Rosario19
16 Jun 25 i  `- Re: Memory protection between compilation units?1Richard Heathfield
11 Jun 25 +- Re: Memory protection between compilation units?1Lew Pitcher
11 Jun 25 +* Re: Memory protection between compilation units?3David Brown
12 Jun 25 i`* Re: Memory protection between compilation units?2Mateusz Viste
12 Jun 25 i `- Re: Memory protection between compilation units?1David Brown
11 Jun 25 +* Re: Memory protection between compilation units?3Opus
11 Jun 25 i+- Re: Memory protection between compilation units?1wij
12 Jun 25 i`- Re: Memory protection between compilation units?1Mateusz Viste
11 Jun 25 +- Re: Memory protection between compilation units?1Kaz Kylheku
12 Jun 25 +* Re: Memory protection between compilation units?21Mateusz Viste
12 Jun 25 i`* Re: Memory protection between compilation units?20Kaz Kylheku
13 Jun 25 i +* Re: Memory protection between compilation units?2Mateusz Viste
13 Jun 25 i i`- Re: Memory protection between compilation units?1Kaz Kylheku
13 Jun 25 i `* Re: Memory protection between compilation units?17pozz
13 Jun 25 i  `* Re: Memory protection between compilation units?16Mateusz Viste
13 Jun 25 i   +* Re: Memory protection between compilation units?13Michael S
13 Jun 25 i   i+* Re: Memory protection between compilation units?2Richard Heathfield
14 Jun 25 i   ii`- Re: Memory protection between compilation units?1Michael S
13 Jun 25 i   i+- Re: Memory protection between compilation units?1Kaz Kylheku
14 Jun 25 i   i`* Re: Memory protection between compilation units?9Mateusz Viste
15 Jun 25 i   i `* Re: Memory protection between compilation units?8Waldek Hebisch
15 Jun 25 i   i  `* Re: Memory protection between compilation units?7Mateusz Viste
16 Jun 25 i   i   `* Re: Memory protection between compilation units?6Waldek Hebisch
16 Jun 25 i   i    +* Re: Memory protection between compilation units?3Kaz Kylheku
16 Jun 25 i   i    i`* Re: Memory protection between compilation units?2Waldek Hebisch
16 Jun 25 i   i    i `- Re: Memory protection between compilation units?1James Kuyper
16 Jun 25 i   i    `* Re: Memory protection between compilation units?2Tim Rentsch
16 Jun 25 i   i     `- Re: Memory protection between compilation units?1Waldek Hebisch
13 Jun 25 i   +- Re: Memory protection between compilation units?1Kaz Kylheku
13 Jun 25 i   `- Re: Memory protection between compilation units?1wij
12 Jun 25 +* Re: Memory protection between compilation units?2Mikko
12 Jun 25 i`- Re: Memory protection between compilation units?1Mateusz Viste
12 Jun 25 +* Re: Memory protection between compilation units?10Tim Rentsch
13 Jun 25 i+* Re: Memory protection between compilation units?5Bonita Montero
13 Jun 25 ii`* Re: Memory protection between compilation units?4wij
13 Jun 25 ii +- Re: Memory protection between compilation units?1Bonita Montero
13 Jun 25 ii `* Re: Memory protection between compilation units?2Keith Thompson
13 Jun 25 ii  `- Re: Memory protection between compilation units?1Tim Rentsch
13 Jun 25 i`* Re: Memory protection between compilation units?4Mateusz Viste
14 Jun 25 i `* Re: Memory protection between compilation units?3Tim Rentsch
14 Jun 25 i  `* Re: Memory protection between compilation units?2Mateusz Viste
1 Jul17:54 i   `- Re: Memory protection between compilation units?1Tim Rentsch
13 Jun 25 +* Re: Memory protection between compilation units?3Bonita Montero
13 Jun 25 i`* Re: Memory protection between compilation units?2Mateusz Viste
13 Jun 25 i `- Re: Memory protection between compilation units?1Kaz Kylheku
16 Jun 25 +- Re: Memory protection between compilation units?1Mateusz Viste
21 Jun 25 `- Re: Memory protection between compilation units?1olcott

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal