163 karma · joined July 26, 2016
As already mentioned, perf can capture call stacks, but those are statistical samples, so not necessarily complete.
callgrind (https://www.valgrind.org/docs/manual/cl-manual.html) by contrast can capture all call-stacks.
kCacheGrind/qCacheGrind (https://kcachegrind.github.io/html/Home.html) can be used to view the output from either perf or callgrind. Sources for kcachegrind, including converters from perf, oprofile, etc., can be found at https://github.com/KDE/kcachegrind
Newer compilers complained more and more until gcc 8 which just silently ignored this awful hack -- no diagnostic, no error, just crickets.
Strictly speaking silently ignoring this atrocity is allowed by the standard, but it sure took a while to figure out. So be careful with code that "just works" even if it shouldn't.
But in general as a consultant your time is the product that the co. is selling. Never forget that.
I'm also not sure I've bought in to the way the devtoolset stuff works, by swapping symlinks around. AFAICT that means that only one version is available at any given time.
If you build and install your own tools, you can (and should) install them in a non-standard location -- once you do that, it's relatively simple to support multiple versions at the same time.
Although if it wasn't for the COW vs. SSO strings problem, I would have spent more time on the devtoolset approach, but the lack of true C++11-style strings was a deal-breaker for me. I would much prefer not to be building compilers, although once you've done it once, it's not too bad.
- RH devtoolset doesn't support clang, only gcc
-The compilers installed with the devtoolset packages on RH/CentOS 6 & 7 do not support the _GLIBCXX_USE_CXX11_ABI flag -- the old ABI (COW strings) is the only one supported. See https://bugzilla.redhat.com/show_bug.cgi?id=1546704 and https://stackoverflow.com/questions/50836145/glibcxx-use-cxx... for more info.
I beg to differ: http://btorpey.github.io/blog/categories/static-analysis/
On Linux I use ddd, and while it's definitely quirky (in that weird X way), it works just fine. I would guess that many of the poster's problems have to do with Linux's mediocre GUI support in general. I've recently switched to doing development on Ubuntu (vs. RH/CentOS) and all the GUI stuff works much better in that environment, incl. ddd.
I haven't tried Eclipse's C/C++ debugger, but its Perl debugger (part of EPIC) is quite nice and works well on both Mac and Linux.
https://probablydance.com/2020/10/31/using-tla-in-the-real-w...
Even more interesting is that Robert Fripp (a frequent Eno collaborator) composed the startup sound for Windows Vista: https://www.youtube.com/watch?v=B-LYZt2jisE
I switched to Mac almost 10 years ago, and I'm basically pretty happy with it. So when it looks like Apple is planning to screw it up, I get upset -- I don't want to switch again (it was a huge PITA), and there's nothing out there even remotely close.
The following seems to be working reasonably well so far:
- Each component has its own internal repo (in our case, we happen to use BitBucket). This repo contains any bits that are either proprietary and/or specific to our environment, like build scripts, integration with internal CI, etc.
- The open-source part of the component is hosted in an external repo on GitHub.
- The internal repo includes the contents of the external repo using git submodules (https://git-scm.com/docs/gitsubmodules).
We use a convention re: branch names:
- For projects that we don't own, "staging" is where our changes go before being submitted upstream as PR's.
- For projects that we do own, "staging" represents the current development "HEAD" -- our internal "master" branch includes the "staging" branch from the external repo.
- In either case, once a change has been approved for production use, it is committed to a release branch that is used to drive production builds.
Git submodules have a couple of features that make this easier:
- Each branch in the internal repo has its own .gitmodules file, which identifies which branch to fetch from the external repo. The .gitmodules file is an ordinary text file, and is managed just like any other file in the repo.
- Updating the submodule code in the internal repo is done by recording the hash of the specific commit from the external repo. This lets us control precisely which code from the external repo is included in builds (either development or production builds), and also provides an audit trail.
We used subtrees initially, and if there's not much traffic back and forth between the internal and external repos that can work, but it breaks down quickly as the repo becomes more active.
We've been working with ZeroMQ a lot over the past couple of years, and have gotten to know some of the maintainers -- we've been very favorably impressed by their ability and dedication.
Pieter Hintjens was the "voice" of ZeroMQ, and with his passing things have gotten a bit quieter, but no less active. (Just take a look at the commit log: https://github.com/zeromq/libzmq/commits/master).
- remove file/line#
- omit the bottom (top) frame, which can be different between environments
- convert certain constructs to a common format (e.g., "unknown module" (clang) to "???" (valgrind)
- translate "func@@GLIBC_version" => "func"
This works well enough in practice for our purposes (identifying regressions and suppressing specific reports from valgrind/Address Santizer).
We also maintain a xref between md5 hash and full stack trace.
> "But they’re from the factory," John says.
> "I’m from the factory too," I say "and I know how instructions like this are put together. You go out on the assembly line with a tape recorder and the foreman sends you to talk to the guy he needs least, the biggest goof-off he’s got, and whatever he tells you. ..that’s the instructions. The next guy might have told you something completely different and probably better, but he’s too busy."
> They all look surprised. "I might have known," DeWeese says.
https://github.com/CppCon/CppCon2015/blob/master/Presentatio...
Sorry -- couldn't resist ;-)
Personally, I'm happier with plain old text files that can be manipulated with awk, grep, etc., can be databased if needed (since they're csv files) -- and can also be compared using my all-time favorite software, Beyond Compare. (http://btorpey.github.io/blog/2013/01/29/beyond-compare/).
That's why I created tools to convert the output from different tools into a common CSV format that can be databased and used to compare output from different tools, or from different versions of the code (e.g., after fixing errors reported by the tools).
These tools currently work with cppcheck, clang and PVS-Studio and can be found here: http://btorpey.github.io/blog/categories/static-analysis/
There is no way I'm signing up for whatever it is they want you to sign up for.
I came up writing code in BAL, COBOL, PL/1 and a bunch of other non-OOP languages, and those who think procedural programming is better have probably never done it. The starting point for OOP, at least for me, was the splendid book "Reliable Software through Composite Design" by Glenford Myers, which was the first to study coupling, cohesion and other techniques that lead directly to OOP. This book still maintains a position of honor on my shelf, and I strongly recommend it for anyone doing software development. (You can get a pdf from https://archive.org/details/reliablesoftware00myer or buy your own hard-copy at https://www.amazon.com/Reliable-software-through-composite-d...).
Now, crappy programmers can write crappy code in any language, just as good programmers can write good code in any language -- the prevalance of crappy code speaks more to the numbers of crappy programmers than crappy languages. I would suggest that OOP enables crappy programmers to write code simply because without OOP crappy programmers wouldn't be able to write any code at all.
When functional programming is able to provide performance on a par with non-functional programming, we can talk about it. Until then it is a curiosity, but not ready for prime-time.
To paraphrase Winston Churchill's comments on democracy: "OOP is the worst programming paradigm ever invented -- except for all the other ones".
I suspect the same would happen with glibc. To be fair, the maintainers for these packages have a lot on their plates, and tend to pay more attention to submitters who they see often, so one-shots like these just don't bubble up to the top.