Cosmos: Issues with StreamReader / Writer

Created on 7 Apr 2019  路  16Comments  路  Source: CosmosOS/Cosmos

I have a performance test program to test how big files can be handled in COSMOS.

https://pastebin.com/PdcUYT54

This performance test consists of:
Creating a file of 144 x 128 pairs of coordinates 0,0 to 143,127 and writing them in a file line by line.

Reading said coordinates into an array of point objects and then displaying the X and Y values of the points on the screen.

Thing is, the whole test doesn't progress past the reading part.

Why?

It works a bit like this:

The program stalls while writing to the disk , and when I break it and look into the vmdk on VMWare I get the following result:

ScreenShot 142

What I tried was to write the file on my own on windows and then just read the contents of it and display it on the screen.
The problem is that after a certain number of lines, I get garbage on the screen consisting of random characters and the character.

Bug

All 16 comments

I think @charlesbetros was working on some fixes for the file system caused by the writing or reading of larger files. The issue might be caused by the bugs.

@quajak I was about to. Will try it out.

@quajak the problem is still there with the latest commit, albeit in a different form. (no garbage chars, just empty ones) video and test file supplied.

https://files.gitter.im/CosmosOS/Cosmos/G3pY/bandicam-2019-05-12-13-12-11-250.avi

https://files.gitter.im/CosmosOS/Cosmos/lcuC/lcet10.txt

the StreamReader reads approx. 4245 characters before displaying the empty lines.

Is it possible for you to run the code as a test in testrunner, and enable cosmos debug in a few files so we have some debug log to work off?

Since I don't know how to use the testrunner... Here's the code:

            StreamReader myreader = new StreamReader(@"0:\lcet10.txt");
            int lncount = 0;
            int chrlength = 0;
            while (!myreader.EndOfStream)
            {
                string tmp = myreader.ReadLine();
                chrlength += tmp.ToCharArray().Length;
                Console.WriteLine(tmp);
                lncount++;
                Console.WriteLine("Chr:" + chrlength);
                if(lncount==20)
                {
                    Console.WriteLine("Length: " + chrlength);
                    Console.ReadKey();
                    lncount = 0;
                }
            }

            myreader.Close();

I'm looking in to this.

I'm not seeing an issue in the latest master. Did I miss something?
image

It still doesn't work with the latest master... try reading it to the end?

Are you using your own disk image or the one provided with the UK?

The one provided, just added the file there with VMWare.

Could this be an issue with memory overflow?

Can you send me your disk image? I'll see if I can duplicate that way.

It works now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArtyIF picture ArtyIF  路  9Comments

Vardan2009 picture Vardan2009  路  11Comments

fanoI picture fanoI  路  8Comments

manamster picture manamster  路  4Comments

geomtech picture geomtech  路  9Comments