dis:
libswiftCore.so`swift_release:
-> 0x7ffff7016a90 <+0>: movq 0x1531b1(%rip), %rax
0x7ffff7016a97 <+7>: leaq 0x1912(%rip), %rcx ; __swift_release_
0x7ffff7016a9e <+14>: cmpq %rcx, %rax
0x7ffff7016aa1 <+17>: jne 0x7ffff7016ae2 ; <+82>
0x7ffff7016aa3 <+19>: testq %rdi, %rdi
0x7ffff7016aa6 <+22>: jle 0x7ffff7016acf ; <+63>
0x7ffff7016aa8 <+24>: movabsq $-0x200000000, %rcx ; imm = 0xFFFFFFFE00000000
0x7ffff7016ab2 <+34>: movq 0x8(%rdi), %rax
0x7ffff7016ab6 <+38>: addq $0x8, %rdi
0x7ffff7016aba <+42>: nopw (%rax,%rax)
0x7ffff7016ac0 <+48>: movq %rax, %rdx
0x7ffff7016ac3 <+51>: addq %rcx, %rdx
0x7ffff7016ac6 <+54>: js 0x7ffff7016ad0 ; <+64>
0x7ffff7016ac8 <+56>: lock
0x7ffff7016ac9 <+57>: cmpxchgq %rdx, (%rdi)
0x7ffff7016acd <+61>: jne 0x7ffff7016ac0 ; <+48>
0x7ffff7016acf <+63>: retq
0x7ffff7016ad0 <+64>: cmpl $-0x1, %eax
0x7ffff7016ad3 <+67>: je 0x7ffff7016acf ; <+63>
0x7ffff7016ad5 <+69>: movq %rax, %rsi
0x7ffff7016ad8 <+72>: movl $0x1, %edx
0x7ffff7016add <+77>: jmp 0x7ffff7018400 ; bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int)
bt:
* thread #2, name = 'gonzales', stop reason = breakpoint 1.1
* frame #0: 0x00007ffff7016a90 libswiftCore.so`swift_release
frame #1: 0x00005555556746af gonzales`specialized Integrator.estimateDirect(light=<unavailable>, interaction=$s8gonzales11InteractionVD @ 0x3cbc0b803d93417a, bsdf=gonzales.BSDF @ 0x00007ffff33fbb58, sampler=<unavailable>) at <compiler-generated>:0 [opt]
frame #2: 0x00005555556737dd gonzales`PathIntegrator.getRadianceAndAlbedo(from:tHit:for:with:) [inlined] generic specialization <gonzales.PathIntegrator> of gonzales.Integrator.estimateDirect(light: gonzales.Light, atInteraction: gonzales.Interaction, bsdf: gonzales.BSDF, withSampler: gonzales.Sampler) throws -> gonzales.BaseSpectrum<Swift.Float> at Integrator.swift:0:56 [opt]
frame #3: 0x00005555556737bd gonzales`PathIntegrator.getRadianceAndAlbedo(from:tHit:for:with:) at Integrator.swift:41:36 [opt]
frame #4: 0x0000555555673720 gonzales`PathIntegrator.getRadianceAndAlbedo(ray=<unavailable>, tHit=<unavailable>, scene=gonzales.Scene @ 0x0000555555706a60, sampler=0x000055555570eaa0, self=<unavailable>) at PathIntegrator.swift:56:35 [opt]
frame #5: 0x0000555555661974 gonzales`Tile.render(reporter:scene:sampler:camera:integrator:) [inlined] protocol witness for gonzales.Integrator.getRadianceAndAlbedo(from: gonzales.Ray, tHit: inout Swift.Float, for: gonzales.Scene, with: gonzales.Sampler) throws -> (radiance: gonzales.BaseSpectrum<Swift.Float>, albedo: gonzales.BaseSpectrum<Swift.Float>, normal: gonzales.Normal3<Swift.Float>) in conformance gonzales.PathIntegrator : gonzales.Integrator in gonzales at <compiler-generated>:0 [opt]
frame #6: 0x0000555555661951 gonzales`Tile.render(reporter:scene:sampler:camera:integrator:) at Tile.swift:37:66 [opt]
frame #7: 0x00005555556617a3 gonzales`Tile.render(reporter=(current = 120491, total = 262144, frequency = 10000), scene=gonzales.Scene @ 0x0000555555706a60, sampler=<unavailable>, camera=0x0000555555710fa0, integrator=(payload_data_0 = 0x0000000000000041, payload_data_1 = 0x00007ffff704dff0 libswiftCore.so`std::_Function_handler<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int), swift_getTypeByMangledNameInContext::$_7>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation), payload_data_2 = 0x00007ffff704de30 libswiftCore.so`std::_Function_handler<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int), swift_getTypeByMangledNameInContext::$_7>::_M_invoke(std::_Any_data const&, unsigned int&&, unsigned int&&), metadata = 0x00005555556dbce8, wtable = 0x00005555556dbd00 gonzales`type metadata for gonzales.PathIntegrator + 24), self=gonzales.Tile @ 0x00005587fbee4de0) at Tile.swift:12:48 [opt]
frame #8: 0x000055555565e0df gonzales`Renderer.renderTile(tile=<unavailable>, self=<unavailable>) at Renderer.swift:34:33 [opt]
frame #9: 0x000055555565e1bf gonzales`closure #1 in Renderer.renderAsync(tile:) at Renderer.swift:44:35 [opt]
frame #10: 0x000055555565e1ab gonzales`closure #1 in Renderer.renderAsync(self=0x00005555557069c0, tile=<unavailable>) at Renderer.swift:57:42 [opt]
frame #11: 0x000055555564b166 gonzales`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0 [opt]
frame #12: 0x00007ffff7d63287 libdispatch.so`_dispatch_call_block_and_release + 7
frame #13: 0x00007ffff7d75c40 libdispatch.so`_dispatch_worker_thread + 944
frame #14: 0x00007ffff6090402 libc.so.6`start_thread(arg=<unavailable>) at pthread_create.c:442:8
frame #15: 0x00007ffff611f590 libc.so.6`__clone3 at clone3.S:81
I tried to do one step (s) and then the above expression yielded:
(lldb) expr -l Swift -- let ptr = UnsafeRawPointer(bitPattern: `$rdi`); print("pointer:", ptr); print("meta:", unsafeBitCast(ptr, to: UnsafePointer<UnsafeRawPointer>.self).pointee); print(unsafeBitCast(ptr, to: AnyObject.self))
pointer: Optional(0x000055555570eaa0)
meta: 0x00005555556ec398
gonzales.RandomSampler
So I guess it's the RandomSampler that's released?
I also tried the following (/rdi/arg1/):
(lldb) expr -l Swift -- let ptr = UnsafeRawPointer(bitPattern: `$arg1`); print("pointer:", ptr); print("meta:", unsafeBitCast(ptr, to: UnsafePointer<UnsafeRawPointer>.self).pointee); print(unsafeBitCast(ptr, to: AnyObject.self))
pointer: Optional(0x000055555570eaa0)
meta: 0x00005555556ec398
gonzales.RandomSampler
I believe that's what was meant with $arg1, right?