SEARCH YOUR SOLUTION HERE  

Malloc error

Hi Group, I'm brand spanking new to Python. Never coded in it, but I'm comfortable coding in general in other languages. I'm Trying to get some legacy code to run on a newer machine. I don't have access to the ...

Posted On: Sunday 25th of November 2012 09:40:17 PM Total Views:  467
View Complete with Replies




Related Messages:

Re: Releasing malloc'd memory using ctypes?   (197 Views)
On Dec 23, 2007 12:36 PM, wrote: > I am starting to experiment with ctypes. I have a function which returns a > pointer to a struct allocated in heap memory. There is a corresponding free > function for that sort of struct, e.g.: > > from ctypes import * > > cdll.LoadLibrary("libthing.so") > c_thing = CDLL("libthing.so") > > class THING(Structure): > _fields_ = [("name", c_char_p), > ("value", c_int)] > > get_thing = c_thing.get_thing > get_thing.restype = POINTER(THING) > free_thing = c_thing.free_thing > > So I call get_thing() and get back this ctypes wrapper for a pointer to a > thing. I can extract the name and value elements from the thing instance > just fine: > > thing_p = get_thing() > thing = thing_p.contents > print thing.name, "=", thing.value > > Now I need to call free_thing. What do I pass it thing_p Some attribute > of thing_p Something else altogether The ctypes module docs seem to be > strangely silent on the question of freeing heap memory which you've > received from the underlying library's functions. > You do it just like you'd do in C, and pass the return value of get_thing. Make sure that you declare free_thing as taking a pointer so ctypes knows to do the right thing.
malloc error for newbie   (168 Views)
Very new to python. When I uncomment the line # self.im.putpalette(mkpalette()) in the following code, I get the error: python $ ./mandelbrot.py Python(2860) malloc: *** Deallocation of a pointer not malloced: 0xff000000; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug I don't have the expertise to get by this error. Can someone help
Asynchat and error handling   (108 Views)
, I'm trying to add some better error handling to an async_chat client. What I want is to retry or terminate gracefully if the connection to the server doesn't succeed. Here's what I have: import asyncore, asynchat, socket class http_client(asynchat.async_chat): ...
Re: Why gives "k = 09" a syntax error ?   (127 Views)
On 10/29/08, Stef Mientki wrote: > hello, > > Why gives "k = 09" a syntax error > 09 is not a valid octal number. Instead use 011. Ok, I guess you were not aware that prefixing a ...
Cathing several potential errors?   (267 Views)
if i do try: something except TypeError, IndexError: pass only the first error will get caught. I dont want to use Exception and catch all errors, but just 2. how can i do that...
import error between 2 modules   (134 Views)
I am new to python,and am learning from the tutorials i created 2 .py files like below and put the main in one of them empmodule.py ---------- from workmodule import Worker class Employer: def __init__(self,n): self.name=n self.worker=Worker() def getemployerName(self): return ...
SAX XML Parse Python error message   (127 Views)
SAX XML Parse Python error message My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me what the fix ...
error with configure (svn 64857)   (168 Views)
I have the following error when I run configure: checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) what can I do Mathieu...
wsdl2py throwing error while creating client side code   (185 Views)
I am developing an application using web services in python (ZSI Zolera Sopa Infrastructure) I am trying to create client side code of the wsdl file in the web service using wsdl2py. But i ended with an error from wsdl2py ...
Re: RotatingFileHandler - ShouldRollover error   (114 Views)
En Wed, 16 Apr 2008 10:50:44 -0300, escribi: > I am using the RotatingFileHandler logger with Python 2.5 on Windows and > I am getting an error on the rollover. When the log file gets close to > the ...
Urllib keyerror, confused   (205 Views)
I took this script: http://aspn.activestate.com/ASPN/Coo...n/Recipe/83208 And decided to try it out, it works when I first download a file, and when I try to resume a downloaded file, but if the file is already downloaded, and I expect to see ...
error with wxPython2.8-win32-unicode-2.8.7.1-py25.exe   (109 Views)
I recently upgraded wxpython (and python) on XP using wxPython2.8- win32-unicode-2.8.7.1-py25.exe Now when I run from wxPython.wx import * It crashes : -> import _wx ... from _misc import * .... --> 456 wxDateTime_GetNumberOfDaysinYear = wx._misc.DateTime_GetNumberOfDaysinYear .... AtributeError: 'module' object ...
Why gives "k = 09" a syntax error ?   (176 Views)
hello, Why gives "k = 09" a syntax error
Re: Syntax error in ".py" file and globals variable values notavailable.   (91 Views)
On Thu, Aug 28, 2008 at 1:40 AM, Alexis Boutillier wrote: > Timothy Grant a crit : >> >> On Wed, Aug 27, 2008 at 2:49 AM, Alexis Boutillier >> wrote: >>> >>> >>> >>> I have ...
Re: When I do from lxml import etree I've this error : AttributeError:'module' object has no attribute 'BytesIO'   (145 Views)
Le Mon, 25 Aug 2008 13:50:50 +0000, KLEIN Stéphane a écrit : > > > I'm on Ubuntu 8.04.1 > > I've installed lxml with easy_install lxml command. > > Now, when I load etree I've this error : > ...
python-mode errors   (129 Views)
When I start python mode I get the error: idle error: # -Wrong number of arguments : # 2" The Python mode version is 4.78 Is this a known problem
trying to use SOCK_RAW yields error "   (194 Views)
I am trying to create raw socket: server = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname('ip')) As a result I get the following error: Traceback (most recent call last): File "tcpsrv.py", line 14, in server = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname('ip')) File "/usr/lib/python2.5/socket.py", line 154, ...
origin of error message   (134 Views)
hi i was trying to create an image using user selection of a file in tix fileselection box ..and i check for exception like below .... from string import split from os.path import basename .... #this ...
where is the error?   (136 Views)
, I'm trying to assign data into an array with the nonzero function. There is my code. from numarray import * diff_temp=(logical_and(values[:,5] > -2,values[:,5] < 2)).nonzero() This command works fine but when I apply the following, values_matchup=values_Stumpf[diff_temp_Stumpf,:] I have this ...
Zipfile module errors   (175 Views)
I have a python script that supposed to go through a folder, pick the zipped files, unzip them and process the data inside. I'm not sure where i'm going wrong with this script because it all seems correct: #! ...