<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 12, 2017 at 6:40 PM, Brian Cain <span dir="ltr"><<a href="mailto:brian.cain@gmail.com" target="_blank">brian.cain@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>If you're willing to do extra legwork of multiple passes maybe you could try turning off features or reducing the scope of what's instrumented.<br></div><br>e.g.<br>* only "fsanitize=address" on small parts at a time<br></div></blockquote><div><br></div><div>This will help against CPU overhead, but not against memory overhead. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">* Turn off "detect_leaks" or "detect_stack_use_after_<wbr>return" (though this one was off by default)<br>* try disabling "-asan-stack" or "-asan-globals"<br><div><br><a href="https://github.com/google/sanitizers/wiki/AddressSanitizerFlags" target="_blank">https://github.com/google/<wbr>sanitizers/wiki/<wbr>AddressSanitizerFlags</a><br><a href="https://github.com/google/sanitizers/wiki/SanitizerCommonFlags" target="_blank">https://github.com/google/<wbr>sanitizers/wiki/<wbr>SanitizerCommonFlags</a><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Tue, Dec 12, 2017 at 6:23 PM, Michael Eisel via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, so when you say "<span style="font-size:12.8px">ASAN_OPTIONS=quarantine_size_</span><span style="font-size:12.8px"><wbr>mb=1:malloc_context_size=5", do you mean that it's one key-value pair with key "ASAN_OPTIONS" and value "</span><span style="font-size:12.8px">quarantine_size_</span><span style="font-size:12.8px">mb=1:malloc_c<wbr>ontext_size=5" ? I tried that, but unfortunately, the phone still crashes after a few minutes of typical usage. Here's the trace:</span><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">==1020==ERROR: AddressSanitizer failed to allocate 0x80000 (524288) bytes of SetAlternateSignalStack (error code: 12)</span></div><div><span style="font-size:12.8px">==1020==Process memory map follows:</span></div><div><span style="font-size:12.8px">  0x000195805000-0x000195819000  /System/Library/PrivateFramewo<wbr>rks/EmojiFoundation.framework/<wbr>EmojiFoundation</span></div><div><span style="font-size:12.8px">  0x0001b216e458-0x0001b216ee98  /System/Library/PrivateFramewo<wbr>rks/EmojiFoundation.framework/<wbr>EmojiFoundation</span></div><div><span style="font-size:12.8px">  0x0001ae3f0178-0x0001ae3ff328  /System/Library/PrivateFramewo<wbr>rks/EmojiFoundation.framework/<wbr>EmojiFoundation</span></div><div><span style="font-size:12.8px">  0x0001b315cf10-0x0001b315d070  /System/Library/PrivateFramewo<wbr>rks/EmojiFoundation.framework/<wbr>EmojiFoundation</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/EmojiFoundation.framework/<wbr>EmojiFoundation</span></div><div><span style="font-size:12.8px">  0x0001937e6000-0x0001937f8000  /System/Library/PrivateFramewo<wbr>rks/CoreFollowUp.framework/Cor<wbr>eFollowUp</span></div><div><span style="font-size:12.8px">  0x0001b20576f0-0x0001b2058280  /System/Library/PrivateFramewo<wbr>rks/CoreFollowUp.framework/Cor<wbr>eFollowUp</span></div><div><span style="font-size:12.8px">  0x0001add00b60-0x0001add06638  /System/Library/PrivateFramewo<wbr>rks/CoreFollowUp.framework/Cor<wbr>eFollowUp</span></div><div><span style="font-size:12.8px">  0x0001b31439a8-0x0001b3143c78  /System/Library/PrivateFramewo<wbr>rks/CoreFollowUp.framework/Cor<wbr>eFollowUp</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/CoreFollowUp.framework/Cor<wbr>eFollowUp</span></div><div><span style="font-size:12.8px">  0x00019447f000-0x00019448b000  /System/Library/PrivateFramewo<wbr>rks/SetupAssistantSupport.fram<wbr>ework/SetupAssistantSupport</span></div><div><span style="font-size:12.8px">  0x0001b20bd288-0x0001b20be258  /System/Library/PrivateFramewo<wbr>rks/SetupAssistantSupport.fram<wbr>ework/SetupAssistantSupport</span></div><div><span style="font-size:12.8px">  0x0001adfc1300-0x0001adfc4b38  /System/Library/PrivateFramewo<wbr>rks/SetupAssistantSupport.fram<wbr>ework/SetupAssistantSupport</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/SetupAssistantSupport.fram<wbr>ework/SetupAssistantSupport</span></div><div><span style="font-size:12.8px">  0x00019448b000-0x0001944b3000  /System/Library/PrivateFramewo<wbr>rks/SetupAssistant.framework/S<wbr>etupAssistant</span></div><div><span style="font-size:12.8px">  0x0001b20be258-0x0001b20bfbc8  /System/Library/PrivateFramewo<wbr>rks/SetupAssistant.framework/S<wbr>etupAssistant</span></div><div><span style="font-size:12.8px">  0x0001adfc4b38-0x0001adfcb630  /System/Library/PrivateFramewo<wbr>rks/SetupAssistant.framework/S<wbr>etupAssistant</span></div><div><span style="font-size:12.8px">  0x0001b30ff0f0-0x0001b30ff5d8  /System/Library/PrivateFramewo<wbr>rks/SetupAssistant.framework/S<wbr>etupAssistant</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/SetupAssistant.framework/S<wbr>etupAssistant</span></div><div><span style="font-size:12.8px">  0x00019511e000-0x000195138000  /System/Library/PrivateFramewo<wbr>rks/CoreSDB.framework/CoreSDB</span></div><div><span style="font-size:12.8px">  0x0001b2121128-0x0001b2121540  /System/Library/PrivateFramewo<wbr>rks/CoreSDB.framework/CoreSDB</span></div><div><span style="font-size:12.8px">  0x0001ae21d1b8-0x0001ae21f770  /System/Library/PrivateFramewo<wbr>rks/CoreSDB.framework/CoreSDB</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/CoreSDB.framework/CoreSDB</span></div><div><span style="font-size:12.8px">  0x000195819000-0x00019592c000  /System/Library/PrivateFramewo<wbr>rks/IMDPersistence.framework/I<wbr>MDPersistence</span></div><div><span style="font-size:12.8px">  0x0001b216ee98-0x0001b2170ae8  /System/Library/PrivateFramewo<wbr>rks/IMDPersistence.framework/I<wbr>MDPersistence</span></div><div><span style="font-size:12.8px">2017-12-12 16:18:59.529 [tid=189434][general][info] Download Manager --- Request is dispatched to download manager --- request key is /bq/update_events-A0F8564D-26E<wbr>2-45C2-A1B7-D540A2BFE249</span></div><div><span style="font-size:12.8px">  0x0001b3151788-0x0001b31517d8  /System/Library/PrivateFramewo<wbr>rks/IMDPersistence.framework/I<wbr>MDPersistence</span></div><div><span style="font-size:12.8px">  0x0001ae3ff328-0x0001ae4215b0  /System/Library/PrivateFramewo<wbr>rks/IMDPersistence.framework/I<wbr>MDPersistence</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/IMDPersistence.framework/I<wbr>MDPersistence</span></div><div><span style="font-size:12.8px">  0x000195138000-0x00019518e000  /System/Library/PrivateFramewo<wbr>rks/IMSharedUtilities.<wbr>framework/IMSharedUtilities</span></div><div><span style="font-size:12.8px">  0x0001b2121540-0x0001b21256c8  /System/Library/PrivateFramewo<wbr>rks/IMSharedUtilities.<wbr>framework/IMSharedUtilities</span></div><div><span style="font-size:12.8px">  0x0001ae21f770-0x0001ae239ad8  /System/Library/PrivateFramewo<wbr>rks/IMSharedUtilities.<wbr>framework/IMSharedUtilities</span></div><div><span style="font-size:12.8px">  0x0001b312bf50-0x0001b312bff0  /System/Library/PrivateFramewo<wbr>rks/IMSharedUtilities.<wbr>framework/IMSharedUtilities</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/IMSharedUtilities.<wbr>framework/IMSharedUtilities</span></div><div><span style="font-size:12.8px">  0x000196745000-0x0001968e4000  /System/Library/PrivateFramewo<wbr>rks/IMCore.framework/IMCore</span></div><div><span style="font-size:12.8px">  0x0001b21f60c8-0x0001b21ff2e1  /System/Library/PrivateFramewo<wbr>rks/IMCore.framework/IMCore</span></div><div><span style="font-size:12.8px">  0x0001ae607b68-0x0001ae648888  /System/Library/PrivateFramewo<wbr>rks/IMCore.framework/IMCore</span></div><div><span style="font-size:12.8px">  0x0001b31352b0-0x0001b3135cc0  /System/Library/PrivateFramewo<wbr>rks/IMCore.framework/IMCore</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/IMCore.framework/IMCore</span></div><div><span style="font-size:12.8px">  0x00019868f000-0x0001986ec000  /System/Library/PrivateFramewo<wbr>rks/IMAVCore.framework/<wbr>IMAVCore</span></div><div><span style="font-size:12.8px">  0x0001b23195d0-0x0001b231bf70  /System/Library/PrivateFramewo<wbr>rks/IMAVCore.framework/<wbr>IMAVCore</span></div><div><span style="font-size:12.8px">  0x0001aec98888-0x0001aeca8ae8  /System/Library/PrivateFramewo<wbr>rks/IMAVCore.framework/<wbr>IMAVCore</span></div><div><span style="font-size:12.8px">  0x0001b3158e28-0x0001b3158fe0  /System/Library/PrivateFramewo<wbr>rks/IMAVCore.framework/<wbr>IMAVCore</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/IMAVCore.framework/<wbr>IMAVCore</span></div><div><span style="font-size:12.8px">  0x0001a7670000-0x0001a7676000  /System/Library/PrivateFramewo<wbr>rks/TextInputUI.framework/<wbr>TextInputUI</span></div><div><span style="font-size:12.8px">  0x0001b2f184e0-0x0001b2f18a38  /System/Library/PrivateFramewo<wbr>rks/TextInputUI.framework/<wbr>TextInputUI</span></div><div><span style="font-size:12.8px">  0x0001b31c02a8-0x0001b31c0358  /System/Library/PrivateFramewo<wbr>rks/TextInputUI.framework/<wbr>TextInputUI</span></div><div><span style="font-size:12.8px">  0x0001b1211ac8-0x0001b1212690  /System/Library/PrivateFramewo<wbr>rks/TextInputUI.framework/<wbr>TextInputUI</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/TextInputUI.framework/<wbr>TextInputUI</span></div><div><span style="font-size:12.8px">  0x0001a39f1000-0x0001a3a08000  /System/Library/PrivateFramewo<wbr>rks/CoreAccessories.framework/<wbr>CoreAccessories</span></div><div><span style="font-size:12.8px">  0x0001b2c9e418-0x0001b2c9f070  /System/Library/PrivateFramewo<wbr>rks/CoreAccessories.framework/<wbr>CoreAccessories</span></div><div><span style="font-size:12.8px">  0x0001b06229b0-0x0001b06282b0  /System/Library/PrivateFramewo<wbr>rks/CoreAccessories.framework/<wbr>CoreAccessories</span></div><div><span style="font-size:12.8px">  0x0001b3150a98-0x0001b3150b81  /System/Library/PrivateFramewo<wbr>rks/CoreAccessories.framework/<wbr>CoreAccessories</span></div><div><span style="font-size:12.8px">2017-12-12 16:18:59.529 [tid=188882][general][info] Download Manager --- RequestTask is created at download manager ---  request key is /bq/update_events-A0F8564D-26E<wbr>2-45C2-A1B7-D540A2BFE249, dispatch_to_task_create delay is 0</span></div><div><span style="font-size:12.8px">  0x0001b5366000-0x0001baa0c000  /System/Library/PrivateFramewo<wbr>rks/CoreAccessories.framework/<wbr>CoreAccessories</span></div><div><span style="font-size:12.8px">  0x0001a1361000-0x0001a1616000  /System/Library/CoreServices/R<wbr>awCamera.bundle/RawCamera</span></div><div><span style="font-size:12.8px">  0x0001b2ad2850-0x0001b2aeb838  /System/Library/CoreServices/R<wbr>awCamera.bundle/RawCamera</span></div><div><span style="font-size:12.8px">  0x0001b02b2360-0x0001b02f97d0  /System/Library/CoreServices/R<wbr>awCamera.bundle/RawCamera</span></div><div><span style="font-size:12.8px">ERROR: Failed to mmap</span></div><div><span style="font-size:12.8px">Warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion.warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.</span></div><div><span style="font-size:12.8px">AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.</span></div><div style="font-size:12.8px"><br></div></div></div><div class="m_-3056870516172450454HOEnZb"><div class="m_-3056870516172450454h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 8, 2017 at 10:12 AM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">+ Devin and Kuba from Apple, who may have iOS-specific knowledge. <div><br></div><div>We've recently made several changes that make asan consume less memory, but</div><div>* these changes are not yet in Xcode 9 (I assume)</div><div>* I am not 100% sure these changes affect iOS (we tested only on Linux, Kuba has recently applied related patches for Mac)</div><div>* Your problem might be caused by something else</div><div><br></div><div>Typically the biggest source of memory consumption is quarantine and the stack trace storage (stack_depot).</div><div>If you are able to set ASAN_OPTIONS env var, please try this: </div><div>ASAN_OPTIONS=quarantine_size_m<wbr>b=1:malloc_context_size=5<br></div><div><br></div><div>quarantine_size_mb=1 limits the quarantine size (and thus reduces the ability to find use-after-free)<br></div><div>malloc_context_size=5 reduces the length of stack traces that asan stores for future bug reporting <br></div><div><br></div><div>If these don't help, we'll need more details (e.g. the iOS's analog of /proc/PID/maps for the process at the time of failure)</div><div><br></div><div>--kcc </div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-3056870516172450454m_8773295880916691568h5">On Thu, Dec 7, 2017 at 12:56 PM, Michael Eisel via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-3056870516172450454m_8773295880916691568h5"><div dir="ltr">Hi,<div><br></div><div>I'm working on an iPhone app that rarely runs out of memory normally, but with the address sanitizer on will crash after a couple minutes. I don't remember it crashing this much with Xcode 8's version of clang, but in any case I'm using Xcode 9 now. Although crashing after a couple minutes is fine for testing during development, I would like to distribute the app to internal testers with asan built into it, and I don't want to impact their experience so much. Is there any simple way to reduce memory use, e.g. by turning off some component of asan?</div><div><br></div><div>Thanks,</div><div>Michael</div></div>
<br></div></div>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-3056870516172450454gmail_signature" data-smartmail="gmail_signature">-Brian</div>
</font></span></div>
</blockquote></div><br></div></div>