I have been able to get rid of reported memory leaks in Instruments not by fixing a leak but by adding some lines (like releasing a previous nil object) that convinced Instruments it is not a leak.
But I am stuck are some I cannot stop Instruments from reporting. It reports a leak in this code
if(expr.length>0)
{ // add previous Atomic
Atomic *atom = [[Atomic alloc] initWithString:[string substringWithRange:expr] isNumber:aNum];
[exprTokens addObject:atom];
[atom release];
}
}
and it underlines the substringWithRange method. I changed code to explicitly release atom and I assumed substringWithRange would return an autoreleased new string. I am aware Instruments tells you where the leaked object is created and not where it is leak, but only things created here are atom and a sub string and atom is released immediately.
The initWithString method might do it, but I don't find anything there. Also, while running instruments, this code is 8542 times (I am pretty sure always in the same context) and Instruments says it only leaks 61 times.
I don't now if there is misunderstanding are a code problem?
Graphical Debugger
RSS for tagDebug your app directly within the Xcode editor using Graphical Debugger.
Posts under Graphical Debugger tag
10 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
help me understand the crash report
this started happening from last update only
Translated Report (Full Report Below)
Process: dota2 [7353]
Path: /Users/USER/Library/Application Support/Steam/*/dota2.app/Contents/MacOS/dota2
Identifier: com.valvesoftware.dota2
Version: 1.0.0
Code Type: X86-64 (Translated)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2024-02-18 18:00:45.9766 -0500
OS Version: macOS 14.3.1 (23D60)
Report Version: 12
Anonymous UUID: 0F5E4D0D-9839-DF78-5C28-93F6D26A5763
Sleep/Wake UUID: 52D18CB1-ADD8-4A75-B6A1-C0CF4CF2A306
Time Awake Since Boot: 85000 seconds
Time Since Wake: 1722 seconds
System Integrity Protection: enabled
Notes:
PC register does not match crashing frame (0x0 vs 0x1032D1C08)
Crashed Thread: 0 MainThrd Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000441f0f660002
Exception Codes: 0x0000000000000001, 0x0000441f0f660002
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [7353]
VM Region Info: 0x441f0f660002 is not in any region. Bytes after previous region: 48357375344643 Bytes before following region: 65536781844478
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
Memory Tag 255 1823fb340000-1823fb380000 [ 256K] rw-/rwx SM=PRV
---> GAP OF 0x67960cc80000 BYTES
MALLOC_MEDIUM 7fba08000000-7fba10000000 [128.0M] rw-/rwx SM=PRV
Error Formulating Crash Report:
PC register does not match crashing frame (0x0 vs 0x1032D1C08)
Kernel Triage:
VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter
The "Debug View Hierarchy" feature of Xcode is very convenient to break down and debug a complex view hierarchy. But Metal content/layers/views do not render anything in this mode.
Is there some special flag that needs to be set on the layer to support the Xcode feature? Or some special callback that needs to be implemented?
I would naively assume that Xcode could do some kind of read-back from the window server or GPU, even for layers rendered via accelerated APIs like Metal or OpenGL, similar to what's done when recording/capturing the screen.
Filed as FB13509137
There have been occasional questions about remote debugging. Unfortunately I see a couple of them which were reasonable basic questions got no answer at all. I will try this again. A couple questions had some mention of lldb server. In some cases clearly the people asking the questions already knew a bit about remote debugging. Yet I can find no documentation about it.Does XCode or other tools that will work with XCode support debugging over the internet? If so what are the reqirements re XCode version and macOS version, whether the client and server can have unmatched versions, etc.?My immediate need (without extra steps) is to debug a process running on Sierra (no XCode installed yet) from a development system running XCode 7.3.1 under El Capitan.The need for remote debugging is to be able to diagnose crashes that don't happen on my development systems. There have also been questions concerning crash logs, but crash logs are of limited use unless the crash can be opened into a debugger with full ability to examine the stack and local variables.Thanks in advance!
While experimenting with AR view for different Product We came across an issue with Apples AR viewer where for glass (PBR Opacity) it is causing black patch to appear behind (Maybe Shadow).
https://sketchfab.com/3d-models/welcome-5ba96662ba8d4774951f33fead4bf9db
https://sketchfab.com/3d-models/candel-91b2059634e0478eb93777b0b2a726e9
We Tried to find work around but after doing multiple test but with all our experiments we came to the conclusion that Apple AR viewer is not able recognize the glass material and adjust the ground shadow as required.
Hello, I am facing an issue when debugging cpp code through the XCode after updating to XCode 15.0.
During debugging, in a variables watch view, it is shown for the collections (let's take std::vector as an example) that its size is 0 even if it is not. If I add it as an expression to watch, it is fine. Also if I print it in lldb console, it is also fine. Any thoughts on this?
Hi, i am developing a Metal renderer the Metal debbuger gives me an error when i try to debug a Fragment Shader. This is happening since i updated to sonoma and Xcode 15, before everything was working fine.
Also i want to mention that i have tried the Apples DeferredLightning demo project and it gives the same error so its not my projects fault.
Device: MacbookPro 16 2019 5300M
MacOs: 14.0
Xcode: 15.0
Error:
Unable to create shader debug session
Thread data is corrupt
GPUDebugger error - 15A240c - DYPShaderDebuggerDataErrorDomain (2): Thread data is corrupt
=== GPUDebugger Item ===
API Call: 16 [drawIndexedPrimitives:Triangle indexCount:26652 indexType:UInt32 indexBuffer:MDL_OBJ-Indices indexBufferOffset:0]
Resource: fragment_main
Is it possible to reduce the verbosity of logs from os_log when debugging an application? Specifically, can I filter to specific subsystems and / or exclude DEBUG logs using configuration?
Hello everyone! I try to debug a shader for SwiftUI(which was introduced in iOS17) as I understand this is sort of uber shader system. but it looks like there are no available source code for SwiftUI shaders in Xcode? as I understand I need that so Xcode will allow me to edit my small [[stitchable]] part. Anyone has succeeded in using shader debugger for SwiftUI shaders?
xcode 15, macos 14, ios 17
I'm looking for instructions on how to set up XCode to debug a Preference Pane project in XCode 8.