5/25/2023 0 Comments Code c++ macIn that context languages like Swift and Rust are memory safe, but C and friends are not. I’m specifically referring to memory safety here. Quinn “The Eskimo!” Developer Technical Support Apple If you’re working in an unsafe language (C, Objective-C, C++), these sanitisers are the only way to… hey hey… stay sane. In the debugger I see that mid is 12 and i is 0, which means you’re accessing arr, which is out of bounds. When I ran the pogram it pinpointed the exact point where things go wrong, namely line 14: a2 = arr I then enabled Address Sanitizer, as described in Diagnosing Memory, Thread, and Crash Issues Early. To uncover this I plonked the code into an Xcode project (creating from the macOS > Command Line Tool target) and ran it on my Apple silicon Mac (Xcode 13.1 on macOS 12.1). This bug results in undefined behaviour, which explains why it works on some platforms and fails mysteriously on others. Its open-source and comes with features such as code compiling, debugging. Integers in the output with random integers. CodeLite is a powerful code editor that supports Windows, macOS, and Linux. The weird thing I am facing is that sometimes it replaces some
0 Comments
Leave a Reply. |