Closed vamshikrishna83 closed 2 years ago
@bvkrish83 duplicate of #2038 and a mitigation is in place as of 7.59.5 (so updating will resolve that for now)
I still experience this error with oh-my-posh version 7.70.0
using the default theme:
oh-my-posh fatal error rendering path segment:runtime error: invalid memory address or nil pointer dereference
goroutine 19 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.18.0/x64/src/runtime/debug/stack.go:24 +0x65
oh-my-posh/engine.(*Segment).renderText.func1()
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:326 +0x58
panic({0xb90b40, 0x1646900})
/opt/hostedtoolcache/go/1.18.0/x64/src/runtime/panic.go:838 +0x207
strings.Count({0x0?, 0xc00006c8a0?}, {0xc2a548?, 0xc000205200?})
/opt/hostedtoolcache/go/1.18.0/x64/src/strings/strings.go:47 +0x50
strings.Replace({0x0, 0x18}, {0xc2a548, 0x1}, {0xc2a532, 0x1}, 0xffffffffffffffff)
/opt/hostedtoolcache/go/1.18.0/x64/src/strings/strings.go:1003 +0xcf
strings.ReplaceAll(...)
/opt/hostedtoolcache/go/1.18.0/x64/src/strings/strings.go:1037
oh-my-posh/environment.DirMatchesOneOf({0xd601f0, 0xc0002260e0}, {0x0?, 0xe?}, {0x16b3d40, 0x0, 0x0?})
/home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:724 +0x76
oh-my-posh/engine.(*Segment).cwdExcluded(0xc0000fc140)
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:209 +0xde
oh-my-posh/engine.(*Segment).shouldIncludeFolder(0xc0000fc140)
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:182 +0x36
oh-my-posh/engine.(*Segment).renderText(0xc0000fc140, {0xd601f0?, 0xc0002260e0?})
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:332 +0x7b
oh-my-posh/engine.(*Block).renderSegmentsText.func1(0x0?)
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/block.go:88 +0x65
created by oh-my-posh/engine.(*Block).renderSegmentsText
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/block.go:86 +0x98
@MovGP0 this time, it's a different issue though. There's one element we still need to synchronize it seems. BTW, which platform is this (I'm assuming Windows as that's the only place where I can see this fail)?
@MovGP0 this time, it's a different issue though. There's one element we still need to synchronize it seems. BTW, which platform is this (I'm assuming Windows as that's the only place where I can see this fail)?
Windows 11 (v10.0.22598 / Kernel 6.3) / PowerShell 7.2.2
@MovGP0 I pushed an update, can you see if that fixes the issue for you?
@MovGP0 I pushed an update, can you see if that fixes the issue for you?
Just had the problem again:
oh-my-posh fatal error rendering path segment:runtime error: invalid memory address or nil pointer dereference
goroutine 19 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.18.0/x64/src/runtime/debug/stack.go:24 +0x65
oh-my-posh/engine.(*Segment).renderText.func1()
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:326 +0x58
panic({0xb90b40, 0x1646900})
/opt/hostedtoolcache/go/1.18.0/x64/src/runtime/panic.go:838 +0x207
strings.Count({0x0?, 0xc0000667e0?}, {0xc2a548?, 0xc000200f60?})
/opt/hostedtoolcache/go/1.18.0/x64/src/strings/strings.go:47 +0x50
strings.Replace({0x0, 0x2}, {0xc2a548, 0x1}, {0xc2a532, 0x1}, 0xffffffffffffffff)
/opt/hostedtoolcache/go/1.18.0/x64/src/strings/strings.go:1003 +0xcf
strings.ReplaceAll(...)
/opt/hostedtoolcache/go/1.18.0/x64/src/strings/strings.go:1037
oh-my-posh/environment.DirMatchesOneOf({0xd601f0, 0xc0000be000}, {0x0?, 0xe?}, {0x16b3d40, 0x0, 0x0?})
/home/runner/work/oh-my-posh/oh-my-posh/src/environment/shell.go:724 +0x76
oh-my-posh/engine.(*Segment).cwdExcluded(0xc000292140)
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:209 +0xde
oh-my-posh/engine.(*Segment).shouldIncludeFolder(0xc000292140)
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:182 +0x36
oh-my-posh/engine.(*Segment).renderText(0xc000292140, {0xd601f0?, 0xc0000be000?})
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/segment.go:332 +0x7b
oh-my-posh/engine.(*Block).renderSegmentsText.func1(0x0?)
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/block.go:88 +0x65
created by oh-my-posh/engine.(*Block).renderSegmentsText
/home/runner/work/oh-my-posh/oh-my-posh/src/engine/block.go:86 +0x98
Unfortunately, this error only occurs occationally and is not always reproduceable.
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
Get-PoshThemes to display all themes supported by OhMyPosh. With recent versions, for some themes, this is resulting in below stacktrace. Multiple themes are resulting in similar looking failure, which makes me think the issue is not related to themes.
Theme
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output