Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get block from structure #3

Open
Flonja opened this issue Jun 9, 2023 · 9 comments
Open

Cannot get block from structure #3

Flonja opened this issue Jun 9, 2023 · 9 comments

Comments

@Flonja
Copy link

Flonja commented Jun 9, 2023

After updating from v1.0.4 (df-structure) and v0.8.10 (df-mc/dragonfly) my structure couldn't build anymore.
I used some code to debug my problem first and found out that it errors out at b:

// s.island is a `structure.Structure`
b, l := s.island.At(x, y, z, nil)
fmt.Printf("(%v %v %v)", x, y, z)
fmt.Printf("%T %T\n", b, l)

Stacktrace:

(5 8 6)runtime: nameOff 0xff304c1 base 0x464880 not in ranges:
        types 0x92c000 etypes 0xb88c38
fatal error: runtime: name offset base pointer out of range

goroutine 84 [running]:
runtime.throw({0xa7e579?, 0xc000196270?})
        /home/flonja/sdk/go1.20.1/src/runtime/panic.go:1047 +0x5d fp=0xc0014d77c0 sp=0xc0014d7790 pc=0x435d9d
runtime.resolveNameOff(0xc0014d7888?, 0xff304c1)
        /home/flonja/sdk/go1.20.1/src/runtime/type.go:221 +0x1d6 fp=0xc0014d7818 sp=0xc0014d77c0 pc=0x45d436
reflect.resolveNameOff(0xa6caaf?, 0x2ea8a0?)
        /home/flonja/sdk/go1.20.1/src/runtime/runtime1.go:512 +0x19 fp=0xc0014d7838 sp=0xc0014d7818 pc=0x463ad9
reflect.(*rtype).nameOff(...)
        /home/flonja/sdk/go1.20.1/src/reflect/type.go:729
reflect.(*rtype).String(0x464880)
        /home/flonja/sdk/go1.20.1/src/reflect/type.go:799 +0x25 fp=0xc0014d7858 sp=0xc0014d7838 pc=0x4a1525
fmt.(*pp).printArg(0xc00015e000, {0x464880?, 0x0?}, 0x200?)
        /home/flonja/sdk/go1.20.1/src/fmt/print.go:699 +0xe2 fp=0xc0014d78f8 sp=0xc0014d7858 pc=0x4c9a82
fmt.(*pp).doPrintf(0xc00015e000, {0xa640be, 0x6}, {0xc0014d7b88?, 0x2, 0x2})
        /home/flonja/sdk/go1.20.1/src/fmt/print.go:1176 +0x9a9 fp=0xc0014d79f0 sp=0xc0014d78f8 pc=0x4cd1a9
fmt.Fprintf({0xb5baa0, 0xc0001aa008}, {0xa640be, 0x6}, {0xc0014d7b88, 0x2, 0x2})
        /home/flonja/sdk/go1.20.1/src/fmt/print.go:224 +0x75 fp=0xc0014d7a50 sp=0xc0014d79f0 pc=0x4c6c75
fmt.Printf(...)
        /home/flonja/sdk/go1.20.1/src/fmt/print.go:233
generator/generators.Skywars.GenerateChunk({0xc0000484e0, 0x15, {0x1261860, 0x4, 0x4}, {0xc001460200}, {0xc001460300}, {0xc001460400}, {0xc001460500}}, {0x0, ...}, ...)
        /home/flonja/Desktop/Projects/Golang/Personal/generator/generators/skywars.go:120 +0x42e fp=0xc0014d7c10 sp=0xc0014d7a50 pc=0x8e174e
generator/generators.(*Skywars).GenerateChunk(0xc0011f3e90?, {0x0, 0x4}, 0x400000000?)
        <autogenerated>:1 +0xc5 fp=0xc0014d7cc0 sp=0xc0014d7c10 pc=0x8e1e85
github.com/df-mc/dragonfly/server/world.(*World).loadChunk(0xc001464a80, {0x0, 0x4})
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/world/world.go:1248 +0x249 fp=0xc0014d7d78 sp=0xc0014d7cc0 pc=0x604c09
github.com/df-mc/dragonfly/server/world.(*World).chunk(0xc001464a80, {0x0, 0x4})
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/world/world.go:1179 +0x129 fp=0xc0014d7e38 sp=0xc0014d7d78 pc=0x6046c9
github.com/df-mc/dragonfly/server/world.(*Loader).Load(0xc0011e3110, 0x4)
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/world/loader.go:92 +0xe7 fp=0xc0014d7ea8 sp=0xc0014d7e38 pc=0x5f7387
github.com/df-mc/dragonfly/server/session.(*Session).sendChunks(0xc001462600)
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/session/session.go:377 +0x1a9 fp=0xc0014d7f08 sp=0xc0014d7ea8 pc=0x8b3249
github.com/df-mc/dragonfly/server/session.(*Session).background(0xc001462600)
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/session/session.go:336 +0x13b fp=0xc0014d7fc8 sp=0xc0014d7f08 pc=0x8b2efb
github.com/df-mc/dragonfly/server/session.(*Session).handlePackets.func2()
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/session/session.go:295 +0x26 fp=0xc0014d7fe0 sp=0xc0014d7fc8 pc=0x8b2d86
runtime.goexit()
        /home/flonja/sdk/go1.20.1/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0014d7fe8 sp=0xc0014d7fe0 pc=0x467841
created by github.com/df-mc/dragonfly/server/session.(*Session).handlePackets
        /home/flonja/go/pkg/mod/github.com/df-mc/[email protected]/server/session/session.go:295 +0x8a

Other run with fmt.Printf("%T %T\n", b, l) split into to fmt.Printf calls:

(6 4 9)block.Stone
<nil>
(6 5 9)block.Stone
<nil>
(6 6 9)block.Stone
<nil>
(6 7 9)runtime: nameOff 0xff304c1 base 0x464880 not in ranges:
        types 0x92c000 etypes 0xb88c58

When running this code in v1.0.4 it got the block successfully:

b, l := island.At(6, 7, 9, nil)
fmt.Printf("%T %T\n", b, l)

// block.Stone <nil>
@Flonja
Copy link
Author

Flonja commented Jun 9, 2023

I would like the keep the structure file private. If a contributor needs it, then please dm me on discord (tag: flonja)

@yousifnimah
Copy link

This error typically occurs when there is a mismatch between the versions of different packages or dependencies.

Double-check that all your dependencies, including df-structure and df-mc/dragonfly, are compatible with each other.
Also, If you are using a package manager for your project, such as Go Modules (go.mod file), verify that all your dependencies and their versions are correctly listed. Use the package manager to update or retrieve the correct versions of the packages you need.

@Sandertv
Copy link
Member

Hmmmm I seem unable to reproduce using Go version 1.20.5 and dragonfly v0.9.4. Maybe it's dependent on the OS? What os+arch are you using?

@yousifnimah
Copy link

I use Go version go1.18.4 darwin/amd64.

@Sandertv
Copy link
Member

Are you also experiencing this issue?

@yousifnimah
Copy link

yousifnimah commented Jun 18, 2023

Actually, I don't have a structure file so I couldn't run it. I got:

panic: open file: open example.mcstructure: no such file or directory
undefined: world.BlockPos

@Flonja
Copy link
Author

Flonja commented Jun 19, 2023

Hmmmm I seem unable to reproduce using Go version 1.20.5 and dragonfly v0.9.4. Maybe it's dependent on the OS? What os+arch are you using?

OS: Pop!_OS 22.04 LTS x86_64
Kernel: 6.2.6-76060206-generic
Golang: version go1.20.1 linux/amd64

@Flonja

This comment was marked as outdated.

1 similar comment
@Flonja
Copy link
Author

Flonja commented Aug 20, 2023

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants