1,994 karma · joined October 5, 2012
It might be possible. Someone might prove that preventing UAF necessarily increases complexity somewhere else. Like one of those laws of thermodynamics, but for software.
I need more sleep.
Although, if my theory that the IO buffers are different sizes is true, then that could perturb memory layout enough to expose/hide the bug in either direction.
The conditional jump remains even with -march=native.
void toupper_cmov(char* buf, size_t size) {
for (size_t i = 0; i < size; i++) {
char c = buf[i];
buf[i] = c - 32 * (c >= 'a' && c <= 'z');
}
}
Because that persuades gcc and clang to transform the conditional branch into a conditional move which avoids the branch mispredict penalty and removes the need for a lookup table.See https://godbolt.org/z/xHYKft
Disclaimer: I haven't actually run this function. That would be too much like work.
To partly redeem myself, I followed the links to the first two articles prefixed by "P". They were https://www.ncbi.nlm.nih.gov/pubmed/29725476 and https://www.ncbi.nlm.nih.gov/pubmed/29268055
The first didn't have a conclusion and the results were just the measured RF power in an apartment.
The conclusion of the second is, "A total of 900-MHz EMF applied in middle and late adolescence may cause changes in the morphology and biochemistry of the rat ovarium.", which makes no sense. "A total of 900-MHz EMF" is gibberish. The complete text is not freely available.
I checked the "conclusions" of the first two: https://www.ncbi.nlm.nih.gov/pubmed/29996112 and https://www.ncbi.nlm.nih.gov/pubmed/29709736
Conclusion of 1) Despite the improved exposure assessment approach used in this study, no clear associations were identified. However, the results obtained for recent exposure to RF electric and magnetic fields are suggestive of a potential role in brain tumor promotion/progression and should be further investigated.
Conclusion of 2) Ever use of wireless phones was not significantly associated with risk of adult glioma, but there could be increased risk in long-term users.
They both read as, "we found no significant effect".
I expect there is a way, just I don't know it.
How can I see that list? I'm interested in comparing languages this way.
Yep. Sorry about that. Not that it was my fault. Anyhow, I guess my belief is that a similar company to CSR could put RISCV cores in their chips now, which would avoid the problem you describe and some of the problems I described with using ARM.
Some of the engineers thought making our own CPU designs was a stupid idea and some thought that switching to ARM designs was a stupid idea. The only fact I have is that our CPU designs were not the main cause of bugs in our chips. If you asked the digital designers, they'd say things like, "Why are software engineers so interested in CPU designs. The kinds of embedded CPUs we need are easy to design. Implementing a correct power management state machine is hard. Implementing an efficient WiFi PHY is hard. Get off my lawn..."
Some problems with putting ARM CPUs in our chips were: a) integration engineering costs (ie find a way to multiplex some existing pins on the package with the jtag debug port), b) having to do price and contract negotiation with ARM (that part of the company was less efficient than the digital engineering team), c) finding that the change you wanted to make to the chip was incompatible with the ARM contract you'd just spent 6 months negotiating.
I'd go further than that. I'd say in production too. If the simple thing is fast enough even when you test on a slow machine, then implementing the faster but more complicated data structure is a form of premature optimization.
I like the simplicity of the doubly linked list of lines. I'm not sure what advantage the rope data structure would bring.