amaneureka / AtomOS

A multitasking monolithic Kernel based x86 targeting Operating System written in C# from scratch aiming for high-level implementation of drivers in managed environment.
http://www.atomixos.com
BSD 3-Clause "New" or "Revised" License
1.26k stars 86 forks source link

Crashes with C_String and Cairo #57

Closed FletcherJ1 closed 7 years ago

FletcherJ1 commented 7 years ago

OS crashes for me after loading up and displaying the window. After commenting out lines which call C_String in DrawWindow and DrawTaskbar it no longer crashes. Although the text obviously is no longer displayed. Testing the C_String function separately seems to work fine and the data is accessible. However, when combined with Cairo.ShowText or Cairo.SelectFontFace it seems to crash.

EIP is 3222279488 Kernel.txt kernel_map.txt

amaneureka commented 7 years ago

Could you include Debug.log file too?

FletcherJ1 commented 7 years ago

debug.txt There is some stack tracing in there. Was seeing if it would help narrow down the issue or not.

amaneureka commented 7 years ago

EIP: 3222279488 -> 0x‭C0101540‬ Function: System_Int32_System_String_get_Length__ CR2: 12 EDX: 12 EAX: 12

which suggests that string which has been passed to this is probably null. Are you passing a null string or something?

amaneureka commented 7 years ago

I am assuming there must be some type of stack corruption. try to increase stack size of main thread here: Start-x86.cs

FletcherJ1 commented 7 years ago

No, unless Marshal.C_String("") is interpreted as null string?

amaneureka commented 7 years ago

No, unless Marshal.C_String("") is interpreted as null string?

Nope. It isn't.

would you like to join me on IRC? #atomos @ freenode.net

FletcherJ1 commented 7 years ago

Seems to now be working without the null check which is very strange. I'm guessing increasing the initial stack size to 0x60000 and thread size to 0x4000 worked? Might re-download source and do a diff. to look for other changes.

amaneureka commented 7 years ago

I made changes to Atomic Exchange and GC global tracing, That is not related to this. so I guess it won't affect anything.

Seems to now be working without the null check which is very strange

Indeed, could you try to revert back changes and check again?

FletcherJ1 commented 7 years ago

Problem solved. Did a fresh build and worked first time.