Debugging with Core Dumps

  Рет қаралды 66,052

Jacob Sorber

Jacob Sorber

Күн бұрын

Пікірлер: 103
@fbafelipe7666
@fbafelipe7666 3 жыл бұрын
keep in mind that sending core dumps may have privacy implications. For example, if Excel or Word crash and send a full core dump to microsoft, it would be sending the document the user was viewing/editing as a side effect (since it is loaded on memory), it is also true for any program data manipulate user files/data.
@karlforshaw
@karlforshaw 5 жыл бұрын
Another great video, and a massive help for all of us who love coding in C but haven't had much of a chance to use it professionally. Thanks Jacob!
@JacobSorber
@JacobSorber 4 жыл бұрын
I like C. It's pretty low-level, and it occasionally feels like chopping down a tree with a really sharp pocket knife, but from a language-standpoint it's pretty simple. The complications mostly come from the underlying system, which it doesn't hide from you-not the language.
@RakeshKumar-vm9xo
@RakeshKumar-vm9xo 3 жыл бұрын
@@JacobSorber True..
@thewavewarden3315
@thewavewarden3315 3 жыл бұрын
"You could fill up your disk pretty quick, especially with how frequently your code crashes." ROASTED
@kenwallace6493
@kenwallace6493 5 жыл бұрын
Mile-a-minute, dense, chocked full of stuff I missed or never knew. Wish I'd had a prof this knowledgeable when I went to college. Great stuff, Jacob!
@dineshbharti4454
@dineshbharti4454 4 жыл бұрын
Being a part of organisation as a QA, I find this video very helpful. Explained in a way which is very easy to understand. Thank you and keep sharing the knowledge.
@chasedoe2594
@chasedoe2594 5 жыл бұрын
That explosion break my ear lol
@JacobSorber
@JacobSorber 5 жыл бұрын
Sorry. I hope it heals. Segfaults are serious. :)
@hsaidinsan6345
@hsaidinsan6345 4 жыл бұрын
Your comment saved my ears 2 seconds before the Big Bang Thanks a lot 😅
@YuanweiLao
@YuanweiLao 3 жыл бұрын
Same here
@thepinback
@thepinback 2 жыл бұрын
Nice video! But of the most helpful things with core dumps is the ability to walk the call stack in gdb.
@User_Masuri
@User_Masuri Жыл бұрын
There isn’t a better video than this in the world!!
@mayuparge
@mayuparge 3 жыл бұрын
@Jacob Sorber... one of the best video on core dump analysis ...Thanks Jacob
@JacobSorber
@JacobSorber 3 жыл бұрын
My pleasure. Glad you liked it!
@abhisheksa6635
@abhisheksa6635 Жыл бұрын
Professional grade explanation, much appreciated.
@samjohnson5044
@samjohnson5044 5 ай бұрын
Thank you for this! I have a GTK widget that crashes every other leap year, will examine with the core dump.
@GeekyMino
@GeekyMino 4 жыл бұрын
Hi Jacob , this was a great video but I still have a question. When you deploy your code you are usually using release build which is optimized and probably won't have the debug symbols and further more the target might not have a lot of memory. So how can we use this core dump in such scenario?
@lyingcat9022
@lyingcat9022 Жыл бұрын
Good question. Sad I see no answer:(
@amritagrawal6681
@amritagrawal6681 4 жыл бұрын
Superb... Gonna watch all of his video... Thanks a lot sir...
@JacobSorber
@JacobSorber 4 жыл бұрын
You're welcome. All the best.
@yannisran7312
@yannisran7312 4 жыл бұрын
Loved the analogy and animation
@JacobSorber
@JacobSorber 4 жыл бұрын
Thanks. We had fun making it.
@matsim0
@matsim0 2 жыл бұрын
IAs someone who writes code for embedded systems and uses mainly python for tasks on my PC, this was _really_ interesting, because I didn't ever do a core dump - I mean, normally I don't even have a file system 😅
@andrewseaman2840
@andrewseaman2840 Жыл бұрын
Thanks. I enjoyed your video. I'm trying to run RLCraft (a modpack for Minecraft) and have fairly rudimentary coding skills and knowledge. Anyway, the crash report that I got when I loaded the launcher said, "Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again." So that's how I found your video. I still don't know what to do to fix the issue but I do now understand what it's talking about. Thanks
@axlslak
@axlslak 4 жыл бұрын
love the analogy with space travel. coredump are precious things. :)
@PrashantMarshal
@PrashantMarshal 4 жыл бұрын
For a detailed discussion, you could have talked about the "??" problem when debugging with coredump files.
@JacobSorber
@JacobSorber 4 жыл бұрын
Good idea for a future video. Thanks.
@BARaaz04
@BARaaz04 5 жыл бұрын
Great video... Thank you, Professor
@stelluspereira
@stelluspereira 2 жыл бұрын
Thankyou for helping the ‘C’ community
@moseschristopherb
@moseschristopherb 3 жыл бұрын
How to deal with coredumps that are generated/dumped in the target which is running on a different architecture? Assume, -> Host is x86 and Target is armhf -> Target doesn't have gdb/memory to debug on Target itself.
@swedishpsychopath8795
@swedishpsychopath8795 10 ай бұрын
I always thought that a core dump was something you had to submit to the CPU manufacturer (Intel/Amd/etc) or to NASA so that technicians in white lab coats could read the machine code that was in the CPU at the moment after the program crashed using an open CPU with lots of wires connected to it and where they looked at the contents of the memory with an electron microscope. But then it turns out that anyone can look at the program code with a simple debugger. Why couldn't they say this 40 years ago when I started as a programmer?
@SimonJentzschX7
@SimonJentzschX7 5 жыл бұрын
great video!, Since you usually don't release with debug-symbols, I wonder how useful the coredump may be in this case. How can you extract anything without debug-symbols?
@JacobSorber
@JacobSorber 5 жыл бұрын
Good question (and good idea for a future video). Debugging without debug symbols is definitely more painful. You can still look at the assembly. You can also release with debug symbols (accepting the downsides). Or, you can generate two versions of the binary (one with and one without debug symbols) and then use the debuggable version with the core dump. For release builds, I think I favor the last one.
@SimonJentzschX7
@SimonJentzschX7 5 жыл бұрын
@@JacobSorber Right, But as far as I understand it, if I put in Debug-Symbols I cannot use the optimize-flags.
@shushens
@shushens 4 жыл бұрын
Most of them are sending minidumps, along with other possible values. It would be lovely if you made a video on minidumps as well.
@JacobSorber
@JacobSorber 4 жыл бұрын
I'll see what I can do.
@MinusGix
@MinusGix 5 жыл бұрын
Thanks! Your videos are very informative, and have helped me a lot.
@JacobSorber
@JacobSorber 5 жыл бұрын
Glad they're helpful. Let me know if there are other topics you think I should cover.
@MinusGix
@MinusGix 5 жыл бұрын
​@@JacobSorber A video on the Linux (POSIX?) LD_PRELOAD environment variable would be interesting. Solving circular includes (such as with include guards) would be a useful video for people writing code. (Assuming you haven't already covered these, haven't yet watched all of the videos. They're quite good and to the point.)
@JacobSorber
@JacobSorber 5 жыл бұрын
@@MinusGix I have covered LD_PRELOAD (see the videos on shims) and include guards (fairly recent video on headers).
@MinusGix
@MinusGix 5 жыл бұрын
​@@JacobSorber Ah, ok. I had been watching the videos from oldest to newest to make sure I watched them in order, and hadn't gotten to them yet. There is inline asm (unsure if clang has it, but GCC does), but that's rather obscure and most people don't use it. Videos about common C patterns, such as common ways of structuring your programs would be interesting. (Such as writing code that uses flags, and why you would do such a thing.) Could go into common ways that C++ library methods are written using C. This bit me when I recently tried using the Windows Direct2D api as the way it's structured to translate to C isn't obvious (the docs are all for C++ as well..) but I don't know if that's a common way of translating C++ to C or not. There is writing a less-featured clone of a linux utility (perhaps ls?) and comment about the design decisions you make as you write it. That would be different from your usual videos though. Since you seem to do embedded fairly often (?) you could talk about writing efficient code, and how the compiler also at times knows better than you. Examining the assembled output of simple C programs to see how there can be differences. (godbolt.org is quite nice for such a thing, but this would also be a good way to also show some linux utilities)
@karthik2705
@karthik2705 Жыл бұрын
One of my binary crashed. And the bt is pointing to (static) library part I tried compiling library with debug sumbols enabled. But the bt is pointing to wrong code How to debug this scenario ?
@tobb10001
@tobb10001 3 жыл бұрын
So... If I set the limit to a finite number and the core dump gets truncated... how useful is it gonna be than? Can I be sure to at least have the stack in it then?
@MichelCarroll
@MichelCarroll 3 жыл бұрын
kill -SEGV 4787 "Oops, wrong pro..." *universe explodes*
@simonmaracine4721
@simonmaracine4721 4 жыл бұрын
This was very helpful. Thank you!
@GabinoHernandez-kt9js
@GabinoHernandez-kt9js 7 ай бұрын
I LOVE YOUR VIDEOS!!!!!
@GrozaRobertGenaro
@GrozaRobertGenaro 4 жыл бұрын
great, but an issue, i have a mac, running vscode on its terminal, when i tried gdb but it says "bash gdb command not found"
@JacobSorber
@JacobSorber 4 жыл бұрын
Yeah, gdb doesn't come installed by default on MacOS. Also, Apple favors clang and lldb, and has done some things that make it tricky to get gdb working well on MacOS.
@GrozaRobertGenaro
@GrozaRobertGenaro 4 жыл бұрын
Jacob Sorber yeah, lldb worked
@netanelkomm5636
@netanelkomm5636 2 ай бұрын
That intro is NOT a movie💀😭
@nischayranjan3728
@nischayranjan3728 2 жыл бұрын
"core" file is not being generated in my linux. I went through all the same commands, as it is explained in the video
@valekprometey
@valekprometey Жыл бұрын
Can I unlimit -c for certain processes, but not for all?
@sunnybambooflute
@sunnybambooflute Жыл бұрын
thanks for sharing the knowledge, btw we are using the same slack notify sound. lol
@namespace242
@namespace242 5 жыл бұрын
very helpful , thank you !
@albertomedinarobredo
@albertomedinarobredo 2 жыл бұрын
thanks matthew
@AnnatarTheMaia
@AnnatarTheMaia Жыл бұрын
You didn't explain how to compile the program to contain all the debugging information so that the core file could be debugged in situ on a remote system where the source code to step through would not be available, for example at a client's site.
@gauravsaini5549
@gauravsaini5549 3 жыл бұрын
very Informative, Thanks for the video!
@JacobSorber
@JacobSorber 3 жыл бұрын
You're welcome!
@surj8749
@surj8749 2 жыл бұрын
Great video
@XenoTravis
@XenoTravis 5 жыл бұрын
If you set it to like half the size of the full core dump is will that possibly not include the info you want or maybe not let the debugger run properly? I don't understand what information it absolutely needs.
@JacobSorber
@JacobSorber 5 жыл бұрын
Good question. If the core dump is larger than the limit, it won't save any of it (rather than saving part of the memory). It's all or nothing, because it would be difficult to know what memory is most helpful.
@XenoTravis
@XenoTravis 5 жыл бұрын
@@JacobSorber so what is the use of adding a limit if it won't use the limit?
@almosteasy9590
@almosteasy9590 5 жыл бұрын
@@XenoTravis maybe it means.. if the size is lesser than the limit then only make core dump, otherwise forget it.
@unsafecast3636
@unsafecast3636 4 жыл бұрын
My linux system has core dumps to unlimited by default. I'm using Arch
@bibloc5293
@bibloc5293 4 жыл бұрын
Are you sitting on the floor or some small chair? I am looking for ergonomic sitting positions as debugging can take hours or days.
@aniltadikamalla4236
@aniltadikamalla4236 3 жыл бұрын
I have some problem in usage of GDB. can you please help me out here?
@NeZversSounds
@NeZversSounds 3 жыл бұрын
Wait, that means the user finding bug will need to tinker with the machine (assuming can get admin privileges) then try to crash it again to actually get a core dump. Sounds like too many loops to jump to help the developer to fix the app. Then how those apps with crash reports can get it without that?
@redcrafterlppa303
@redcrafterlppa303 2 жыл бұрын
It's only an assumption. But I guess programs with crash reports run a small runtime that catches segfaults and saves them before the operating system receives and trashes them.
@sobad123
@sobad123 2 жыл бұрын
great video! thank u
@shivanaikrachanaikar2843
@shivanaikrachanaikar2843 2 жыл бұрын
i have core dump file how can i analyze it and which tool i need to download
@MrDimonsky
@MrDimonsky Жыл бұрын
My problem under Ubuntu - no core dumped generated. I tried everything already..
@Victor_Marius
@Victor_Marius 2 жыл бұрын
Are coredumps available in python?
@aidenpearce5724
@aidenpearce5724 4 жыл бұрын
is there any video about makefile that you uploaded ?
@JacobSorber
@JacobSorber 4 жыл бұрын
Yeah, I have a few. kzbin.info/www/bejne/l2nQgX54rbZshNE
@aidenpearce5724
@aidenpearce5724 4 жыл бұрын
@@JacobSorber thx jacob, hope you can make series about make more than 60 seconds 💪💪💪
@hdqhdjxiwj
@hdqhdjxiwj 2 жыл бұрын
sad little zero made my day
@first-thoughtgiver-of-will2456
@first-thoughtgiver-of-will2456 7 ай бұрын
what is this std bloatware you speak of I write my HAL in my applications
@MECHANISMUS
@MECHANISMUS 3 жыл бұрын
There's hope...
@activelivingchallenger4298
@activelivingchallenger4298 3 жыл бұрын
my school won't let me use ulimit -c to anything other than 0 on their machines. So I just used git and used it on my local machine. Hope that helps anyone.
@exploringlife9323
@exploringlife9323 Жыл бұрын
i didn't find core file after dump
@mehmetdemir-lf2vm
@mehmetdemir-lf2vm 3 жыл бұрын
rand()%255 should have been rand()&255 or rand()%256 :)
@sverkeren
@sverkeren 2 жыл бұрын
Not if the purpose was to generate random number from 0 to 254. :-)
@dnbndu
@dnbndu 3 жыл бұрын
Feeling sad for the one who was flying 🥲
@JacobSorber
@JacobSorber 3 жыл бұрын
Yeah, seg faults are sometimes scary and sad. But, I have it on good authority that he bailed out in time.
@dnbndu
@dnbndu 3 жыл бұрын
@@JacobSorber now I can sleep comfortably. 🙏
@leokiller123able
@leokiller123able 3 жыл бұрын
Poor Lego guy :(
@JacobSorber
@JacobSorber 3 жыл бұрын
I know. Tragic.
@recepbashir7216
@recepbashir7216 2 жыл бұрын
nice
@WilliamRaezer
@WilliamRaezer 10 ай бұрын
"Taint analysis" , "core dump".
@kapilverma2668
@kapilverma2668 3 жыл бұрын
How to write our own memory leak detector?
@JacobSorber
@JacobSorber 3 жыл бұрын
One way is to use a shim to intercept malloc, calloc, realloc, and free calls, and then keep track of what blocks have been allocated and their sizes, and then check to see what blocks aren't freed at the end.
@kapilverma2668
@kapilverma2668 3 жыл бұрын
@@JacobSorber Is it possible with MSVC on windows?
@BetaChri5
@BetaChri5 3 жыл бұрын
@@kapilverma2668 Yes
@kapilverma2668
@kapilverma2668 3 жыл бұрын
@@BetaChri5 How
@m4l490n
@m4l490n 4 жыл бұрын
lol, that was an overly dramatic intro. Oh boy, core files are certainly big. I have a small program that generates a 71MB core file.
@DipietroGuido
@DipietroGuido 3 жыл бұрын
"Now, when this program eventually crashes, as we knew it would, it says that it 'Core dumped'. It means the computer dumped the content of the process' memory when it crashed. Except for the fact that it really didn't. I'm sorry to break it to you, but sometimes computers lie." - Jacob the Sorber, 1984, University of Wakanda
@synchro-dentally1965
@synchro-dentally1965 3 жыл бұрын
3:00 The dump is a lie...
@franciscomelojunior2535
@franciscomelojunior2535 4 жыл бұрын
Starts at 2:00
@PrashantMarshal
@PrashantMarshal 4 жыл бұрын
A good introductory video, but a bad waste of 1 minute at the start. Cheers!
Can I Debug Release Code?
7:23
Jacob Sorber
Рет қаралды 13 М.
How do I access a single bit?
11:07
Jacob Sorber
Рет қаралды 22 М.
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 24 МЛН
How to Fight a Gross Man 😡
00:19
Alan Chikin Chow
Рет қаралды 19 МЛН
you need to stop using print debugging (do THIS instead)
7:07
Low Level
Рет қаралды 455 М.
Debugging Embedded Systems With GDB?
13:51
Jacob Sorber
Рет қаралды 48 М.
How processes get more memory. (mmap, brk)
6:50
Jacob Sorber
Рет қаралды 73 М.
why are switch statements so HECKIN fast?
11:03
Low Level
Рет қаралды 428 М.
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 347 М.
How to Crack Software (Reverse Engineering)
16:16
Eric Parker
Рет қаралды 722 М.
How GitHub's Database Self-Destructed in 43 Seconds
12:04
Kevin Fang
Рет қаралды 1 МЛН
How computer processors run conditions and loops
17:03
Core Dumped
Рет қаралды 160 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 151 М.
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 24 МЛН