[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] callout from interp.c code to objc/swift code need autorelease pool (#374)
John M McIntosh
johnmci at smalltalkconsulting.com
Mon Mar 4 07:46:57 UTC 2019
Most of the callbacks to platform code are documented here
https://isqueak.org/PlatformVMAPI
....
John M. McIntosh. Corporate Smalltalk Consulting Ltd https://www.linkedin.com/in/smalltalk
Sent from ProtonMail Mobile
On Sat, Mar 2, 2019 at 09:20, maenu <notifications at github.com> wrote:
> Instead of the PR [#373](https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/373), maybe we should solve this issue. Below is the trace to the leak in [#373](https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/373), ioProcessEvents seems like an appropriate place for the autoreleasepool. How can we find other places that enter Objective-C and need a pool?
>
> Direct leak of 219512 byte(s) in 1193 object(s) allocated from:
> #0 0x10bb1fffc in __sanitizer_mz_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5dffc)
> #1 0x7fffdd224281 in malloc_zone_malloc (libsystem_malloc.dylib:x86_64+0x2281)
> #2 0x7fffc6de33d5 in AllocateAndInitializeEvent(__CFAllocator const*) (HIToolbox:x86_64+0x33d5)
> #3 0x7fffc6e3fc4d in CopyEventInternal(__CFAllocator const*, OpaqueEventRef*) (HIToolbox:x86_64+0x5fc4d)
> #4 0x7fffc6e49228 in CopyEventAs (HIToolbox:x86_64+0x69228)
> #5 0x7fffc6e1d349 in CreateEventWithCGEvent (HIToolbox:x86_64+0x3d349)
> #6 0x7fffc6e1b0e2 in CreateAndPostEventWithCGEvent(__CGEvent*, unsigned int, unsigned char, __CFMachPortBoost*) (HIToolbox:x86_64+0x3b0e2)
> #7 0x7fffc6e275cd in Convert1CGEvent(unsigned char) (HIToolbox:x86_64+0x475cd)
> #8 0x7fffc6e2745e in MainLoopObserver(unsigned int, OpaqueEventRef*, void*) (HIToolbox:x86_64+0x4745e)
> #9 0x7fffc6de8368 in _NotifyEventLoopObservers (HIToolbox:x86_64+0x8368)
> #10 0x7fffc6e10ea5 in RunCurrentEventLoopInMode (HIToolbox:x86_64+0x30ea5)
> #11 0x7fffc6e10bf8 in ReceiveNextEventCommon (HIToolbox:x86_64+0x30bf8)
> #12 0x7fffc6e10b25 in _BlockUntilNextEventMatchingListInModeWithFilter (HIToolbox:x86_64+0x30b25)
> #13 0x7fffc53a5a53 in _DPSNextEvent (AppKit:x86_64+0x46a53)
> #14 0x7fffc5b217ed in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (AppKit:x86_64+0x7c27ed)
> #15 0x10b7ce07c in -[sqSqueakOSXApplication(events) pumpRunLoopEventSendAndSignal:] sqSqueakOSXApplication+events.m:78
> #16 0x10b7ce7d9 in -[sqSqueakOSXApplication(events) pumpRunLoop] sqSqueakOSXApplication+events.m:105
> #17 0x10b7e4898 in vmIOProcessEvents sqSqueakEventsAPI.m:80
> #18 0x10b7e49c7 in ioProcessEvents sqSqueakEventsAPI.m:103
> #19 0x10b5b5653 in checkForEventsMayContextSwitch gcc3x-cointerp.c:62680
> #20 0x10b5c17ed in ceCheckForInterrupts gcc3x-cointerp.c:15188
> #21 0x119a75794 (<unknown module>)
> #22 0x10b566712 in interpret gcc3x-cointerp.c:2754
> #23 0x10b7ebada in -[sqSqueakMainApplication runSqueak] sqSqueakMainApplication.m:201
> #24 0x7fffc93786fc in __NSFirePerformWithOrder (Foundation:x86_64+0xd76fc)
> #25 0x7fffc78cfc56 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (CoreFoundation:x86_64h+0xa6c56)
> #26 0x7fffc78cfbc6 in __CFRunLoopDoObservers (CoreFoundation:x86_64h+0xa6bc6)
> #27 0x7fffc78b05f8 in __CFRunLoopRun (CoreFoundation:x86_64h+0x875f8)
> #28 0x7fffc78b0033 in CFRunLoopRunSpecific (CoreFoundation:x86_64h+0x87033)
> #29 0x7fffc6e10ebb in RunCurrentEventLoopInMode (HIToolbox:x86_64+0x30ebb)
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, [view it on GitHub](https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/374#issuecomment-468940443), or [mute the thread](https://github.com/notifications/unsubscribe-auth/AhLyW11A8LBgYYh3ih-GCmljcS1jPuzWks5vSrLcgaJpZM4bXsAc).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190304/9ab6d660/attachment-0001.html>
More information about the Vm-dev
mailing list