Re: autorelease pool page corrupted

Ronald Oussoren <[email protected]> Thu, 24 Oct 2013 13:55:20 +0200
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
On 22 Oct, 2013, at 15:49, Jake Wang <[email protected]> wrote:

> Hi,
> 
> I used PyObjc in a python application for monitoring some global events:
> 
> class MacOSXEventMonitor():
>     def init(self):
>         log.debug("Initializing events monitor for Mac OS X...")
> 
>         self._observer = NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(
>             NSLeftMouseDownMask
>             | NSLeftMouseUpMask
>             | NSRightMouseDownMask
>             | NSRightMouseUpMask
>             | NSMouseMovedMask
>             | NSLeftMouseDraggedMask
>             | NSRightMouseDraggedMask
>             | NSMouseEnteredMask
>             | NSMouseExitedMask
>             | NSScrollWheelMask
>             | NSKeyDownMask
>             | NSKeyUpMask
>             | NSAlphaShiftKeyMask
>             | NSShiftKeyMask
>             | NSControlKeyMask
>             | NSAlternateKeyMask
>             | NSCommandKeyMask
>             | NSNumericPadKeyMask
>             | NSHelpKeyMask
>             | NSFunctionKeyMask
>             | NSFlagsChangedMask, self.handleEvent)
> 
>     def handleEvent(self, event):
>         # NSLog(u"%@", event)
> 
>     def stop(self):
>         NSEvent.removeMonitor_(self._observer)
> 
> It is strange that each time when I exit the application, the following error printed in console:
> 
> objc[8775]: autorelease pool page 0x1009e0000 corrupted
>   magic 0x1009ff00 0xc0000000 0x00000000 0x60000000
>   pthread 0x7fff7e917180
> 
> Also a system dialog shown (please see the screenshot attached).
> 
> Anyone encountered this before? Much appreciate for any suggestions/help.

(I'm sorry if this arrives twice, I just noticed that an earlier attempt at replying seems to be dropped to the floor by mail.app...)

Do you have a self-contained program that demonstrates the problem? I can get callbacks to handleEvent by embedding the code above
in a small app, but the app doesn't crash in the way you mention.

Ronald

> 
> Thanks,
> Jake
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk_______________________________________________
> Pyobjc-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk