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

Bare metal Freeze/Crash at Native.Sti() call in ThreadPool.Initialize #71

Closed
ghost opened this issue Dec 10, 2022 · 23 comments
Closed

Bare metal Freeze/Crash at Native.Sti() call in ThreadPool.Initialize #71

ghost opened this issue Dec 10, 2022 · 23 comments

Comments

@ghost
Copy link

ghost commented Dec 10, 2022

Running on an I7 6700K bare metal, OS freezes/crashes without any output at Native.Sti() call in ThreadPool.Initialize()

Native.Sti();

Same ISO works fine in QEMU, Can try to extract more information with WriteLines prior if it'd be at all helpful 😅

Console.WriteLine before and after the call in question, output looks like:

IMG_20221210_015439008.jpg

Happens with GC & GUI disabled, or enabled. Both work in VM. APIC build var can't be disabled without code changes; Timer and presumably other stuff uses it without compiler ifs.

@ghost ghost changed the title Bare metal Freeze/Crash at Native.Sti() call in Threading.Initialize Bare metal Freeze/Crash at Native.Sti() call in ThreadPool.Initialize Dec 10, 2022
@ghost
Copy link
Author

ghost commented Dec 10, 2022

Same issue on i7 Thinkpad x230

IMG_20221210_020257684.jpg

Also confirmed that everything but Threadpool (and SMP) works; can initialize everything else, and at least read/write from/to console in a loop.

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

Does it just freeze or get panic information?

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

Oh @iBeizsley

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

Try not initialize sata controller

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

SATA.Initialize();

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

i remember sata controller have some problems

@ghost
Copy link
Author

ghost commented Dec 13, 2022

Just freezes, no panic. Disabling SATA didn't work, went ahead and tried with Keyboard, Serial, PS2, VMware tools, SMBIOS, PCI, IDE and SATA all disabled, same result:

IMG_20221213_033539627.jpg

Just for clarity, writeline before the Native.Sti being the last thing here, there's a second writeline immediately after, before Schedule_Next, not getting hit.

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

try not initialize threadpool and smp and see if it works

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

i'll check it as soon as possible

@nifanfa
Copy link
Owner

nifanfa commented Dec 13, 2022

just make sure it is a problem of threadpool

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

20221214_104333_HDR

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

yeah i got the same problem

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

so the problem looks like the trampoline address

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

@iBeizsley

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

no the problem is ThreadPool for sure

@nifanfa nifanfa pinned this issue Dec 14, 2022
@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

https://github.com/nifanfa/MOOS/tree/main
I just reverted the newest changes. you can use this one

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

it works fine on real hardware

@nifanfa nifanfa closed this as completed Dec 14, 2022
@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

20221214_202157

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

The problem might be with native aot itself. We can't make Corlib a lib instead of shared project

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

So the problem is solved

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

i just renamed stable to main btw

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

let me know if it works now

@nifanfa
Copy link
Owner

nifanfa commented Dec 14, 2022

I found that the real problem is that ILCompiler is not stable

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