# Nil variables inside @synchronized block in release mode

**URL:** <https://forums.swift.org/t/nil-variables-inside-synchronized-block-in-release-mode/58461>\
**Category:** LLDB\
**Created:** [June 25, 2022, 3:38am UTC](https://forums.swift.org/t/nil-variables-inside-synchronized-block-in-release-mode/58461 "2022-06-25T03:38:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucianoPAlmeida](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lucianopalmeida/32/2134_2.png) [@LucianoPAlmeida](https://forums.swift.org/u/LucianoPAlmeida)\
**Post date:** [June 25, 2022, 3:38am UTC](https://forums.swift.org/t/nil-variables-inside-synchronized-block-in-release-mode/58461/1 "2022-06-25T03:38:43Z")

</div>

Hey everyone,  
I was debugging an objc code today from a binary objc framework that was built in release mode and noticed that lldb was giving a `nil` for variables inside the method that has an `@synchronized`.  
Reduced example:

 ![Screen Shot 2022-06-25 at 00.23.54](https://global.discourse-cdn.com/swift/original/3X/c/0/c0ce287b31903e9bb0f8f98b19d3a93e97d9bd4a.png)

As we can see, is clear that url has a value, but lldb is unable to evaluate. It does work if built in debug mode, and initially I was leaning towards that this was expected due to optimizations, but is not like the variables were optimized away, and given that it works fine when not inside synchonized block was a little bit curious about the difference from the debugger perspective in a optimized build.  
The question here is if this is a bug/limitation of lldb today? Or expected due to how compiler handles synchonized block?  
I just want to understand even if is on a more high level why this happens for this specific case.  
Thanks =]

---

<div class="post-metadata">

**Author:** ![LucianoPAlmeida](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lucianopalmeida/32/2134_2.png) [@LucianoPAlmeida](https://forums.swift.org/u/LucianoPAlmeida)\
**Post date:** [June 25, 2022, 3:39am UTC](https://forums.swift.org/t/nil-variables-inside-synchronized-block-in-release-mode/58461/2 "2022-06-25T03:39:25Z")

</div>

cc @Adrian_Prantl, @augusto2112
