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 during startup ... #3

Open
herbertp opened this issue Mar 26, 2019 · 7 comments
Open

Segfault during startup ... #3

herbertp opened this issue Mar 26, 2019 · 7 comments

Comments

@herbertp
Copy link

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe9eee700 (LWP 25140)]
[New Thread 0x7fffdf0c1700 (LWP 25141)]
[New Thread 0x7fffde8c0700 (LWP 25142)]
[New Thread 0x7fffddf04700 (LWP 25143)]

Thread 1 "alterpcb-tlines" received signal SIGSEGV, Segmentation fault.
0x000000000046bc80 in MaterialDatabase::LoadFile(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) ()

(gdb) where
#0 0x000000000046bc80 in MaterialDatabase::LoadFile(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) ()
#1 0x0000000000426d6b in MainWindow::LoadMaterials() ()
#2 0x000000000042b492 in MainWindow::MainWindow() ()
#3 0x000000000040b9fc in main ()

@rroohhh
Copy link

rroohhh commented Mar 26, 2019

this seems to fix this problem, but I am not sure this is the root of the problem.

@MaartenBaert
Copy link
Owner

What did you do to trigger this bug? Did you change the materials file in some way? I'm not able to reproduce this. I tried running the program through Valgrind but it doesn't find anything either.

I don't see how the change to the hash table would help, that variable doesn't need to be initialized to INDEX_NONE because it is already going to be set in AddHash().

@herbertp
Copy link
Author

herbertp commented Mar 26, 2019 via email

@rroohhh
Copy link

rroohhh commented Mar 26, 2019

I don't see how the change to the hash table would help, that variable doesn't need to be initialized to INDEX_NONE because it is already going to be set in AddHash().

yes I am also not really sure, but what happens on the hangs it, that in the FindAt loop i is zero and m_data[i].m_hashlink is zero aswell, but m_hasher.Equal(m_data[i], key) returns false and a infinite loop is entered.

@herbertp
Copy link
Author

I forgot to mention, it doesn't seem to happen when compiled with gcc 8.3.1 on Mageia 6.

Best,
Herbert

@MaartenBaert
Copy link
Owner

Could this be a compiler bug? I've gone through the hash table implementation again and can't find the problem. Every possible path which adds an Entry to m_data has to go through AddHash which should initialize m_hashlink.

@rroohhh
Copy link

rroohhh commented Mar 27, 2019

Yes that could very well be, however I don't know how one would verify that.

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