Thank you for this explanation! You are a great teacher and this helped me fix my memory leak in one hour instead of one week
@MikeShah Жыл бұрын
Cheers!
@shawnkuo65666 ай бұрын
Seriously, how do you resize the left half screen at 5:54 ?
@MikeShah6 ай бұрын
Check out my tmux tutorial: kzbin.info/www/bejne/bpfdp4OwarVjh5Y (Around the 3 minute mark I show you how to move and split windows)
@MrNaderz3 жыл бұрын
You're a great educator Mike
@MikeShah3 жыл бұрын
Thank you Salim!
@parul94553 ай бұрын
After adding printf, why memory allocated is 1056 bytes, earlier it was 32 bytes
@MikeShah3 ай бұрын
timestamp? I suspect printf allocates, or at least on first use could allocate memory.
@tweetyguy7347Ай бұрын
@@MikeShahit’s at the very end of the video
@MikeShahАй бұрын
@@tweetyguy7347 It seems that in printf (which is a call to vfprintf) there are several calls to malloc (example implementation: github.com/lattera/glibc/blob/master/stdio-common/vfprintf.c) -- so I suspect somewhere there's a buffer of 1024 bytes that must get allocated.
@stepside6874 Жыл бұрын
Thank you so much. It helps me a lot.
@MikeShah Жыл бұрын
Cheers!
@amitrastogi1405 Жыл бұрын
Excellent Video. Thanks!
@MikeShah Жыл бұрын
Cheers!
@sallaklamhayyen98762 жыл бұрын
Thank you So Mike you are a great teacher by NATURE 😘
@MikeShah2 жыл бұрын
Cheers, thank you for the kind words!
@saranshgautam30117 ай бұрын
nice tutorial. very helpful!
@MikeShah7 ай бұрын
Cheers!
@_Anna_Nass_2 жыл бұрын
Do you have a video that covers what you did in the first few seconds of this video? I understand the C code and why we got a seg fault but I'm not as familiar with the Linux command line.
@MikeShah2 жыл бұрын
Ah, as far as the terminal goes, check out: the Terminal Masterclass in this playlist: kzbin.info/aero/PLvv0ScY6vfd-GGT-aUH31X2yXgBSYXo6t
@_Anna_Nass_2 жыл бұрын
@@MikeShah will do, thanks!
@shaharrefaelshoshany94423 жыл бұрын
AMAZING !! best explanation
@MikeShah2 жыл бұрын
Cheers!
@JackSparrow-tt3xg9 ай бұрын
Professionals Use : GDB Legends use : printfs logs
@MikeShah9 ай бұрын
🤣 Sometimes all you have is printf :)
@eddyecko94 Жыл бұрын
Thanks. I’m a C++ guy but I like this
@MikeShah Жыл бұрын
Cheers!
@vkatasonov7 ай бұрын
Hello, Mike. I wanted to ask if you having some problems using leaks on Mac 💻 with M chip? I was trying to use memory leaks monitoring using methods you were speaking about in other videos, but it seems with Sonoma I don’t have access to usr/bin 🤷♂️
@MikeShah7 ай бұрын
I can't remember if in that video I elevated my privileges to super user (sudo or su). That may have been necessary, or otherwise is one thing you can try. There's probably a better fix though than to have to get elevated priveleges -- though that is something I'll have to test when I upgrade my Mac.
@vkatasonov7 ай бұрын
@@MikeShah Thx a lot, if you will have answer to this issue I would be very appreciate. I'm trying to solve this problem as soon as I'm passing a huge course of C programming and that tool was absolutely magic for me. Everytime I run leaks --atExit-- , I have that crazy 2185 segmentation fault sudo leaks --atExit-- . I was trying to switch off SIP, but it still doesn't work. And it seems that $PATH I have introduce correctly because there is leaks tool in the system which leaks /usr/bin/leaks
@MikeShah7 ай бұрын
@@vkatasonov Worse case if you can use a VM on valgrind that should immediately reveal answers. Otherwise, this may be a helpful post in regards to Mac and Sonoma: forums.developer.apple.com/forums/thread/738804
@vkatasonov7 ай бұрын
@@MikeShah I was trying to use VM on UTM but valgrind there doesn’t work. The only solution I see is Docker with Linux or idx from google
@CarlosLeePerez3 жыл бұрын
I have two follow up questions about Valgrind. I am currently having difficulty getting to the stage you are on, thanks to my Linux Lite naivete. How would you recommend, I create the right environment on Linux Lite to go from merely having Valgrind installed to allowing the terminal to recognize the valgrind command, which you used? Secondly, is my asking this sort of question here in the comments a good way of reaching out to you?
@MikeShah3 жыл бұрын
Hi Carlos, yes comments are a good way to reach out, I try to give one response to as many as I can--though cannot debug 1:1 with folks :) If Ubuntu is an option, that'll setup the environment right away. If you're constrained to Linux Lite, then my guess is you're missing some base packages or dependencies for Valgrind. I'd reach out directly through their contact otherwise: www.valgrind.org/downloads/current.html
@matheens66892 жыл бұрын
How to check vptr and v table in c++
@MikeShah2 жыл бұрын
info vtbl will do the trick. I show some of this on my "Hands on Debugging" course on courses.mshah.io/
@paulfloyd9258 Жыл бұрын
Even more fun (for users): using valgrind vgdb and gdb together.
@MikeShah Жыл бұрын
Cheers -- agreed!
@sallaklamhayyen98762 жыл бұрын
Mike since you are a professional C++ developer can you make a practical and hands on Object Oriented programming course and share with us your experience ?
@MikeShah2 жыл бұрын
Will consider developing something in the future :)
@sallaklamhayyen98762 жыл бұрын
@@MikeShah thank you for your time and efforts
@Quancept Жыл бұрын
thanks Mike :)
@MikeShah Жыл бұрын
You are most welcome!
@cprn.2 жыл бұрын
I'm disappointed you didn't mention you can run `valgrind --vgdb=yes` and connect gdb to valgrind.