-
Notifications
You must be signed in to change notification settings - Fork 7
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
[KERNEL BUG] update_data: tss_list == NULL (dispatch.c:94, process = console (1), thread = unnamed (3) #21
Comments
OK, I think I know the cause for this now... It's this code: https://github.com/chaos4ever/chaos/blob/master/storm/ia32/port.c#L136-L155 If the TSS (including I/O map) is too small, it will get expanded. It will then do a |
Note to self (and to others who may be finding this thread when debugging something similar): |
9 hours later, and "minutes" seems to be a "programmer estimate"... 😄 I managed to solve #25, but I'm still struggling with something fishy:
I have no idea why it tries to jump into that crazy address (
Four threads, all of which seem reasonable. So why on earth did it try to jump to that weird place? These are the kind of bugs I'd really not have to sit and debug, and even more so, not debug alone. It just doesn't make any sense, since these bugs feel incredibly hard to nail down on my own. I placed breakpoints now in both the |
Alright, I know now what is causing this (from
The new stack pointer (ESP) is set to the current value of the stack pointer. But the value of the stack pointer at that point is not reliable. Hence, we get a bogus value on the stack and the |
(It was my refactorings that broke stuff. I reverted a few commits and I am now closer to the original issue again.) |
…n a NULL pointer sometimes (which could be causing #21)
Alright. I have it now. It is, surprise-surprise, caused by what it seems to be a bug in gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40115 The guy who posted this didn't got so good response. But actually, it behaves oddly for me; I can't really seem to use the label pointer in a reliable way. (The pointer is off by a few instructions.) |
I'm thinking we change the |
We will indeed change the |
) It would previously use the PL0 stack for the newly created thread. This commit fixes this, so that the PL3 stack (which is much less limited in size) is used instead. The use of the PL0 stack was a bug I introduced while fixing #21 via pull request #30, but since it was three years ago I can honestly not say with certainty whether this was "by design" or "by accident". Either way, doing this fix is much better than (ab)using the PL0 stack since the latter is limited in size to a single 4 KiB page => way too little for certain recursive programs and larger programs in general. (This change was a drive-by change while I was researching the root cause for some issues mentioned in #120)
This happens now when trying to start up the
console
andvga
servers. I spent a bit of time looking into this now:tss_list
variable gets set primarily from the thread_link method. It is also set in the thread_unlink method.thread_link
gets called 2-4 times before the problem happens (thanks togdb
for letting me see this). The value oftss_list
seems to be completely sane on the last invocation of the method.So, in essence, something (whatever it is) is overwriting this memory location. For now,
thread_unlink
would be my best bet actually...The text was updated successfully, but these errors were encountered: