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

Segfault with aliased package in a sibling file #3444

Open
Feoramund opened this issue Apr 17, 2024 · 0 comments
Open

Segfault with aliased package in a sibling file #3444

Feoramund opened this issue Apr 17, 2024 · 0 comments

Comments

@Feoramund
Copy link
Contributor

Context

Odin:    dev-2024-04:a61ae7c86
OS:      Arch Linux, Linux 6.8.5-arch1-1
CPU:     12th Gen Intel(R) Core(TM) i7-12700K
RAM:     31916 MiB
Backend: LLVM 14.0.6

The following scenario causes a segmentation fault:

main.odin

package main

import "core:fmt"

import "b"

main :: proc() {
    fmt.println(b.test())
}

a/a.odin

package a

test :: proc() -> int {
    return 4
}

b/b.odin

package b

import "../a"

a :: a

b/b_2.odin

package b

test :: proc() -> int {
    return a.test()
}

lldb output

* thread #8, name = 'odin', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x30)
    frame #0: 0x00005555555c30b8 odin`Entity** string_map_get<Entity*>(h=0x0000000000000028, hash=802189797, key=0x00007fffe9dfd640) at string_map.cpp:185:22
   182 	template <typename T>
   183 	gb_internal T *string_map_get(StringMap<T> *h, u32 hash, String const &key) {
   184 		MapFindResult fr = {MAP_SENTINEL, MAP_SENTINEL, MAP_SENTINEL};
-> 185 		if (h->hashes_count != 0) {
   186 			fr.hash_index = cast(MapIndex)(hash & (h->hashes_count-1));
   187 			fr.entry_index = h->hashes[fr.hash_index];
   188 			while (fr.entry_index != MAP_SENTINEL) {
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

1 participant