Forgot your password?
typodupeerror
AMD Programming

AMD Working To 'Push Rust Deep into the GPU Stack' (phoronix.com) 81

Phoronix reports: AMD is building out what they are describing as an "elite" team of developers for driving Rust code "deep into the GPU stack" from firmware to drivers, shader compilers, and other GPU software in Rust. AMD Senior Fellow Harsh Meno posted this week to LinkedIn about this new effort...

And note this AMD job posting that's active for hiring a software development engineer to work on Rust code...

"We are building next-generation systems software for AMD GPUs with Rust as a core technical direction. The work spans compilers, runtimes, low-level GPU software, firmware, developer tooling, and methods for improving the safety and correctness of complex hardware-software systems.

"Rust is not incidental to this role. You will help establish how Rust is used in performance-sensitive and high-trust parts of the GPU stack, including the compiler and tooling support, system interfaces, engineering practices, and validation methods required for production deployment. You will have the opportunity to influence both near-term implementations and the longer-term architecture for using Rust across current and future AMD platforms."

"AMD also isn't alone," the article points out, "as NVIDIA has also been pursuing similar Rust-based initiatives for their GPU software too, including the development of the Nova Linux kernel driver written in Rust."

AMD Working To 'Push Rust Deep into the GPU Stack'

Comments Filter:
  • If they put rust in the GPU surely that will inhibit performance...all that oxidized metal, can't be good for electrical conduction.
  • by SlashbotAgent ( 6477336 ) on Tuesday September 08, 2026 @07:55AM (#66328172)

    How does AI do with Rust? It seems like most of the AI generated code is in HTML, Typescript, and Python. Is it capable of advanced work in Rust?

    • Re: (Score:3, Interesting)

      LLMs focusing on code generation can generate code in nearly any language.

      I for example use them sometimes for the initial "frame" of Dart/Flutter languages.

      I worked a while with an unknown LLM (unknown, as it was a research project and the LLMs involved did not disclose their names), that LLM claimed it only needs to see the grammar or examples of a private language I use.

      As I never bothered to write a formal grammar for it, I gave it a few thousand lines of code. Then it started asking a few questions, an

      • by SlashbotAgent ( 6477336 ) on Tuesday September 08, 2026 @09:30AM (#66328266)

        I understand. It's true most AIs can generate code in virtually any language. But, my experience has been that the code quality drops precipitously if the language is not one of the ones I've mentioned and as the code base grows.

        SQL is great. C and C# not so great. Powershell, surprisingly bad after about 50 or more lines.

        • by allo ( 1728082 )

          python and js is great. I think rust is fine, because the language has some hard rules, which are easy to follow and in case the AI does not follow them the compiler gives a hard error. AIs can iterate quite well on hard errors, the weakness is subtle mistakes that can't be caught by compilers, linters, etc.

          • Pretty good at shell scripting too. Very well-documented.
            • by allo ( 1728082 )

              Yeah, but why? A shell script is usually a grown command line, which first was a breve concatenation of a few commands. If you have a LLM to do it again from scratch, let it use a better programming language. Analyzing and maintaining existing shell scripts is fine, but why generate new ones?

              • I usually use shell scripts just to cobble existing commands together and add minor features, sometimes mainly from looking at history, or when she'll functions feel too long for .bashrc or whatever. I use it because I know the syntax already, and the man pages are convenient, and there's no compile, and they're pretty easy to extend. For example, convert all .flax files in all subdirectories to .mp3 and replicate metadata to them - easy in shell, not sure what other language would be easier, less code, and
                • by allo ( 1728082 )

                  I usually use them until they are either slow because of spawning too many programs or become unreadable or fragile (escaping paths with special characters can become messy) and then rewrite in python.

                  • I think we agree. At some level of complexity, shell is definitely the wrong approach, especially for anything that should have tests, reusable code, compile-time error detection, strong typing, efficiency, and so forth. But for simple things like converting flacs to mp3, most of the CPU is going into the conversion, not the process spawning, the logic is pretty straighforward, and there's not much to test. Along the way on that project, the AI must have suggested that I also do some visualization of the me
                    • by allo ( 1728082 )

                      Yes, I think I agree very much. And python is just a personal choice and not necessarily the best (it doesn't enforce type checks). The point is to have something that syntax checks, runs in a single process, has a reasonable standard library and a syntax that doesn't want to expand variables and macros everywhere. Look at how bad a for loop over file lists can break in bash. In python a list of strings doesn't care about spaces, in bash you can do for file in *.txt; but if you try for file in $MY_FILE_LIST

                    • I have definitely learned and otherwise benefited from shellcheck, but it's not enforced the way a compile or even pre-run complete syntax parse would be, so too easy to skip without a supporting code management process. There's also bash -n, though I have never used it, and nothing would force one too.

                      Your point about variables that contain lists is almost reason enough to avoid shell scripting altogether. The requirements and syntax for various forms of quoting (such as backticks and equivalents) can b
              • Sorry, one more reason: for things I want to call from .bashrc. It helped me with this one that removes duplicates from history and sorts it so that latest commands appear last (YMMV). I could probably do this with any language, but the shell tools made it easier, and an AI gave me pointers. shopt -s histappend

                export HISTCONTROL=ignoreboth
                export HISTSIZE=10000
                export HISTFILESIZE=10000

                HISTFILE="$HOME/.bash_history"

                if [[ -z "$HISTFILE" || ! -f "$HISTFILE" ]]; then
                echo "Error: HISTFILE is no
              • maintaining existing shell scripts is fine, but why generate new ones?
                Because they run on linux and on windows and Macs and other Unixes just fine?

                The interpreter is preinstalled ... and frankly, I used Python only for "toys" so far, or gluing together some stuff.

                So I would need to learn a lot of things ...

                I find bash okay for scripting, and there is a "new shell" called Fish, which has a nicer language.

                https://fishshell.com/ [fishshell.com]

                • by allo ( 1728082 )

                  You don't know how many /bin/sh scripts with bashisms I've seen. Shell scripts are a mess and you notice errors only when they arrive at the broken line. Use a scripting language that at least catches basic syntax errors.

      • The Web page for Lox mentions Scheme. One of the List-like descendants of Scheme is Racket [racket-lang.org], which has some features intended to facilitate making new languages. Racket also replaces data types with a "contract" system. For anyone who might be interested.
    • by kertaamo ( 16100 ) on Tuesday September 08, 2026 @11:30AM (#66328472)

      We have used LLM's to generate a lot of Rust very successfully. I would rather trust AI generating Rust than almost any other language because the Rust compiler is so fussy about types and object lifetimes that it gives the LLM far less opportunity to sneaky silly, hard to find, errors in. Also Rust's error messages are very comprehensive and helpful, which LLM's make good use of.

      • Agreed, I use scala almost exclusively, the same things that make a language great for humans also make it great for AI, a compiled, type safe secure language gives you guarantees that python/javascript crap cannot.
    • Years ago I used an LLM to generate most of almost 10,000 lines of rust, generally in small pieces. I was impressed. There were certainly issues, but I think those were largely issues with rust, specifically crates (too many options, documentation not always perfect or complete). From my perspective, rust is rather complicated, especially the crate issues. I think the AI did about as well as it would with any language. I ended up in a few loops ("do this, ok that didn't work, do that, ok that didn't work, d
  • I guess if you can't get talented and gifted developers you have no choice.
  • by ffkom ( 3519199 ) on Tuesday September 08, 2026 @08:04AM (#66328188)
    While AMD's efforts regarding the "amdgpu"-driver appear laudable, the one thing I spotted time and again when issues arose with that driver are crazy back-and-forth iterations of changing constants and similar trivial things because, apparently, the developers have too little, too imprecise, too volatile documentation at hand of what the hardware actually does. The management of voltages and clock frequencies alone has changed so many times already, often just replacing one problem with another... and no change in programming language can possibly fix this.

    Also, ROCm certainly is not in its pitiful state just because "the wrong programming language was used".
    • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Tuesday September 08, 2026 @08:44AM (#66328220) Homepage Journal

      This is an incredibly frustrating time to try to use a GPU in general. On Windows, both drivers are shit. On Linux, the closed source drivers are all shit, but the AMD OSS driver is pretty good. And despite this, AMD won't open the floodgates and give away enough information to actually make it as good as it could be. They have absolute proof that they cannot do as well as the community, but they absolutely refuse to let the data flow. And yet, they are still multiple times as helpful as Nvidia.

      • They have absolute proof that they cannot do as well as the community, but they absolutely refuse to let the data flow.

        I really wonder what they think they are hiding.

        • Probably NSA backdoors that were introduced at a time when there was no OSS driver available that they have to now maintain secrecy on or risk massive fines and prison terms (national security letters, if you are not familiar).
          • by gweihir ( 88907 )

            Exceptionally unlikely. The NSA cannot do magic and such a backdoor would need to access hardware it has no business accessing. That is blatantly obvious. In addition, any such backdoors (which will NOT be generally distributed, far too much risk of them being found and hence worthless), will sit in the CPU "security" processors that can, for example, wait for certain patterns to show up.

            That said, supply chain attacks on software and compromising developers (such as Microsoft...) are far easier.

        • by gweihir ( 88907 )

          Probably jus general no-clue management stupidity. I man, all other GPU makers can just invest a bit of time and money and find out everything anyways.

    • by gweihir ( 88907 )

      Rust does help somewhat, but, as Linus put it "Rust can prevents some errors, but it does not prevent logic bugs". The biggest advantage of Rust is IMO that it is not easy to learn. That should keep most of the low-skill coders (which is most coders, sadly) out. Obviously, LLM used as fake coders can eliminate that advantage. Another reason why that is generally a bad idea, especially as LLMs are nowhere near reasonable reliability and cause technological debt by writing longer and more complex code than a

      • I would imagine that the best language for AI to output would be whatever is easiest to audit by people. I Imagine that AI can take care of ensuring there are no memory leaks (either it can now or it will be able to do so soon), it is failable but perhaps not in the same ways as humans
        • by gweihir ( 88907 )

          Ah, no. LLM hallucinations and LLM limitations will not go away. And LLM code is never easy to audit for people. In fact, there is mounting evidence that reviewing LLM code is hard, boring, unrewarding and comes with major burnout risks. Unlike a junior dev that eventually understands what they are doing wrong and gets better at things (or gets removed), LLMs are doing the same mistakes over and over again and do not learn. And they are doing is verbosely, which makes things worse.

          Hence having an LLM create

      • by tlhIngan ( 30335 )

        Rust does help somewhat, but, as Linus put it "Rust can prevents some errors, but it does not prevent logic bugs".

        But in general, memory errors are some of the most common causes of a large variety of issues - using vulnerabilities. If you're not carefully tracking lifetimes of memory allocations (and in a kernel where the code is re-entrant, this gets tricky fast) it's way too easy to have issues like a use-after-free or a memory leak.

        At best, it's a kernel crash. At worst, it's a privilege escalation bug

  • ... has the full orchestra on it it seems. Reminds me of when every webdev was extolling the virtues of Ruby to whoever would listen. How often do you see any mention of it now?

    Wtf is the point of Rust at the to-the-metal level when by definition most of what you do will be unsafe memory wise? Seems to me like some Rust shills have been evangelising to devs still at the age where they can't differentiate marketing BS from fact.

    • by mattr ( 78516 ) on Tuesday September 08, 2026 @09:47AM (#66328308) Homepage Journal

      Not a Rust / GPU dev but what I got from some articles is it greatly reduces the surface area in which memory safety bugs can live, since only the to-the-metal areas are in unsafe blocks, plus Rust gives you synchronization support to avoid race conditions. The drawback is compile time and missing the newest parts of the ecosystem. Asahi Linux' Rust based Apple GPU driver has only 3% unsafe code so a lot less code can go wrong.
      https://www.reddit.com/r/rust/... [reddit.com]

    • Reminds me of when every webdev was extolling the virtues of Ruby to whoever would listen.

      Ruby on Rails is the best dynamically typed language available for Webdev. Python has more developers, so if you build on RoR, you might need to train some people. If you want a statically typed language for webdev (usually better on very large projects), C# as a language is great, but the ecosystem around Java is better.

      Wtf is the point of Rust at the to-the-metal level when by definition most of what you do will be unsafe memory wise?

      Rust is useful when you have to work with incompetent programmers, which is most of them these days, especially those who write kernel drivers. If you encapsulate the driver accesses in fun

    • by Somervillain ( 4719341 ) on Tuesday September 08, 2026 @10:33AM (#66328398)

      ... has the full orchestra on it it seems. Reminds me of when every webdev was extolling the virtues of Ruby to whoever would listen. How often do you see any mention of it now?

      Wtf is the point of Rust at the to-the-metal level when by definition most of what you do will be unsafe memory wise? Seems to me like some Rust shills have been evangelising to devs still at the age where they can't differentiate marketing BS from fact.

      WTAF Dude? Have you been so burnt by the past that you can't see when the industry does something right for a change? Rust gives nearly indistinguishable performance from C with memory safety and nearly equal efficiency. Isn't that what greybeards have been clamoring for since Java arrived (PSA: Java is nearly as fast as C for long running processes, like servers, but a HOG for RAM)? While I am too new at it to find rust intuitive or pleasant (I still understand C more), you can't argue with the results.

      Ruby was a massive failure because arrogant hipsters coupled a pretty good idea (rails) with a dogshit arrogant language that traded masturbatory elegance for performance and usefulness. You already know this, I wager.

      Rust delivers. Now regarding nVidia? Well, I am not GPU driver dev, but I would wager that it's not going to be manipulating memory registers. However, the nVidia driver download is nearly 1 GIGABYTE. I am sure a LOT of that code is not manipulating memory, but high-level functions that could benefit from Rust.

      • Java is only a "Hog for RAM" if you write code for that hogging.

        Old school Java had not "concurrent garbage collection".

        So it literally ran until the memory was used up, and the moment you called "new Object()" the memory allocator said: oops we are out of memory.

        As multithreaded clean up is not trivial (at that time, because no one really knew how to do it), the VM stopped all threads, reclaimed unused memory and did the so called "stop the world garbage collection".

        In our times, we have concurrent multi t

        • Java is only a "Hog for RAM" if you write code for that hogging.

          Old school Java had not "concurrent garbage collection".

          So it literally ran until the memory was used up, and the moment you called "new Object()" the memory allocator said: oops we are out of memory.

          Has nothing to do with Java or with (insert other perceived memory hungry language) - it is a matter how you program.

          Remember all the claims of java being just as fast and memory efficient some two decades ago. At the time I found them mildly amusing. Today I assume those who persist with the same assertions especially using unfalsifiable doing it wrong / it's the programmer nonsense are merely engaged in gaslighting.

          Whatever happened to the operating systems written in java running on processors that natively execute java byte-code? Enough time has elapsed to where any inertia based excuses should have been overcome

          • Our entire stack runs in a smaller footprint than the ram needed to fire up a JVM just to print "Hello World".

            Obviously. And that was not the point.

      • by pla ( 258480 )

        I would wager that it's not going to be manipulating memory registers.

        That's pretty much what device drivers do. They turn high-level calls to do X into bare-metal instructions. And they very much need to deal with all the ugliness that entails to do their job well.

        I'm very much in favor of safer languages and tools for user-mode programming (heck, I consider SQL my third main language), but firmware ain't for everyone. If you don't need to think in terms of cycles, side effects, execution units, and pipelining, sure, save your sanity and use whatever language makes it eas

  • by Anonymous Coward
    If they are so "elite" why do they need a language like Rust to hold their hands?
  • Trust? (Score:2, Insightful)

    by Murdoch5 ( 1563847 )

    ” Rust is not incidental to this role. You will help establish how Rust is used in performance-sensitive and high-trust parts of the GPU stack, including the compiler and tooling support, system interfaces, engineering practices, and validation methods required for production deployment. You will have the opportunity to influence both near-term implementations and the longer-term architecture for using Rust across current and future AMD platforms.”

    Who is going to use Rust in a trusted compute environment? Rust isn't trustworthy, it has no mechanism for independent validation or verification using cross compilation from multiple toolchains. Rust is often regarded as being “memory safe”, which it absolutely is not, since it has an “unsafe” keyword. You can't have an “unsafe” keyword and at the same time claim you're safe. Even without the unsafe keyword, you can still corrupt memory, which effectively makes all

    • I've never used Rust, in fact I'm highly dubious of it due to some of its limitations, but posts like these just make me more interested. All the right people seem to hate it.
      • The hatred mostly comes from the nonsense people spew about it. For instance, the memory safety, which isn't even a possible consideration any more. A while back people on Slashdot were arguing me that Rust had memory-safety due to how they defined it. Memory safe is an absolute, it's either there or it's not, and the fact Rust has an “unsafe” keyword absolutely destroys the concept of memory safety, without argument.

        Then you get into problems like its language spec doesn't exist as a final
    • Re:Trust? (Score:4, Informative)

      by dremon ( 735466 ) on Tuesday September 08, 2026 @01:07PM (#66328666)

      it has no mechanism for independent validation or verification using cross compilation from multiple toolchains

      You can compile an older toolchain with mrustc [github.com] (which is a C++ project), and then work your way up to the recent version.

      Rust is often regarded as being “memory safe”, which it absolutely is not, since it has an “unsafe” keyword. You can't have an “unsafe” keyword and at the same time claim you're safe

      "Unsafe" sections in Rust are typically small isolated code blocks, in contrary to legacy system programming languages like C and C++, where the entire application is unsafe.

      Even without the unsafe keyword, you can still corrupt memory

      No, you cannot corrupt memory outside of unsafe block. As far as I remember, there was one compiler bug where you could bypass the borrow checker with some very tricky code, however I don't think you can find this in production.

      • Let's assume they removed that bypass issue, maybe they have, I don't know, but it's irrelevant, the existence of the “unsafe” keyword, instantly removes the lack of safety, hence “unsafe”. The fact you can turn off the safety, makes the safety not absolute, so at best Rust could be considered “sometimes memory safe”, but so is C, so nothing improved in that regard.

        It needs an independent compiler, not an older one built upwards, that would just produce the same lack o
    • Re:Trust? (Score:5, Insightful)

      by thegarbz ( 1787294 ) on Tuesday September 08, 2026 @01:12PM (#66328678)

      Rust is often regarded as being “memory safe”, which it absolutely is not, since it has an “unsafe” keyword.

      I think you may have just written the dumbest words ever put to text in a technical context (sorry but Slashdot politics still has your post beat). The whole point of memory safety is that you explicitly need to make a conscious decision to avoid it and do so in an auditable way.

      • No, memory safety is an absolute, you either can or cannot corrupt memory. The way people treat memory safety is the way vegetarians claim they don't consume or use animal products, so cheese is okay, but not beef? Milk is okay, but again, not beef? At what point are you just hand waving trying to seem like you care, but don't, and can't even fake it?
      • by Anonymous Coward

        I think you may have just written the dumbest words

        And we all know you're a shithead from the sheer number of shitposts [slashdot.org] you do on a daily basis.

        • Actually, I don't mind that person, I know we disagree a lot, but, I enjoy the back and forth with them.
    • by ksw_92 ( 5249207 )

      A number of US TLAs appear to be actively developing in Rust and requiring contractors implementing "high-side" systems to do the same. C++ seems to be on its way out now. Not sure if that's the smart move. There's millions of man-hours in C++ libraries and utilities that likely need to be converted, if the edict is "Rust only" for sensitive systems. Kinda reminds me of the Ada days.

      • I have no opinion on C++, I've done effectively zero programming in it. I think the disconnect is that people want all the handholding, and dictator like control, without realizing the dictator is Trump, and have to lie to defend it.

        Rust might turn out to be an excellent solution, but it's not there yet, so from an engineering prospective, it's not an option if you really have a sensitive system. You can write bulletproof C, or probably bulletproof any language, you just have to understand what you're d
    • by kertaamo ( 16100 )

      Any programming language needs the equivalent of Rust's "unsafe". Without it would be impossible to do any input or output. The language would be useless. It is far better to have such unsafe code clearly wrapped up and delimited in "unsafe" blocks rather than have memory unsafely permeate the entire code base.

      Why are people using C++? The spec for the language isn't finished, the tooling isn't finished.

      Rust has met the claims of its creators extremely well. It's not Rust's fault if some crazy "evangelists

      • Any programming language needs the equivalent of Rust's "unsafe". Without it would be impossible to do any input or output.

        U wot? unsafe in Rust lets you scribble cheerfully over memory. That's different from I/O.

        Why are people using C++? The spec for the language isn't finished,

        I don't even...? I mean the spec for C++23 is finished and ratified. The spec for C++26 isn't but 2026 isn't over yet...

        the tooling isn't finished.

        What as in all C++ compilers have failed to reach their final versions with no upda

      • C++ has a stable spec, and stable tooling. I don't understand why you've never done multi tool chain verification, but, I have, I've used XC8, GCC and Clang to verify the build of critical systems. The reason for that was to make sure a byte error wasn't present, as XC8 had a known issue that the same build done repeatedly could produce different output.

        Before Rust can be considered ready for production, it needs a stable spec, multiple compilers that are independent, and, it has to drop the stupid, id
      • > Any programming language needs the equivalent of Rust's "unsafe"

        Not really, no.

        > Without it would be impossible to do any input or output.

        Have you ever used any programming languages other than C, C++, etc? The important thing is that the language itself implements an interface between the OS and programs written in that language. In addition to that, most usually have an ABI that can be used to glue assembler libraries to the language - this is not the equivalent of "unsafe", because it's not part

    • An utterly stupid comment.

      Hint: it is possible to write a Rust program, that does not use the "unsafe" keyword.

      • Yes, you could write your program to not use it, but, how about all the libraries, and tooling? Unless your entire chain / stack is free from any unsafe keywords, it's basically useless. Even if your stack has no use of “unsafe”, the fact “unsafe” exists at all, destroys the concept of memory safety. If Rust is going to claim memory safety, without being memory safe, why not just claim anything at all? Rust is the only language that can make mythical unicorns real, it's just as va
        • "unsafe stuff" can not travel into the "save world".

          So: it is not useless.

          You can completely narrow down where something "unsafe" is happening.

          No idea what your problem is, did you ever even program anything?

          There is no reason at all that program can not be 100% safe. By simply not having the need to use any "unsafe" stuff.

          I program mostly in Dart, all my code is 100% safe.

          • The point people keep making about Rust is that it's memory safe. Except for the large flashing issue in the room, that it is not memory safe, objectively, it has a keyword, to disable the safety. This is black and white, if Rust is memory safe, so is C, you could avoid pointers, overflows, underflows, and all the other ways to corrupt memory, and by the logic of Rust developers, that's memory safety. I'm not suggesting anything major, just drop the idea of memory safety, or, remove any ability to intera
            • The keyword makes a single variable, or a small block of code "unsafe".

              The rest of the code is still safe. So what is your problem?

              You do not grasp the concept?

              Well, your problem, then continue to code in C, and everything in your code is unsafe, and you can safe the usage of the keyword unsafe.

              Of course you could fake the keyword:
              #define unsafe

              And off you go!

              When you have to write safe code, that is used for automotive, or military, you can't use pointers, function pointers, or the cool new features of mos

              • They'll reject the code, they do source level review, I've been in those meetings. Specially they complained about an inline ASM block that was setting up boot parameters for a PIC32 microcontroller, that had to use that initialization routine, due to a bug in the USB stack. The other point you brought up, C is not unsafe, the developer writes unsafe C code, C is just as safe as Rust, if you're not a fraud as a developer. If memory can be corrupted, then you can't claim memory safety, it's black and white
                • You have some serious misconceptions.

                  Either it is a linguistic problem, that you do not grasp the meaning of words, or you are a kind of autist.

                  I am happy that you are not in my team.

                  I simply do not like to argue about idiotic claims like this:
                  C is not unsafe, the developer writes unsafe C code, C is just as safe as Rust,
                  If you do not intentionally write unsafe code in Rust: the code is safe.
                  If you write C, then frankly, an uneducated moron - or idiotic nitpicker - like you seem to be: does not know if the

                  • We're clearly not going to agree, which is fine, I think we're divided enough as to render any more functional talks about this pointless.

                    Safety is either absolute or it's not, a degree of safety, which is what Rust provides, is the same as not having safety at all, from a functional standpoint. All I'm saying by that statement is you have to assume you have no safety. Why start with the assumption that what you're going to build is safe, so you can be unprofessional, rushed, sloppy, and careless? What i
                    • Safety does not need to be absolute to be present.

                      It is just your idiotic definition of your perceived idea of "safety". A safety belt is a safety belt. Nevertheless your car can be hit by a fuel truck, spilled all over and catch fire.

                      for instance not misusing NULL, but do you trust them, or, do you write code to check them?
                      Nope, if a language is null safe, like Dart, I do not check for null.

                      That would be idiotic.

                      The compiler would optimize away the null check, as it perfectly well knows: it can not be null

                    • The problem isn't setting the pointer to 0, it's forgetting to free that pointer. If you wrote the value zero into it, you either did it accidentally, or, you meant to, which you'll find on review. I would add a comment above where you set the pointer to zero, explaining why it's being to set to zero. It wouldn't recommend randomly overwriting variables and pointers, unless you're doing something obvious with line of sight. A good rule of thumb is 50% of your code base should be comment, for that reason

Your mode of life will be changed to ASCII.

Working...