LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2009, 09:54 AM   #1
pgpython
Member
 
Registered: Dec 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 142

Rep: Reputation: 32
Problem with gdb


I am currently trying to write a python extension and am using gdb to find and fix problems in c. However recently i have found when building with -g. The extension crashes with malloc() memory corruption. When i try and create a python list with PyList_New. This does not happen when i remove -g. So im guessing -g has altered the way memory gets allocated in order to capture the info for debugging which is also breaking the extension. How do i fix this?
 
Old 09-27-2009, 10:18 AM   #2
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Possibly try using -ggdb or maybe even -gstabs+, -feliminate-unused-debug-symbols or a combination to give the desired debug information without causing the crashes.
The Python C API documentation mentions in it's memory management section that you should not use the C library memory management functions (like malloc) on python objects but I assume you are not doing this?

If you have not looked at this reference it may be useful anyway.I would be interested in the results if you manage to track this down.

Edit : Just thought I'd add this.. I've recently been looking at the cython method of writing C extensions for python - you may find it useful. You can find it here if you are interested.

Last edited by bgeddy; 09-27-2009 at 10:21 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with GDB hwoarang Programming 2 09-23-2008 02:36 AM
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
GDB problem zaheer031 Linux - Newbie 1 12-26-2004 11:50 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration