terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.

Home Page:https://d2lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SIGSEV: Glob not applied to shape after Update.

amanhigh opened this issue · comments

I have two shapes two which i am trying to apply Styles with Glob. This was working perfectly fine before update.

Current D2 Version: 0.6.1

Style is stored in /lib/user.d2

icon: https://icons.terrastruct.com/essentials%2F359-users.svg

Without Glob

production: {
  # ####  Entities ########
  userWebsite
  userMobile

  ## Globs
  userWebsite: @lib/user
  userMobile: @lib/user
}

image

With Glob

production: {
  # ####  Entities ########
  userWebsite
  userMobile

  ## Globs
  user*: @lib/user
}
signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x55de6cb4d82f

d2 compose.d2 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x55de6cb4d82f]

goroutine 36 [running]:
oss.terrastruct.com/d2/d2ir.(*Map).ensureField.func3()
/build/d2/src/d2/d2ir/d2ir.go:896 +0x8f
oss.terrastruct.com/d2/d2ir.(*Map).ensureField(0xc0005993e0, 0x0, 0xc000599380, 0xc0003c2a50, 0x1, 0x0, 0xc0000dc1a8, 0xc0000daef0)
/build/d2/src/d2/d2ir/d2ir.go:915 +0x1515
oss.terrastruct.com/d2/d2ir.(*Map).EnsureField(0xc0003c2a20?, 0xc000599380, 0xc0003c2a50, 0x40?, 0xc0000dc1a8)
/build/d2/src/d2/d2ir/d2ir.go:721 +0x345
oss.terrastruct.com/d2/d2ir.(*compiler).compileField(0xc0000dc1a8, 0x0?, 0xc0000db058?, 0xc0003c2a50)
/build/d2/src/d2/d2ir/compile.go:567 +0x4e
oss.terrastruct.com/d2/d2ir.(*compiler).compileKey(0xc0000dc1a8, 0xc0003c2a50)
/build/d2/src/d2/d2ir/compile.go:547 +0xd8
oss.terrastruct.com/d2/d2ir.(*compiler).compileMap(0xc0000dc1a8, 0xc0005993e0, 0xc000599320, 0xc000599320)
/build/d2/src/d2/d2ir/compile.go:447 +0x78c
oss.terrastruct.com/d2/d2ir.(*compiler).__import(0xc0000dc1a8, 0xc000508000?)
/build/d2/src/d2/d2ir/import.go:113 +0x525
oss.terrastruct.com/d2/d2ir.(*compiler)._import(0xc0000dc1a8, 0x0?)
/build/d2/src/d2/d2ir/import.go:60 +0x2c
oss.terrastruct.com/d2/d2ir.(*compiler)._compileField(0xc0000dc1a8, 0xc00048f630, 0xc0003c2900)
/build/d2/src/d2/d2ir/compile.go:749 +0x786
oss.terrastruct.com/d2/d2ir.(*compiler).compileField(0xc0000dc1a8, 0xc0003c2900?, 0xc0000db8b0?, 0xc0003c2900)
/build/d2/src/d2/d2ir/compile.go:574 +0x199
oss.terrastruct.com/d2/d2ir.(*compiler).compileKey(0xc0000dc1a8, 0xc0003c2900)
/build/d2/src/d2/d2ir/compile.go:547 +0xd8
oss.terrastruct.com/d2/d2ir.(*compiler).compileMap(0xc0000dc1a8, 0xc000599140, 0xc000598ea0, 0xc000598de0)
/build/d2/src/d2/d2ir/compile.go:447 +0x78c
oss.terrastruct.com/d2/d2ir.(*compiler)._compileField(0xc0000dc1a8, 0xc00048f5e0, 0xc0003c26f0)
/build/d2/src/d2/d2ir/compile.go:742 +0x1166
oss.terrastruct.com/d2/d2ir.(*compiler).compileField(0xc0000dc1a8, 0x0?, 0xc0000dbeb8?, 0xc0003c26f0)
/build/d2/src/d2/d2ir/compile.go:574 +0x199
oss.terrastruct.com/d2/d2ir.(*compiler).compileKey(0xc0000dc1a8, 0xc0003c26f0)
/build/d2/src/d2/d2ir/compile.go:547 +0xd8
oss.terrastruct.com/d2/d2ir.(*compiler).compileMap(0xc0000dc1a8, 0xc000599080, 0xc000598de0, 0xc000598de0)
/build/d2/src/d2/d2ir/compile.go:447 +0x78c
oss.terrastruct.com/d2/d2ir.Compile(0xc000598de0, 0xc00056f4a0?)
/build/d2/src/d2/d2ir/compile.go:77 +0x3e7
oss.terrastruct.com/d2/d2compiler.Compile({0xc000042460?, 0x55de6c34e4ae?}, {0x55de6dc5ddc8?, 0xc00056f4a0?}, 0xc00048f450?)
/build/d2/src/d2/d2compiler/compile.go:42 +0xc6
oss.terrastruct.com/d2/d2lib.Compile({0x55de6dc66d80, 0xc0004d0fc0}, {0xc0000462a0, 0x66}, 0x0?, 0x0?)
/build/d2/src/d2/d2lib/d2.go:50 +0x155
oss.terrastruct.com/d2/d2cli.compile({0x55de6dc66d80?, 0xc0004d0fc0}, 0xc0004d0f50, {0xc00056f380, 0x2, 0x2}, 0x0, {0x0, 0x0, 0x0, ...}, ...)
/build/d2/src/d2/d2cli/main.go:394 +0x2fe
oss.terrastruct.com/d2/d2cli.Run({0x55de6dc66d10?, 0xc00048f3b0?}, 0xc0004d0f50)
/build/d2/src/d2/d2cli/main.go:334 +0x275f
oss.terrastruct.com/util-go/xmain.(*State).Main.func1()
/build/d2/src/pkg/mod/oss.terrastruct.com/util-go@v0.0.0-20230604222829-11c3c60fec14/xmain/xmain.go:105 +0x66
created by oss.terrastruct.com/util-go/xmain.(*State).Main in goroutine 1
/build/d2/src/pkg/mod/oss.terrastruct.com/util-go@v0.0.0-20230604222829-11c3c60fec14/xmain/xmain.go:103 +0x139