What rules do you follow to prevent memory safety errors? Memory leaks, Use after free, etc?

I've been studying garbage collectors and reference counters and and trying to come up with a way to build a better garbage collector/reference counter. And I have an idea, which is to codify certain typical patterns for references and allow users to use those and memory will automatically be freed/released but each will have certain restrictions the compiler can reason about to ensure memory safety.

I figured I'd come to the experts in manual memory management and ask them to help me think about the kind of rules you typically follow to maintain memory safety and how often you have to get fancy.. when you do.. how do you approach it?

The low hanging fruit parents:
- If something is malloced, then the variable owning it goes out of scope.. free it.
- One parent per referenced child
- Doubly linked parent-child
- Reference counted
- Manual malloc/free if you need it

What about reference cycles and graph data?

Hope this is considered directly referring to C enough to be on topic, I primarly just want to discuss how you safely manage memory in C :)

πŸ‘︎ 51
πŸ’¬︎
πŸ‘€︎ u/mczarnek
πŸ“…︎ Apr 30 2021
🚨︎ report
Not to be too optimistic, but with Littleton, Kwiat, Morrow, Muse and Deablo (plus Abram at box safety), this has the POTENTIAL to be the fastest, most athletic linebacking corp we've had in memory.
πŸ‘︎ 85
πŸ’¬︎
πŸ“…︎ May 01 2021
🚨︎ report
anyone tried to do a clean room implementation of Redis using Rust, but speaks the same wire protocol? You would get the zero-cost multi-threading, memory safety, etc, and it would be a drop in replacement. news.ycombinator.com/item…
πŸ‘︎ 68
πŸ’¬︎
πŸ‘€︎ u/avinassh
πŸ“…︎ Apr 28 2021
🚨︎ report
(1) bored squad + (1) random washing machine + (1) M67 grenade you'll have to explain why you no longer have + (1)hr ass chewing + (1)hr safety brief - (2) ranks + (0) fucks = (3)rd world country memories with the homies v.redd.it/1yr61zg60ok61
πŸ‘︎ 1k
πŸ’¬︎
πŸ‘€︎ u/SeenSomeThangs
πŸ“…︎ Mar 02 2021
🚨︎ report
101 MH/s on 3080, running fans at 100%. Memory stays around 96 average. Decent results and safety?

EVGA XC3 3080

-500 core +1500 memory

96 average memory temps at 100% fan speed
315w power draw

Everything *seems* to be safe for the long term.

How do you guys feel about 100% fan speed, the power draw, settings, etc. Any criticism?

EDIT (2/3/21): Still using the same core and memory, I reduced the power limit to 75% and was able to maintain 101 MH/s. The PL change also dropped the memory temperatures to 92 average, and power draw to 254w.

I might try to further tune the settings with the OCTune guide listed in the comments below.

Word of caution.

I would definitely considering raising and locking your fan speeds while mining on a 3080/90. I hear the memory is "expected" to heat up to 104-108(!), but it also sustains permanent damage at 120.

Messing with the OC settings sometimes caused a spike in memory temperature with auto-fan curves on. The fan regulation seem to only respond to core temp, not memory temp.

So while your core may be 50 degrees from having a previously high fan speed, your memory is still running extremely hot. When the auto-fan curve kicks back in after adjusting settings, your fans may cease to run at a speed that was previously keeping your memory safe.

While I hear the built in safety features for preventing damage are pretty good, and the temp ratings for the memory are also high, I don't wanna take chance it. I'm locking my fan speeds.

If someone with more technical knowledge of chip safety and thermals wants to comment below that'd be very welcome!

JUST A THOUGHT!

/end EDIT (2/3/21)

https://preview.redd.it/zg245879z8f61.jpg?width=1695&format=pjpg&auto=webp&s=aa81267c08ed93a3bc4bce260e7d575645e72139

πŸ‘︎ 55
πŸ’¬︎
πŸ‘€︎ u/gammonwalker
πŸ“…︎ Feb 03 2021
🚨︎ report
Alpha, S390, HPPA, HPUX, AIX, etc. Best of luck. I'd encourage you to contribute platform support to LLVM or contribute to gccrs. My work to promote language-level memory safety will continue unabated. github.com/pyca/cryptogra…
πŸ‘︎ 87
πŸ’¬︎
πŸ‘€︎ u/pextrw
πŸ“…︎ Feb 13 2021
🚨︎ report
Memory safety go brrr v.redd.it/emq3vrt914u61
πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/Voodlaz
πŸ“…︎ Apr 20 2021
🚨︎ report
Memory safety in Umka

Since its birth, the Umka language has had support for several lower-level features than is typical for other embedded scripting languages (such as Lua). These features, along with Umka's static typing, were needed to achieve seamless integration with C and its data structures. They have served well, for example, in designing a scriptable tractor dynamics simulator. On the other hand, they have naturally led to some memory safety issues, and it took some time to find satisfactory solutions.

Pointer type casts. Umka now forbids casting pointers from a smaller base type to a larger base type or to a base type which is itself a pointer or has a pointer as its item or field. When a dynamic array is cast to a static array, its length is dynamically checked at runtime. The same is done with a string when it is cast to a char array.

Weak pointers. A weak pointer in Umka cannot be immediately dereferenced. Instead, it should be first cast to a conventional ('strong') pointer to the same base type. This operation is checked at runtime to ensure that the weak pointer is not dangling. Otherwise, the type cast returns null.

Reading pointers from files. Umka forbids reading pointers or any data structures that contain pointers, such as dynamic arrays or interfaces.

Returning pointers to local variables from functions. This problem was the hardest one. Any attempt to find an affordable solution eventually ended up with some rather complicated strategy: either a Go-style "escape analysis", or a Rust-style "lifetime analysis". The former would be impossible in a single-pass compiler, while the latter would make the language much more difficult. My final decision was to perform a simplified "escape analysis". Namely, if a function never tries to increment any reference counts, all its parameters and local variables are allocated in a conventional stack frame. Otherwise, a reference-counted "heap frame" is used. Local variable addressing is identical in both cases, the only difference being the value stored in the frame base register.

Everyone is welcome to test the language and find any segmentation faults (see the master branch, not the December 2020 release). Hope that no legitima

... keep reading on reddit ➑

πŸ‘︎ 19
πŸ’¬︎
πŸ‘€︎ u/vtereshkov
πŸ“…︎ Mar 11 2021
🚨︎ report
Optimal memory clock for long term safety?

Hey guys, started mining with my 3080 a few days ago. Modded the card added thermal pads and paste. Gpu and Vram temps are very good but I was wondering if constantly going with 1300 mhz memory clock (100.9 mhs) would degrade the card faster in comparison with 1200 mhz or 1000 mhz. I’m asking because the temps are good but since we can’t monitor everything maybe there is something to note about high memory clocks.

Second question, does anyone have an experience with laptop mining? Msi ge76 with 3070 giving me 69 mhs at 58 degrees celcius haven’t tried undervolting etc yet. But is it safe to assume that it will last 2 years with good maintenance?

Would appreciate if anyone have any knowledge about these subjects.

Thank you

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/ARDA-s
πŸ“…︎ Apr 13 2021
🚨︎ report
Memory safety go brrr v.redd.it/emq3vrt914u61
πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/Deebble
πŸ“…︎ Apr 19 2021
🚨︎ report
Doug Laher’s call for safety in memory of his son Trevor pcta.org/2021/doug-lahers…
πŸ‘︎ 176
πŸ’¬︎
πŸ‘€︎ u/FIRExNECK
πŸ“…︎ Jan 26 2021
🚨︎ report
Micron Launches Low-Power Memory Qualified for Automotive Safety Applications apnews.com/press-release/…
πŸ‘︎ 58
πŸ’¬︎
πŸ‘€︎ u/ElXGaspeth
πŸ“…︎ Feb 24 2021
🚨︎ report
NHTSA Makes Tesla Recall 133,951 Cars After Concluding They'll 'Inevitably' Fail | The 2012-2018 Model S and X had a memory issue that eventually kills the touch screen, which NHTSA deemed a safety issue. roadandtrack.com/news/a35…
πŸ‘︎ 30
πŸ’¬︎
πŸ‘€︎ u/MyNameIsGriffon
πŸ“…︎ Feb 02 2021
🚨︎ report
C++ Memory Safety

Isn't the first step of achieving Rust like memory safety (temporal, spatial and parallel) in C++ is allowing the compiler to reject code (compile error) when the compiler can conclusively decide that an operation is unsafe (out of bound access, use after free, etc...) using static analysis?

I can see several efforts going on creating such static analysers,

https://coderrect.com/overview/

https://developers.redhat.com/blog/2021/01/28/static-analysis-updates-in-gcc-11/

However I'm not sure whether the compiler is allowed to reject code based on such analysis even if it can come to a conclusion about unsafe code.

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/NamalB
πŸ“…︎ Feb 03 2021
🚨︎ report
And people just don’t care. That’s it’s. They’d rather sacrifice safety over feelings and β€˜memories’. This is from a town over from me. Some parents apparently put together a HOCO shindig because the kids β€œdeserve” something. I guess that would be COVID for the holidays! Geniuses. reddit.com/gallery/jzhx9z
πŸ‘︎ 128
πŸ’¬︎
πŸ“…︎ Nov 23 2020
🚨︎ report
Google Online Security Blog: Mitigating Memory Safety Issues in Open Source Software security.googleblog.com/2…
πŸ‘︎ 120
πŸ’¬︎
πŸ‘€︎ u/leo60228
πŸ“…︎ Feb 17 2021
🚨︎ report
COVAXIN is shown to generate memory T cell responses, for its multiple epitopes, indicating longevity and a rapid antibody response to future infections. With published data demonstrating a safety profile superior to other vaccine

In addition to generating strong immune response against multiple antigens, COVAXIN is shown to generate memory T cell responses, for its multiple epitopes, indicating longevity and a rapid antibody response to future infections. With published data demonstrating a safety profile superior to several other vaccines, COVAXIN is packaged in multi-dose vials that can be stored at 2-8oC.

πŸ‘︎ 34
πŸ’¬︎
πŸ‘€︎ u/Superb-Ad5769
πŸ“…︎ Mar 03 2021
🚨︎ report
Google announces the Android Open Source Project now supports Rust for developing the OS itself, providing more memory safety guarantees than C and C++ (Aamir Siddiqui/XDA Developers) techmeme.com/210406/p25
πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Apr 06 2021
🚨︎ report
I know the HTML, CSS and JS but what's a port, service worker and memory safety?

Goal: I'm leaning tech so I can manage employees at a tech startup. I want to make my my future web app secure, fast and scalable.

I've self learned the languages but I don't understand many of the tutorials because I lack the knowledge of anything except the syntax. Although, I can create the simple static sites and web apps but I'm afraid that I'll run into problems while scaling, making it fast and secure.

I want to learn how things work from the top to bottom so I can choose what's best for my company moving from one growth stage to another.

πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/Belal99
πŸ“…︎ Jan 08 2021
🚨︎ report
Mitigating Memory Safety Issues in Open Source Software feedproxy.google.com/~r/G…
πŸ‘︎ 22
πŸ’¬︎
πŸ“…︎ Feb 18 2021
🚨︎ report
Chrome: 70% of all security bugs are memory safety issues zdnet.com/article/chrome-…
πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/techempower
πŸ“…︎ May 23 2020
🚨︎ report
Memory safety in Umka /r/ProgrammingLanguages/c…
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/vtereshkov
πŸ“…︎ Mar 11 2021
🚨︎ report
Pandemic has nurses, PSWs suffering high COVID infection rate, job stress | "We now find in the midst of one of the worst occupational health and safety disasters in modern memory, that these workers have been systematically denied the most basic protections and their legal rights" elliotlaketoday.com/local…
πŸ‘︎ 30
πŸ’¬︎
πŸ“…︎ Dec 05 2020
🚨︎ report
The Chromium project finds that around 70% of our serious security bugs are memory safety problems. Our next major project is to prevent such bugs at source. chromium.org/Home/chromiu…
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/speckz
πŸ“…︎ May 24 2020
🚨︎ report
Mitigating Memory Safety Issues in Open Source Software security.googleblog.com/2…
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/vlakreeh
πŸ“…︎ Feb 18 2021
🚨︎ report
Remember when they would go through all this trouble to get Frank back to safety? Nowadays they would actually celebrate his disappearance. Even in season 3, most of them didn't care too much when he was stuck in Mexico. Ah, memories... youtu.be/s93UZzhOXxU
πŸ‘︎ 25
πŸ’¬︎
πŸ“…︎ Dec 20 2020
🚨︎ report
Mitigating Memory Safety Issues in Open Source Software security.googleblog.com/2…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/qznc_bot2
πŸ“…︎ Feb 18 2021
🚨︎ report
Mitigating Memory Safety Issues in Open Source Software feedproxy.google.com/~r/G…
πŸ‘︎ 3
πŸ’¬︎
πŸ“…︎ Feb 18 2021
🚨︎ report
Inline and Sideline Approaches for Low-cost Memory Safety in C cl.cam.ac.uk/techreports/…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/mttd
πŸ“…︎ Feb 17 2021
🚨︎ report
The Chromium project finds that around 70% of our serious security bugs are memory safety problems chromium.org/Home/chromiu…
πŸ‘︎ 669
πŸ’¬︎
πŸ‘€︎ u/asmx85
πŸ“…︎ May 23 2020
🚨︎ report
NHTSA Makes Tesla Recall 133,951 Cars After Concluding They'll 'Inevitably' Fail | The 2012-2018 Model S and X had a memory issue that eventually kills the touch screen, which NHTSA deemed a safety issue. roadandtrack.com/news/a35…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/rtbot2
πŸ“…︎ Feb 02 2021
🚨︎ report
Doug Laher's call for safety in memory of his son Trevor pcta.org/2021/doug-lahers…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/jakdak
πŸ“…︎ Jan 26 2021
🚨︎ report
Rams VS. Bills memories: Tasker destroys Rams safety Vernon Turner on a Punt return in 1992. youtu.be/0GHtAWiH9BQ
πŸ‘︎ 60
πŸ’¬︎
πŸ‘€︎ u/HarvesternC
πŸ“…︎ Sep 25 2020
🚨︎ report
Checked C: Adding Memory Safety to LLVM youtube.com/watch?v=EuxAz…
πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/pjmlp
πŸ“…︎ Dec 28 2020
🚨︎ report
Blue Team Rust: What is "Memory Safety", really? tiemoko.com/blog/blue-tea…
πŸ‘︎ 224
πŸ’¬︎
πŸ‘€︎ u/jakejscott
πŸ“…︎ Aug 02 2020
🚨︎ report
Article: Another way for a language to ensure memory safety. github.com/finegeometer/a…
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/finegeometer
πŸ“…︎ Oct 02 2020
🚨︎ report
"Everything in Rust is so thoughtfully and carefully designed. Lifetimes are great, traits are great, memory safety is great, but the careful and thorough design is just *rare.* It is the real killer feature of Rust. Once you get the \"spirit\" of the language, you can derived the rest." reddit.com/r/rust/comment…
πŸ‘︎ 16
πŸ’¬︎
πŸ‘€︎ u/xigoi
πŸ“…︎ Oct 26 2020
🚨︎ report
Chrome: 70% of all security bugs are memory safety issues zdnet.com/article/chrome-…
πŸ‘︎ 84
πŸ’¬︎
πŸ‘€︎ u/pjmlp
πŸ“…︎ May 23 2020
🚨︎ report
This is a picture of my dad after he won a bicycle safety competition as a kid (one of his favorite memories!!) It would mean the world to him if it was restored. I know it’s not the best picture, as it was printed from a newspaper archive website. Thank you so much!!
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/petalsofpeony
πŸ“…︎ Dec 22 2020
🚨︎ report
What is "Memory Safety", really? - A brief technical primer on Rust's key security feature, with embedded-specific context. tiemoko.com/blog/blue-tea…
πŸ‘︎ 46
πŸ’¬︎
πŸ‘€︎ u/jasonbourne1901
πŸ“…︎ Aug 02 2020
🚨︎ report
Optimal Memory Clock for long term safety?

Hey guys, started mining with my 3080 a few days ago. Modded the card added thermal pads and paste. Gpu and Vram temps are very good but I was wondering if constantly going with 1300 mhz memory clock (100.9 mhs) would degrade the card faster in comparison with 1200 mhz or 1000 mhz. I’m asking because the temps are good but since we can’t monitor everything maybe there is something to note about high memory clocks.

Second question, does anyone have an experience with laptop mining? Msi ge76 with 3070 giving me 69 mhs at 58 degrees celcius haven’t tried undervolting etc yet. But is it safe to assume that it will last 2 years with good maintenance?

Would appreciate if anyone have any knowledge about these subjects.

Thank you

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/ARDA-s
πŸ“…︎ Apr 13 2021
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.