Re: Help Finding Strange Memory Bug (Code linked to C library)

2013-12-08 Thread Craig Dillabaugh
On Saturday, 7 December 2013 at 23:11:39 UTC, Rémy Mouëza wrote: My strategy here would be to: A. run the program in a debugger, say GDB, to get a exhaustive stacktrace for hints about where to look at. B. have a quick look at the library directly (the Use the Source Luke strategy). Since I

Re: Help Finding Strange Memory Bug (Code linked to C library)

2013-12-08 Thread Craig Dillabaugh
On Saturday, 7 December 2013 at 23:35:49 UTC, Ali Çehreli wrote: On 12/07/2013 03:11 PM, Rémy Mouëza wrote: the last pointer, `double * padfMaxBound` is actually a pointer to an array of 4 elements: Great sleuthing! :) This thread is a good example of C's Biggest Mistake:

Re: Help Finding Strange Memory Bug (Code linked to C library)

2013-12-08 Thread Ali Çehreli
On 12/08/2013 12:16 AM, Craig Dillabaugh wrote: I cannot for the life of me figure out why I didn't think to check that! D has already ruined your mind! :p Ali

Help Finding Strange Memory Bug (Code linked to C library)

2013-12-07 Thread Craig Dillabaugh
Hello, I recently wrote bindings to the C-library Shapelib (it reads/writes a common file format used in Geographic Information Systems). I've been trying to write a small test program to make sure my bindings 'work' and I've come across a bizarre memory bug. I THINK I've identified the

Re: Help Finding Strange Memory Bug (Code linked to C library)

2013-12-07 Thread Rémy Mouëza
My strategy here would be to: A. run the program in a debugger, say GDB, to get a exhaustive stacktrace for hints about where to look at. B. have a quick look at the library directly (the Use the Source Luke strategy). Since I was curious about your problem (you had everything correct -

Re: Help Finding Strange Memory Bug (Code linked to C library)

2013-12-07 Thread Ali Çehreli
On 12/07/2013 03:11 PM, Rémy Mouëza wrote: the last pointer, `double * padfMaxBound` is actually a pointer to an array of 4 elements: Great sleuthing! :) This thread is a good example of C's Biggest Mistake: http://www.drdobbs.com/architecture-and-design/cs-biggest-mistake/228701625 Ali