This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
toxicwolf's profile picture

Shutdown/Restart Failure [SOLVED]

Started by toxicwolf, 11 August 2012 - 06:48 PM
toxicwolf #1
Posted 11 August 2012 - 08:48 PM
This bug was caused by file handles left unclosed at time of shutdown/reboot. I'm still not entirely sure why not every function of mine that used the culprit function broke the shutdown, but definitely make sure to check through your functions and code to make sure that no files are left open when the computer gets shutdown or rebooted.

This topic can be deleted if the moderators so wish, but I thought I would just add this here for future reference in case any one else comes across this problem.

So I made a commit a couple of days ago to WolfOS on GitHub that changed the way data was saved to file. I serialized the table and encrypted it, rather than saving each index on a separate line in the file. But ever since that change to the code (or a commit around that time), trying to reboot or shutdown the computer results in a blank screen and a completely un-responsive computer. However it is still on, as can be seen by the block's screen texture still containing the '>'. The only solution I have found to un-brick the computer is to reload my world.

I have no idea what part of my code is causing that, apart from the fact that it is my code causing the problem. I don't know where to start.
The only thing that I can think of is that there is a Lua thread left hanging somewhere that refuses to end, or that there is a hidden error message.

I would greatly appreciate any help in tracking down the problem. and the code can be found on GitHub, here: https://github.com/toxicwolf/WolfOS
I apologise for the wild goose chase, but I have shared all the information I have on the subject.

Thanks again!
Toxic Wolf
Edited on 14 August 2012 - 03:12 PM
Pharap #2
Posted 12 August 2012 - 11:13 AM
That's a lot of code to get through. Could you perhaps isolate the bits of code that are different from CC's built in OS. I have had a rummage through the bios a few times before, but never looked at it in depth enough to be able to easily spot differences between it and an adapted version.
toxicwolf #3
Posted 12 August 2012 - 04:41 PM
As far as the bios goes, There are no changes other than minor things such as pointing to the WolfOS shell. Also, I haven't changed the bios for a while, so that isn't the cause of the issue. Like I said, I have no real idea of where the error is originating from, as I can't seem to produce any error messages whatever I do.
Pharap #4
Posted 12 August 2012 - 05:07 PM
As far as the bios goes, There are no changes other than minor things such as pointing to the WolfOS shell. Also, I haven't changed the bios for a while, so that isn't the cause of the issue. Like I said, I have no real idea of where the error is originating from, as I can't seem to produce any error messages whatever I do.

Found your error. Ironically, line 404:

os.run( {}, "/WolfOS/system/shell" )

You change the os file. This path doesn't match an existing one, thus it's likely to be a file location error.
Whether it's because you put the line in front (note the original OS does not do this) or because you forgot to switch out the files correctly, I'm not sure. It could be an error in shell. At any rate, from substituting WolfOS for my bios and renaming it bios.lua, then changing that line to match the one in the regular os, it fixed the 'file not loaded' error that kept coming up and then it ran as it should.

I'm guessing your error might be that. If not it's almost certainly something in shell, or you aren't putting in certain mandatory files.
toxicwolf #5
Posted 12 August 2012 - 05:18 PM
Found your error. Ironically, line 404:

os.run( {}, "/WolfOS/system/shell" )

You change the os file. This path doesn't match an existing one, thus it's likely to be a file location error.
Whether it's because you put the line in front (note the original OS does not do this) or because you forgot to switch out the files correctly, I'm not sure. It could be an error in shell. At any rate, from substituting WolfOS for my bios and renaming it bios.lua, then changing that line to match the one in the regular os, it fixed the 'file not loaded' error that kept coming up and then it ran as it should.

I'm guessing your error might be that. If not it's almost certainly something in shell, or you aren't putting in certain mandatory files.
The /WolfOS/system/shell file does exist, and it does get run, otherwise I would have noticed, since the shell prints text onscreen when it runs.

Also, I'm not sure how that could relate to a shutdown failure. If I have completely mis-understood what you just said, then I apologise :P/>/>

EDIT: I just tried doing a reboot again, and recorded the screen as I did. The last thing that pops up (only for a millisecond or so) is "Press any key to continue". The only piece of code that can produce that is at the end of the bios. However, it means that the shell (or programs run after the shell) errors but without printing an error message; and that the waiting for the user to press a key doesn't work.
Edited on 12 August 2012 - 03:35 PM
Pharap #6
Posted 12 August 2012 - 06:40 PM
Found your error. Ironically, line 404:

os.run( {}, "/WolfOS/system/shell" )

You change the os file. This path doesn't match an existing one, thus it's likely to be a file location error.
Whether it's because you put the line in front (note the original OS does not do this) or because you forgot to switch out the files correctly, I'm not sure. It could be an error in shell. At any rate, from substituting WolfOS for my bios and renaming it bios.lua, then changing that line to match the one in the regular os, it fixed the 'file not loaded' error that kept coming up and then it ran as it should.

I'm guessing your error might be that. If not it's almost certainly something in shell, or you aren't putting in certain mandatory files.
The /WolfOS/system/shell file does exist, and it does get run, otherwise I would have noticed, since the shell prints text onscreen when it runs.

Also, I'm not sure how that could relate to a shutdown failure. If I have completely mis-understood what you just said, then I apologise :P/>/>

EDIT: I just tried doing a reboot again, and recorded the screen as I did. The last thing that pops up (only for a millisecond or so) is "Press any key to continue". The only piece of code that can produce that is at the end of the bios. However, it means that the shell (or programs run after the shell) errors but without printing an error message; and that the waiting for the user to press a key doesn't work.

That's the error I got, but it printed 'file not found' first.

Ok, try to upload a copy of the files you have in your .minecraftmodsComputerCraftlua, so I can see exactly how you have it configured, that way we are running the exact same thing.
toxicwolf #7
Posted 12 August 2012 - 07:03 PM
That's the error I got, but it printed 'file not found' first.

Ok, try to upload a copy of the files you have in your .minecraft\mods\ComputerCraft\lua, so I can see exactly how you have it configured, that way we are running the exact same thing.
Okay, I have attached all of the code needed.

EDIT: Removed attachments to save quota space on here.
Edited on 12 August 2012 - 09:48 PM
Pharap #8
Posted 12 August 2012 - 11:11 PM
Well, I trolled all of your files and the files in computercraft, and it appears to be a conflict with your login system as the system reboots fine until you attempt to login. After an unsuccessful login, the reboot function breaks. I'm assuming this is down to the use of a global variable in the login system that conflicts with one in the boot.
I haven't been able to isolate more than that unfortunately, there is a lot of code involved. I must say, your system appears quite well organised, and so far the gui is quite appealing.
toxicwolf #9
Posted 12 August 2012 - 11:47 PM
Well, I trolled all of your files and the files in computercraft, and it appears to be a conflict with your login system as the system reboots fine until you attempt to login. After an unsuccessful login, the reboot function breaks. I'm assuming this is down to the use of a global variable in the login system that conflicts with one in the boot.
Well, I originally came to that conclusion, but I can reproduce the error after a successful login too. I may have even got it after not trying to log in at all. Also, I just read through my login script, and as far as I can tell, there are no global variables, all are defined or pre-declared with the local keyword.
I've tried running the startup menu from CraftOS, bypassing the WolfOS bios and shell, but that didn't help. I will keep testing to see what does and doesn't reproduce the problem; however I'm starting to think that it is actually one of my APIs that is the culprit.

I haven't been able to isolate more than that unfortunately, there is a lot of code involved. I must say, your system appears quite well organised, and so far the gui is quite appealing.
Thanks :D/>/> I was actually expecting a lot of better coders than I to say how I should do it another way etc :P/>/> And again, I'm sorry for the masses of code and not even a vague idea of where the error is. Thanks for all your efforts to help though! :D/>/>

EDIT: Confirmed that the reboot/shutdown gets broken before a login attempt. Actually, even trying to reboot as early as the shell doesn't work (I changed one of the sleep times after a print so I had time to reboot).
Edited on 12 August 2012 - 10:14 PM
Pharap #10
Posted 13 August 2012 - 12:02 AM
Well, I trolled all of your files and the files in computercraft, and it appears to be a conflict with your login system as the system reboots fine until you attempt to login. After an unsuccessful login, the reboot function breaks. I'm assuming this is down to the use of a global variable in the login system that conflicts with one in the boot.
Well, I originally came to that conclusion, but I can reproduce the error after a successful login too. I may have even got it after not trying to log in at all. Also, I just read through my login script, and as far as I can tell, there are no global variables, all are defined or pre-declared with the local keyword.
I've tried running the startup menu from CraftOS, bypassing the WolfOS bios and shell, but that didn't help. I will keep testing to see what does and doesn't reproduce the problem; however I'm starting to think that it is actually one of my APIs that is the culprit.

I haven't been able to isolate more than that unfortunately, there is a lot of code involved. I must say, your system appears quite well organised, and so far the gui is quite appealing.
Thanks :D/>/> I was actually expecting a lot of better coders than I to say how I should do it another way etc :P/>/> And again, I'm sorry for the masses of code and not even a vague idea of where the error is. Thanks for all your efforts to help though! :D/>/>

All those coders who usually love correcting other people's "improper" code and outdoing others probably run at the sight of that much code lol.

It's fine, I'm going to keep looking through it when I get chance. It's a bit more awkward to navigate than C#,VB and what I've seen of C++, but I won't let that deter me. There are bits that I don't understand though, like the usage of underscores in lua. They seem to have a particular function, but I can't decipher what. As for the APIs thing, when I mean all files, I do mean all of them.

The file encryption is also a good idea, but it does make certain things harder to understand (eg I can't actually test a proper login) but I can understand your want for privacy. I invented an encryption class for my own use in VB/C#. It's rather hideous to read though lol
toxicwolf #11
Posted 13 August 2012 - 12:20 AM
Well, I trolled all of your files and the files in computercraft, and it appears to be a conflict with your login system as the system reboots fine until you attempt to login. After an unsuccessful login, the reboot function breaks. I'm assuming this is down to the use of a global variable in the login system that conflicts with one in the boot.
Well, I originally came to that conclusion, but I can reproduce the error after a successful login too. I may have even got it after not trying to log in at all. Also, I just read through my login script, and as far as I can tell, there are no global variables, all are defined or pre-declared with the local keyword.
I've tried running the startup menu from CraftOS, bypassing the WolfOS bios and shell, but that didn't help. I will keep testing to see what does and doesn't reproduce the problem; however I'm starting to think that it is actually one of my APIs that is the culprit.

I haven't been able to isolate more than that unfortunately, there is a lot of code involved. I must say, your system appears quite well organised, and so far the gui is quite appealing.
Thanks :D/>/> I was actually expecting a lot of better coders than I to say how I should do it another way etc :P/>/> And again, I'm sorry for the masses of code and not even a vague idea of where the error is. Thanks for all your efforts to help though! :D/>/>

All those coders who usually love correcting other people's "improper" code and outdoing others probably run at the sight of that much code lol.

It's fine, I'm going to keep looking through it when I get chance. It's a bit more awkward to navigate than C#,VB and what I've seen of C++, but I won't let that deter me. There are bits that I don't understand though, like the usage of underscores in lua. They seem to have a particular function, but I can't decipher what. As for the APIs thing, when I mean all files, I do mean all of them.

The file encryption is also a good idea, but it does make certain things harder to understand (eg I can't actually test a proper login) but I can understand your want for privacy. I invented an encryption class for my own use in VB/C#. It's rather hideous to read though lol
Hmm, I didn't know if underscores are special in Lua or not. I use them as a 'throw away variable': for example, when a function returns for than one result, but I only want the second one, I usually write this:
local _, y = term.getCursorPos()
Just as an example.
Perhaps they may be interfering somehow?

Also, the default user account credidentials are: Username: admin Passcode: password
So you can use that to log in.

And I also edited my post above yours with some extra info, just to let you know in case you didn't see it.
Pharap #12
Posted 13 August 2012 - 12:31 AM
Well, I trolled all of your files and the files in computercraft, and it appears to be a conflict with your login system as the system reboots fine until you attempt to login. After an unsuccessful login, the reboot function breaks. I'm assuming this is down to the use of a global variable in the login system that conflicts with one in the boot.
Well, I originally came to that conclusion, but I can reproduce the error after a successful login too. I may have even got it after not trying to log in at all. Also, I just read through my login script, and as far as I can tell, there are no global variables, all are defined or pre-declared with the local keyword.
I've tried running the startup menu from CraftOS, bypassing the WolfOS bios and shell, but that didn't help. I will keep testing to see what does and doesn't reproduce the problem; however I'm starting to think that it is actually one of my APIs that is the culprit.

I haven't been able to isolate more than that unfortunately, there is a lot of code involved. I must say, your system appears quite well organised, and so far the gui is quite appealing.
Thanks :D/>/> I was actually expecting a lot of better coders than I to say how I should do it another way etc :P/>/> And again, I'm sorry for the masses of code and not even a vague idea of where the error is. Thanks for all your efforts to help though! :D/>/>

All those coders who usually love correcting other people's "improper" code and outdoing others probably run at the sight of that much code lol.

It's fine, I'm going to keep looking through it when I get chance. It's a bit more awkward to navigate than C#,VB and what I've seen of C++, but I won't let that deter me. There are bits that I don't understand though, like the usage of underscores in lua. They seem to have a particular function, but I can't decipher what. As for the APIs thing, when I mean all files, I do mean all of them.

The file encryption is also a good idea, but it does make certain things harder to understand (eg I can't actually test a proper login) but I can understand your want for privacy. I invented an encryption class for my own use in VB/C#. It's rather hideous to read though lol
Hmm, I didn't know if underscores are special in Lua or not. I use them as a 'throw away variable': for example, when a function returns for than one result, but I only want the second one, I usually write this:
local _, y = term.getCursorPos()
Just as an example.
Perhaps they may be interfering somehow?

Also, the default user account credidentials are: Username: admin Passcode: password
So you can use that to log in.

And I also edited my post above yours with some extra info, just to let you know in case you didn't see it.

Don't think the underscores would be interfereing, but now I know lua isn't bound by the same variable conventions as other languages, they make more sense (in C# and VB, varaible names must start with a letter, numbers and symbols are illegal).

I wish I knew where os.reboot() is located, It appears to be a non-existent function, and thus is probably contained in the Java.
Also, which file loads up the OS selection? I found it once then lost it again and It's one of the few things I can't find.

Thanks for the heads up on the login btw, I should have guessed it lol
toxicwolf #13
Posted 13 August 2012 - 12:42 AM
Yeah, I think os.reboot() is java side, since it must start the computer again too…

The OS selection is run in bios.lua (the original is moved to /rom/boot/CraftOS).
Cloudy #14
Posted 13 August 2012 - 12:50 AM
Do you leave any file handles while rebooting? There's a known bug which can cause this.
toxicwolf #15
Posted 13 August 2012 - 12:51 AM
Do you leave any file handles while rebooting? There's a known bug which can cause this.
Do you mean are any files left open?
Pharap #16
Posted 13 August 2012 - 01:03 AM
Ok, I tried something interesting.
I ran Craft OS first, then tried to run craft OS from boot and it failed. The bios code claimed you tried to write a global (something which CraftOS has code to prevent, hence this error came up)

So what I said earlier about a global sticking around conflicting with the startup procedure is starting to sound likely. Problem is finding what could be writing a global. It could be in either OS for all we know.
Cranium #17
Posted 13 August 2012 - 01:30 AM
I've heard that you can clear your global variables before declaring them again by using something like x = nil, and it clears that variable back to nothing. Not sure if this helps, but just a thought.
Pharap #18
Posted 13 August 2012 - 01:59 AM
I've heard that you can clear your global variables before declaring them again by using something like x = nil, and it clears that variable back to nothing. Not sure if this helps, but just a thought.

Problem is, we have yet to isolate the variable. There is a lot of code to it (two conflicting Operating systems and the code that loads them both, on top of several APIs, not to mention the other seemingly unrelated files). It's a long hard trawl.
toxicwolf #19
Posted 13 August 2012 - 08:23 AM
Ok, I tried something interesting.
I ran Craft OS first, then tried to run craft OS from boot and it failed. The bios code claimed you tried to write a global (something which CraftOS has code to prevent, hence this error came up)

So what I said earlier about a global sticking around conflicting with the startup procedure is starting to sound likely. Problem is finding what could be writing a global. It could be in either OS for all we know.
Great, that actually is a lot more indication that we've had before :P/>/> And I take it you mean you ran the WolfOS boot file from inside CraftOS? I will do it and see what happens :D/>/>

EDIT: Unfortuantly, I don't think this is the cause. I modified the error message in the CraftOS boot to point to the function that called it, not itself and it points to the WolfOS boot file. It occurs when the WolfOS boot tries to load an API into the global space, the CraftOS boot doesn't like it. So I commented out the 'is protected' checks to force load the API anyways, and that allowed WolfOS to boot on top of CraftOS just fine.
However, when trying to reboot, the reboot was still broken.
So either it got broken again because of my changes to the CraftOS bios, or the error doesn't actually originate from here.
Edited on 13 August 2012 - 06:40 AM
Pharap #20
Posted 14 August 2012 - 02:25 AM
Ok, I tried something interesting.
I ran Craft OS first, then tried to run craft OS from boot and it failed. The bios code claimed you tried to write a global (something which CraftOS has code to prevent, hence this error came up)

So what I said earlier about a global sticking around conflicting with the startup procedure is starting to sound likely. Problem is finding what could be writing a global. It could be in either OS for all we know.
Great, that actually is a lot more indication that we've had before :P/>/> And I take it you mean you ran the WolfOS boot file from inside CraftOS? I will do it and see what happens :D/>/>

EDIT: Unfortuantly, I don't think this is the cause. I modified the error message in the CraftOS boot to point to the function that called it, not itself and it points to the WolfOS boot file. It occurs when the WolfOS boot tries to load an API into the global space, the CraftOS boot doesn't like it. So I commented out the 'is protected' checks to force load the API anyways, and that allowed WolfOS to boot on top of CraftOS just fine.
However, when trying to reboot, the reboot was still broken.
So either it got broken again because of my changes to the CraftOS bios, or the error doesn't actually originate from here.

Well at least you know one of the other problems.

And yes, I was trying to run wolfOS from the boot directory in CraftOS.
toxicwolf #21
Posted 14 August 2012 - 01:12 PM
Just tried a multitude of different ways to try and produce an error message, such as editing the error() function to log to file, but no such luck still.

However, I just added an error() call to the WolfOS shell, just before the API load section to halt the computer, and shutdown/reboot is fine. So again I'm thinking it's one of my API's. Will test each individual API.
Pharap #22
Posted 14 August 2012 - 01:29 PM
Just tried a multitude of different ways to try and produce an error message, such as editing the error() function to log to file, but no such luck still.

However, I just added an error() call to the WolfOS shell, just before the API load section to halt the computer, and shutdown/reboot is fine. So again I'm thinking it's one of my API's. Will test each individual API.

I'm wondering if it could be your encryptor based on the fact it gets a random seed from the os time, but that's probably me being stupid again.
Although, I notice you have a term API, could it be conflicting with CraftOS's term API?

Just flinging ideas out there.
toxicwolf #23
Posted 14 August 2012 - 01:48 PM
Just tried a multitude of different ways to try and produce an error message, such as editing the error() function to log to file, but no such luck still.

However, I just added an error() call to the WolfOS shell, just before the API load section to halt the computer, and shutdown/reboot is fine. So again I'm thinking it's one of my API's. Will test each individual API.

I'm wondering if it could be your encryptor based on the fact it gets a random seed from the os time, but that's probably me being stupid again.
Although, I notice you have a term API, could it be conflicting with CraftOS's term API?

Just flinging ideas out there.
No, it's not the term API, because when I first added it, I tried unloading the CraftOS one before loading mine, but it threw an error, so I just allowed mine to load over the top, and it works seamlessly.

The error actually is in the WDM api. I have been ripping apart the WolfOS shell, adding error() calls to halt it etc so I could determine at which point in the shell the shutdown/reboot is actually broken. When the WDM api is loaded, everything is okay, but it takes a call to the 'WDM.readServerData()' function to break it. Strangely enough, the 'WDM.readSystemData()' works fine, yet the two are identical apart from pointing at different files…

I did originally think that the error came around when I changed up the data storage functions in WolfOS, but couldn't be sure. So at least we know what is causing it now. As about how to fix it…


EDIT: I have fixed the source of the bug. My 'readAllText()' function in the WDM api never actually closes it's file handle, which coincides with what Cloudy was talking about, so thanks Cloudy! :D/>/> I fixed the function and everything seems to be okay now. I still have no idea why it was only select functions that actually didn't work, since multiple ones used the 'readAllText()' function, yet never produced the bug…? Also, that function has stayed as is for a long time, so why did it only surface now? Perhaps CC 1.4 / 1.41 did?

Anyway, it's fixed now, so I'd just like to thank you Cloudy for the heads up on that bug which helped me find the problem in my code; and you Pharap for spending time trying to help me find the issue. I really appreciate your help you guys :P/>/>
Marking this thread as solved, and will edit the OP to state what I did to fix as a future reference in case other people bump into this issue too. Will also definitely add you two into the credits section on the WolfOS thread :D/>/>
Edited on 14 August 2012 - 03:20 PM
Pharap #24
Posted 14 August 2012 - 06:00 PM
Woo, fixed. Oddly enough, I was going to check that API, I was working up the list for the acronyms (mainly because I guessed what WUI was) but for some reason I didn't pay much attention to that file. Probably the usual:*looks at lines of code, sees number, sets reminder to read later, gets distracted, doesn't get back to it*
It's probably a gamer thing.

Thanks for the credit mention, though I don't really feel like I deserve it since I didn't actually solve the problem, all I did was look through files and try to understand stuff.
toxicwolf #25
Posted 14 August 2012 - 09:42 PM
Woo, fixed. Oddly enough, I was going to check that API, I was working up the list for the acronyms (mainly because I guessed what WUI was) but for some reason I didn't pay much attention to that file. Probably the usual:*looks at lines of code, sees number, sets reminder to read later, gets distracted, doesn't get back to it*
It's probably a gamer thing.

Thanks for the credit mention, though I don't really feel like I deserve it since I didn't actually solve the problem, all I did was look through files and try to understand stuff.
You put in quite a bit of time and persevered over a few days, which I doubt a lot of people would do, at least not with someone else's code. So my thank you is for that :P/>/>
And yeah, I do that a lot, often with ideas for the OS, so now I resort to writing them down on a dry-wipe board straight away.
Pharap #26
Posted 15 August 2012 - 12:03 AM
Woo, fixed. Oddly enough, I was going to check that API, I was working up the list for the acronyms (mainly because I guessed what WUI was) but for some reason I didn't pay much attention to that file. Probably the usual:*looks at lines of code, sees number, sets reminder to read later, gets distracted, doesn't get back to it*
It's probably a gamer thing.

Thanks for the credit mention, though I don't really feel like I deserve it since I didn't actually solve the problem, all I did was look through files and try to understand stuff.
You put in quite a bit of time and persevered over a few days, which I doubt a lot of people would do, at least not with someone else's code. So my thank you is for that :P/>/>
And yeah, I do that a lot, often with ideas for the OS, so now I resort to writing them down on a dry-wipe board straight away.

Well yeah, but I wasn't focusing on it the whole time, I was pretty much flicking to and fro when it seemed like the logical thing to be doing. Though when I got there, it did take a while to process it all @~@. (I have a brain, not a computer lol)

I often remember what I want to do, I'm just not so good at allocating time to it.
toxicwolf #27
Posted 15 August 2012 - 12:22 AM
Woo, fixed. Oddly enough, I was going to check that API, I was working up the list for the acronyms (mainly because I guessed what WUI was) but for some reason I didn't pay much attention to that file. Probably the usual:*looks at lines of code, sees number, sets reminder to read later, gets distracted, doesn't get back to it*
It's probably a gamer thing.

Thanks for the credit mention, though I don't really feel like I deserve it since I didn't actually solve the problem, all I did was look through files and try to understand stuff.
You put in quite a bit of time and persevered over a few days, which I doubt a lot of people would do, at least not with someone else's code. So my thank you is for that :D/>/>
And yeah, I do that a lot, often with ideas for the OS, so now I resort to writing them down on a dry-wipe board straight away.

Well yeah, but I wasn't focusing on it the whole time, I was pretty much flicking to and fro when it seemed like the logical thing to be doing. Though when I got there, it did take a while to process it all @~@. (I have a brain, not a computer lol)
I know, and I certainly didn't expect you to! But yeah, that was a lot of code to just throw out into the community and say, "here, help me compute this!" :P/>/>
Pharap #28
Posted 15 August 2012 - 12:36 AM
Well yeah, but I wasn't focusing on it the whole time, I was pretty much flicking to and fro when it seemed like the logical thing to be doing. Though when I got there, it did take a while to process it all @~@. (I have a brain, not a computer lol)
I know, and I certainly didn't expect you to! But yeah, that was a lot of code to just throw out into the community and say, "here, help me compute this!" :P/>/>
I hope to make my own OS sometime, so it was quite interesting to look at how someone else handled it.
I'm currently just working on an API, but after seeing how your OS is centred around custom APIs, I think I'm going to make some APIs and build my OS around them, a bit like what yours did. Mine is going to be no where near as complicated though.

Might attempt the OS selector though, that was a nice touch.

Ultimately I think I just liked the challenge. After seeing it, I knew most people would be 'no way, too much code'. But I'm crazy, so I decided to try to help lol
toxicwolf #29
Posted 15 August 2012 - 10:14 AM
Well yeah, but I wasn't focusing on it the whole time, I was pretty much flicking to and fro when it seemed like the logical thing to be doing. Though when I got there, it did take a while to process it all @~@. (I have a brain, not a computer lol)
I know, and I certainly didn't expect you to! But yeah, that was a lot of code to just throw out into the community and say, "here, help me compute this!" :P/>/>
Might attempt the OS selector though, that was a nice touch.
Ah, credit acutally goes to MysticT for that one :D/>/>
Pharap #30
Posted 16 August 2012 - 07:58 AM
Well yeah, but I wasn't focusing on it the whole time, I was pretty much flicking to and fro when it seemed like the logical thing to be doing. Though when I got there, it did take a while to process it all @~@. (I have a brain, not a computer lol)
I know, and I certainly didn't expect you to! But yeah, that was a lot of code to just throw out into the community and say, "here, help me compute this!" :(/>/>
Might attempt the OS selector though, that was a nice touch.
Ah, credit acutally goes to MysticT for that one :)/>/>
Why am I not surprised lol

It was a thought I had, I just wasn't sure how to go about it. Now I've got that to work from though, I can structure my own.
Pharap #31
Posted 16 August 2012 - 08:00 AM
Well yeah, but I wasn't focusing on it the whole time, I was pretty much flicking to and fro when it seemed like the logical thing to be doing. Though when I got there, it did take a while to process it all @~@. (I have a brain, not a computer lol)
I know, and I certainly didn't expect you to! But yeah, that was a lot of code to just throw out into the community and say, "here, help me compute this!" :(/>/>
Might attempt the OS selector though, that was a nice touch.
Ah, credit acutally goes to MysticT for that one :)/>/>
Why am I not surprised lol (not saying you aren't capable, he just tends to be one of the 'big time' contributors in the ask a pro section)

It was a thought I had, I just wasn't sure how to go about it. Now I've got that to work from though, I can structure my own.
Cloudy #32
Posted 16 August 2012 - 02:53 PM
Just tried a multitude of different ways to try and produce an error message, such as editing the error() function to log to file, but no such luck still.

However, I just added an error() call to the WolfOS shell, just before the API load section to halt the computer, and shutdown/reboot is fine. So again I'm thinking it's one of my API's. Will test each individual API.

I'm wondering if it could be your encryptor based on the fact it gets a random seed from the os time, but that's probably me being stupid again.
Although, I notice you have a term API, could it be conflicting with CraftOS's term API?

Just flinging ideas out there.
No, it's not the term API, because when I first added it, I tried unloading the CraftOS one before loading mine, but it threw an error, so I just allowed mine to load over the top, and it works seamlessly.

The error actually is in the WDM api. I have been ripping apart the WolfOS shell, adding error() calls to halt it etc so I could determine at which point in the shell the shutdown/reboot is actually broken. When the WDM api is loaded, everything is okay, but it takes a call to the 'WDM.readServerData()' function to break it. Strangely enough, the 'WDM.readSystemData()' works fine, yet the two are identical apart from pointing at different files…

I did originally think that the error came around when I changed up the data storage functions in WolfOS, but couldn't be sure. So at least we know what is causing it now. As about how to fix it…


EDIT: I have fixed the source of the bug. My 'readAllText()' function in the WDM api never actually closes it's file handle, which coincides with what Cloudy was talking about, so thanks Cloudy! :)/>/> I fixed the function and everything seems to be okay now. I still have no idea why it was only select functions that actually didn't work, since multiple ones used the 'readAllText()' function, yet never produced the bug…? Also, that function has stayed as is for a long time, so why did it only surface now? Perhaps CC 1.4 / 1.41 did?

Anyway, it's fixed now, so I'd just like to thank you Cloudy for the heads up on that bug which helped me find the problem in my code; and you Pharap for spending time trying to help me find the issue. I really appreciate your help you guys :(/>/>
Marking this thread as solved, and will edit the OP to state what I did to fix as a future reference in case other people bump into this issue too. Will also definitely add you two into the credits section on the WolfOS thread :)/>/>

Just so you know, the bug is fixed in the next version of CC (and in the latest bukkit port)! Was my bad - I was altering a list while iterating through it like a noob.