Stream: brlcad

Topic: OpenBSD


view this post on Zulip starseeker (Dec 18 2020 at 04:33):

No wonder I was never able to do anything with that core file on OpenBSD - it needs lldb, not gdb: image.png

view this post on Zulip starseeker (Dec 18 2020 at 04:39):

Not sure what to make of it, but finally got it...

view this post on Zulip Sean (Dec 18 2020 at 04:48):

that base variable is suspicious

view this post on Zulip Sean (Dec 18 2020 at 04:51):

looks like it's actually a pointer to mged_curr_dm->dm_mged_variables

view this post on Zulip Sean (Dec 18 2020 at 05:09):

I bet it's the offset getting calculated incorrectly.

view this post on Zulip Sean (Dec 18 2020 at 05:15):

loc is set to base + sdp->sp_offset
sdp is a line in the parsetab with sp_offset defined in the struct. the struct is mged_curr_dm->dm_mged_variables so it could be that mged_curr_dm is invalid or dm_mged_variables isn't initialized or dm_mged_variables is initailized but has bad offset values.

view this post on Zulip Sean (Dec 18 2020 at 05:16):

or mged_curr_dm is random garbage

view this post on Zulip Sean (Dec 18 2020 at 05:22):

next step would probably be to identify which mged_variables is being used/set there, check dm_curr-dm for validity, and find where it's initalizing the fields of dm_mged_variables.

view this post on Zulip starseeker (Dec 18 2020 at 13:31):

I wish I knew which test was doing that - "make check" produces it, but despite making a core file it doesn't halt the test. Suggests something isn't checking a test return code somewhere, unless it's possible to dump a core and still complete "successfully"...

view this post on Zulip starseeker (Dec 18 2020 at 13:33):

Hmm... wonder if lldb can tell me from the core file...

view this post on Zulip starseeker (Dec 18 2020 at 13:54):

It's a little hard to follow, but it looks like it's running "vars " and when I do that in isolation the output does look strange: image.png

view this post on Zulip starseeker (Dec 18 2020 at 15:08):

This is handy: https://www.nesono.com/sites/default/files/lldb%20cheat%20sheet.pdf

view this post on Zulip starseeker (Dec 18 2020 at 18:30):

Whee! valgrind doesn't like the vars command run, even on Linux.

view this post on Zulip Sean (Dec 18 2020 at 18:34):

yeah, that looks like memory corruption.

view this post on Zulip starseeker (Dec 18 2020 at 18:35):

I wonder if I updated mged_variables but never updated mged_vparse...

view this post on Zulip Sean (Dec 18 2020 at 18:36):

looks like mged_curr_dm has to be involved, so maybe related to the dm init logic and the specific invocation mode of the script (like running with redirected input or something)

view this post on Zulip starseeker (Dec 18 2020 at 19:44):

Wow. "mged> vars" shows valgrind issues at least as far back as 70555...

view this post on Zulip starseeker (Dec 18 2020 at 19:50):

Make that r62647 - getting old enough it's hard to test...

view this post on Zulip starseeker (Dec 18 2020 at 19:54):

OK, clearly not a release blocker...

view this post on Zulip starseeker (Dec 18 2020 at 19:58):

/me wonders if "vars" would be better called "settings" - for what it seems to be intended to be, I wouldn't have thought to look first for a "vars" command...

view this post on Zulip starseeker (Dec 19 2020 at 17:56):

It definitely looks like the parsing is what's going wrong - gdb's reporting of the struct contents themselves seems to be OK...

view this post on Zulip starseeker (Dec 19 2020 at 17:59):

Doh.

view this post on Zulip starseeker (Dec 19 2020 at 18:01):

There we go - r78028.

view this post on Zulip starseeker (Dec 19 2020 at 18:01):

/me tries OpenBSD again

view this post on Zulip Aniket Khandagale (Dec 20 2020 at 12:06):

hey everyone!
I was curious if I can contribute with the knowledge of c++

view this post on Zulip starseeker (Dec 20 2020 at 15:51):

Do you mean specifically on OpenBSD?

view this post on Zulip starseeker (Dec 20 2020 at 21:46):

@Aniket Khandagale If you mean C++ generically there's lots of opportunity - the new Qt graphical interface work, for example, is in Qt with C++


Last updated: Oct 09 2024 at 00:44 UTC