[Programming] Tools to detect buffer overflow

Talk about anything else you want

Moderator: BigEvilCorporation

Post Reply
mickagame
Very interested
Posts: 256
Joined: Sat Jun 07, 2008 7:37 am

[Programming] Tools to detect buffer overflow

Post by mickagame » Sun Oct 19, 2014 6:34 pm

I'm working on my genesis emulator and i start to implement the sound part.
Since this part is terminated i have randomly crash and i'm sure is because buffer overflow occuring.
Does anyone know if exist tools to detect where there is data writing outside the alloctaed area?

I'm working with code::block and gcc compiler.

Thanks for your help !

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Sun Oct 19, 2014 6:38 pm

Hi,

off the top of my head:

Valgrind
UMDK Fanboy

mickagame
Very interested
Posts: 256
Joined: Sat Jun 07, 2008 7:37 am

Post by mickagame » Sun Oct 19, 2014 7:25 pm

I work on windows.
But your link help me to find windows substitute : drmemory

I will try to run my program with this tool :-)

Thanks

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Sun Oct 19, 2014 7:38 pm

I have no Windows programming experience whatsoever.

Electric-Fence if it is on Windows. If you use some kind of UNIX Shell such as Cygwin then you could use Valgrind. I work on the Command-Line most so those tools are open to me under most platforms.

Cheers,

Minty.
UMDK Fanboy

mickagame
Very interested
Posts: 256
Joined: Sat Jun 07, 2008 7:37 am

Post by mickagame » Sun Oct 19, 2014 8:36 pm

My emulator is cross-plateform so it wouldn't be difficult to developp it under linux.
I will try it because i'm curious t osee how it run on linux plateform.

=> Dr Memory help me to find the function where i was doing buffer overflow.
Now all is perfect ;-)

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Sun Oct 19, 2014 8:46 pm

mickagame wrote:My emulator is cross-plateform so it wouldn't be difficult to developp it under linux.
I will try it because i'm curious t osee how it run on linux plateform.

=> Dr Memory help me to find the function where i was doing buffer overflow.
Now all is perfect ;-)
Another useful one is STrace to really get into the meat of your Function calls.
UNIX also has plenty of Tools to debug Shared-Memory Segments and such - I feel sorry for anyone who has to develop for Windows :D
UMDK Fanboy

mickagame
Very interested
Posts: 256
Joined: Sat Jun 07, 2008 7:37 am

Post by mickagame » Mon Oct 20, 2014 8:26 am

Next week i will install linux and code::block and i will try it :-). But is very useful tools without that i would past somme hours to find this programming error!

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Mon Oct 20, 2014 8:58 am

UNIX generally has most it not all of the Tools. Historically many of the Tool and OS advancements arrived on UNIX first. The other thing is that good Tools are not lost between OSes and OS version so the same Tool that you used twenty years ago will still be there.

I had a guy working with me years ago who had not used VI the Editor for 17 years and he was straight back into using it without any issues as things worked and his knowledge was still valid.

UNIX respects knowledge and you will find that anything you learn can be relied up on.

I suppose that's why I love UNIX :)
UMDK Fanboy

Post Reply