Cannot debug webview with iOS simulator, webview and xcode - debugging

execution suspends faithfully on a breakpoint in webkit's debugger, but a few moments later, the app crashes on the simulator (see attached screenshot). I am using
Xcode Version 6.3.2 (6D2105)
iOS Simulator Version 8.3
Safari Version 8.0.2 (10600.2.5, r185482)
It works well on the actual device.
Update: Now its happening in the device as well. The console says:
bool _WebTryThreadLock(bool), 0x16d32e00: Multiple locks on web thread not allowed! Please file a bug. Crashing now...
1 0x2e3ba3d7 <redacted>
2 0x226a5fed <redacted>
3 0x226a36ab <redacted>
4 0x226a39ff <redacted>
5 0x225f0201 CFRunLoopRunSpecific
6 0x225f0013 CFRunLoopRunInMode
7 0x2e3b9183 <redacted>
8 0x31065e23 <redacted>
9 0x31065d97 _pthread_start
10 0x31063b20 thread_start

Related

iPhone is busy: Making iPhone ready for development - iOS 15 - Xcode 13

I'm trying to run an app on iPhone 7 with iOS 15.0.2 but I receive this error:
iPhone is busy: Making iPhone ready for development
I searched online and did everything that was told me to do including:
Clean Build (CMD+SHIFT+K)
restart both devices
wait for 40 plus minutes
But nothing changed, I still receive the same loading error

AddressSanitizer provoking crash on MacOS Mojave with Chromium Embedded Framework

I'm trying to use ASan to debug code of my plugin (dynamic library) running in a big 3rd party host app which is using Juce and Chromium Embedded Framework (CEF).
It works fine on MacOS 10.11 (El Capitan) and XCode 8, but the very same app on a new MacBook with MacOS 10.14 (Mojave) and either XCode 9 or 11 first stops with EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0) and then crashes with EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) in
* frame #0: 0x000000011768fe78 Chromium Embedded Framework`___lldb_unnamed_symbol167560$$Chromium Embedded Framework + 88
frame #1: 0x000000011768fba5 Chromium Embedded Framework`___lldb_unnamed_symbol167550$$Chromium Embedded Framework + 37
frame #2: 0x00007fff5c522c99 libsystem_malloc.dylib`malloc_zone_malloc + 103
frame #3: 0x00007fff5c524191 libsystem_malloc.dylib`malloc_set_zone_name + 84
frame #4: 0x00000001011d9d2d libclang_rt.asan_osx_dynamic.dylib`wrap_malloc_set_zone_name + 173
frame #5: 0x0000000102002f1b libdispatch.dylib`_dispatch_client_callout + 8
frame #6: 0x0000000102004ba9 libdispatch.dylib`_dispatch_once_callout + 87
frame #7: 0x00007fff3ae6132d QuartzCore`get_malloc_zone(unsigned long) + 43
frame #8: 0x00007fff3ae6157a QuartzCore`CA::Transaction::set_disable_actions(bool) + 44
frame #9: 0x00007fff2da3f5a0 AppKit`-[NSView _updateLayerBackedness] + 414
frame #10: 0x00007fff2da2555e AppKit`-[NSView didChangeValueForKey:] + 65
frame #11: 0x00000001007e6550 Max`juce::NSViewComponentPeer::NSViewComponentPeer(juce::Component&, int, NSView*) + 640
frame #12: 0x00000001007e62a2 Max`juce::Component::createNewPeer(int, void*) + 50
I'm at a loss here even just about whether the problem lies in MacOS, ASan, CEF, Juce, or the host App.
I also tried to avoid interception of the functions above via ASan's suppression list, but never got it to work. Many thanks!
By default Chromium builds on Mac have allocator shim enabled which overwrites malloc zones and causes issues with ASAN. To disable it you have to build from sources with GN option use_allocator_shim=false.
Alternatively you can build Chromium with is_asan=true option to enable ASAN.
If none of your objects need this, I just discovered that you can actually entirely remove "Chromium Embedded Framework.framework" from said app's frameworks and things will still work ; this allows me to debug my externals with asan / ubsan :-)

Interface Builder crash with assert in IBPlatformToolFailureHandler.m

I'm using Xcode 7.0.1 and since several days I'm experiencing very frequent crash with the Interface Builder when setting properties of UIStackViews.
I have reproduced the issue with a very simple project created from scratch. This project just contains a Storyboard with a Single viewController that contains a UITableView with a UITableViewCell which contains 5 UILabels with several UIStackViews.
Every time I'm changing several properties of one of the UIStackView Xcode crash, with error below.
Sometime I can reopen the project and sometimes not (Xcode crash at startup). I have the same issue with the same project on my MacBookPro and my old white MacBook, all are running with the same version of Xcode and OS X El Capitain.
Any idea about a workaround or a way to fix it is welcomed.
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 7.0.1 (8228)
Build Info: IDEFrameworks-8228000000000000~5
App Item ID: 497799835
App External ID: 813434267
Code Type: X86-64 (Native)
Parent Process: ??? 1
Responsible: Xcode [2177]
User ID: 501
Date/Time: 2015-10-10 18:29:07.206 +0200
OS Version: Mac OS X 10.11 (15A284)
Report Version: 11
Anonymous UUID: 4CEF61B0-80F0-668D-225D-39382C5053E4
Sleep/Wake UUID: C7D655B2-BA3E-4DAF-AC3A-F9AB2B1609DC
Time Awake Since Boot: 13000 seconds
Time Since Wake: 8800 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
IBDocumentDidFinishEditingNotification
ProductBuildVersion: 7A1001
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-8191/InterfaceBuilderKit/Utilities/IBPlatformToolFailureHandler.m:315
Details: Failed to compute auto layout status IBLayoutConstraint, IBUILabel, IBUIStackView, IBUITableViewCell, IBUITableViewCellContentView, and IBUIView.
Encountered an error communicating with Interface Builder Cocoa Touch Tool. If you choose to file a crash report or Radar for this issue, please zip and attach the diagnostics at "/var/folders/q3/g2n6m_1x57583jym4b_808jw0000gn/T/IB-agent-diagnostics_2015-10-10_18-29-07_130000" to your crash report.
Exception name: NSInternalInconsistencyException
Exception reason: {objective 0x7ff0e2677310: <1:20> + <1:1>*0x7ff0e268c6c0.marker{id: 4430}}: internal error. Setting empty vector for variable UILabel:0x7ff0e4c71c20'Last Period'.Height{id: 4185}.
Exception backtrace:
0. CoreFoundation 0x0000000109dfbf4d __exceptionPreprocess
1. libobjc.A.dylib 0x0000000109875deb objc_exception_throw
2. CoreFoundation 0x0000000109dfbe9d +[NSException raise:format:]
3. Foundation 0x000000010944e930 -[NSISObjectiveLinearExpression setPriorityVector:forKnownAbsentVariable:]
4. Foundation 0x00000001095f01b7 __128-[NSISObjectiveLinearExpression replaceVariable:withExpression:processVariableNewToReceiver:processVariableDroppedFromReceiver:]_block_invoke
5. Foundation 0x000000010944b47f -[NSISLinearExpression enumerateVariablesAndCoefficients:]
6. Foundation 0x00000001095f0077 -[NSISObjectiveLinearExpression replaceVariable:withExpression:processVariableNewToReceiver:processVariableDroppedFromReceiver:]
7. Foundation 0x000000010944c5ae -[NSISEngine substituteOutAllOccurencesOfBodyVar:withExpression:]
8. Foundation 0x000000010944f5ed -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:]
9. Foundation 0x000000010944cf87 -[NSISEngine minimizeConstantInObjectiveRowWithHead:]
10. Foundation 0x00000001095ebe43 -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:]
11. Foundation 0x000000010944ae4e -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:]
12. Foundation 0x00000001095f2a09 -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:]
13. Foundation 0x000000010943f96d -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:]
14. UIKit 0x0000000107b31590 -[UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:]
15. UIKit 0x0000000107b31966 -[UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray:roundingAdjustment:mutuallyExclusiveConstraints:]
16. UIKit 0x0000000107b31adf -[UIView(UIConstraintBasedLayout) _tryToAddConstraint:roundingAdjustment:mutuallyExclusiveConstraints:]
17. IBCocoaTouchToolFoundation 0x00000001071e0ea0 -[IBCocoaTouchToolAutolayoutEngine tryToAddConstraint:toRepresentedView:roundingAdjustment:mutuallyExclusiveConstraints:]

Xcode 7 Playground execution EXC_BAD_ACCESS

Running the simplest, default code in Xcode 7 playgrounds... get the following error
Playground execution failed: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x8).
* thread #1: tid = 0x351bc3, 0x00000001062019ca libicucore.A.dylib`utext_clone + 22, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
* frame #0: 0x00000001062019ca libicucore.A.dylib`utext_clone + 22
frame #1: 0x000000010633ac42 libicucore.A.dylib`icu::RegexMatcher::reset(UText*) + 54
frame #2: 0x0000000106375414 libicucore.A.dylib`uregex_setText + 222
frame #3: 0x0000000103d1b445 Foundation`-[NSRegularExpression(NSMatching) enumerateMatchesInString:options:range:usingBlock:] + 2325
frame #4: 0x0000000103d65d7e Foundation...
Cannot run anything in playgrounds basically.
Running beta 4 (7A165t)
I also have Xcode 6.2 running playgrounds just fine on the same mac.
Complete reinstall of all versions of Xcode plus deleting folder Library/Developer fixes the issues (see https://forums.developer.apple.com/thread/13969).
I just had this issue - before a fresh install check you haven't got IOS simulator running in the background anywhere from another xcode project or previous session. Once I closed the IOS simulator, closed xcode and re-launched and opened the playground again it worked fine. Seems I had a problem with xcode trying to open multiple simulators.
EXC_BAD_ACCESS Exception thrown when you try to send a message to already released object.
Apple provides mechanics with special class NSZombie which replace every released object in memory.
You could find more details on following links:
http://www.touch-code-magazine.com/how-to-debug-exc_bad_access/
http://loufranco.com/blog/understanding-exc_bad_access

Xcode 4 line of crash in code

Xcode 3 would show me the line that caused a crash when debugging.
How do you turn this feature on in Xcode 4 ??
I have added an Exception Breakpoint as suggested here but no joy:
How to display the exact line of code causing application crash in xcode 4 debugger like in xcode 3.2

Resources