[Pythonmac-SIG] Problems with Tk (I think)

Kevin Walzer kw at codebykevin.com
Fri May 7 16:35:18 CEST 2010


On 5/6/10 10:28 AM, Jan Erik Moström wrote:
> I'm new to Tk so it might be something that I might be doing wrong but I have a crash that I can't find the cause to.
>
> The error message I get on the crash is:
>
> python(19468,0x7fff70f5cbe0) malloc: *** error for object 0x1002c5a10: double free
> *** set a breakpoint in malloc_error_break to debug
> Abort trap
>
>
> This is using the standard 2.6.1 version on OS X 10.6.3, but version 2.5 give the same result.
>
> When I try this using a linux box (v2.5.2) the program runs as it should.
>
> I tried to using the debugger to single step through the critical lines and it seem to crash when it should return from a menu item handler.
>
> The code for that handler looks like this
>
> 	def saveToFile(self):
> 		filename = dlg.asksaveasfilename()
> 		self._storage.store(filename,self._win.getText())
>
> Single stepping seem to indicate that the call to self._win.getText() works just fine, the store command saves some text to a file and the file is created with the correct text, but then something seem to happen:
>
> (Pdb) s
> --Return--
>> /Users/jem/Desktop/testing.py(96)saveToFile()->None
> ->  self._storage.store(filename,self._win.getText())
> (Pdb) s
> 2010-05-06 15:40:54.806 Python[19589:d07] *** __NSAutoreleaseFreedObject(): release of previously deallocated object (0x1011466f0) ignored
>
>
>
> Does anyone have an idea what could be causing this?
>
> The complete code is available at<http://tmp.myownsnapshots.com/pyproblem>  (and yes, I know that the code looks a bit strange but I have my reasons :)
>
> - jem
> _______________________________________________
>

I'm able to run your code on Leopard (10.5.8) with Python 2.6.2 and a 
64-bit Cocoa-based build of Tk (similar to the system Tcl/Tk on Snow 
Leopard) and I don't see any crashes; I'm not able to reproduce this 
error. You might actually want to consider filing a bug with Apple, 
because this type of crash is coming from deep within Python or Tk's 
internals--not in your code.

--Kevin

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com


More information about the Pythonmac-SIG mailing list