-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ubuntu 18.04 problem with running float.sbl causing overflow or underflow #14
Comments
I'm also running into a similar problem, but am getting a segfault around label gts26 with just a simple: x = 2.0 'a' |
I think I might know what is going on and I'm investigating a solution (possible misplacement of a read-write area into a read only segment) |
Found the problem and have a fix. It wasn't what I had thought above. Some of the internal calls to C functions from the assembly code need to preserve some registers that get clobbered (I believe that this might be a Linux vs Windows difference). Adding a couple of pushes prior to the calls and pops afterwards appears to fix the problem. |
On Linux, the C calling convention clobbers the following registers that are used internally: RDI, RSI, RDX, RCX Ensure that these registers are preserved when calling the internal C runtime functions. Fixes issue spitbol#14
On Linux, the C calling convention clobbers the following registers that are used internally: RDI, RSI, RDX, RCX Ensure that these registers are preserved when calling the internal C runtime functions. Fixes issue spitbol#14
Pull Request #15 I believe fixes the problem. The branch contains some of the other patches that I've worked on and includes some general (and minor) build cleanup. |
Thanks for looking into and fixing but how long does it take github to update the master branch? I just cloned the master into a new folder and float.sbl still causing the underflow. |
I'm waiting to hear back from Dave Shields who has commit authority. In the meantime you can use what's in the above pull request. |
I did. I changed sbl.asm, int.asm, int.dcl as the diffs showed. same problem. looks like clobbering happens on the output = statements, Variable calculations of any complexity that I tried worked ok as long as the output statement did not contain any float ops. I also cloned bootstrap and it did not work either. Looks like the above asm and dcl files are created each time make is executed. So the changes are overwritten. Since I don't know what I'm doing, I'll wait until master is updated. |
Cheyenne,
Thanks for all your work. I reviewed your prior emails and noted that I
invited to to become a committer on November 4, so please feel free to pull
your patches into the master.
thanks,
dave
…On Wed, Dec 29, 2021 at 12:49 PM osmanfb ***@***.***> wrote:
I did. I changed sbl.asm, int.asm, int.dcl as the diffs showed. same
problem. looks like clobbering happens on the output = statements, Variable
calculations of any complexity that I tried worked ok as long as the output
statement did not contain any float ops. I also cloned bootstrap and it did
not work either. Looks like the above asm and dcl files are created each
time make is executed. So the changes are overwritten.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAARPPNSMSPAM5H2EONPKX3UTNC3NANCNFSM5KTYG3AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks Dave. It appears that I don't have write access to the spitbol/x64 repository, just read access so I can't complete the pull request. |
Cheyenne,
Right you are. Sorry about that.
I just changed your role to Owner. I think that should do it.
dave
…On Sun, Jan 2, 2022 at 9:50 AM Cheyenne Wills ***@***.***> wrote:
Cheyenne, Thanks for all your work. I reviewed your prior emails and noted
that I invited to to become a committer on November 4, so please feel free
to pull your patches into the master. thanks, dave
Thanks Dave. It appears that I don't have write access to the spitbol/x64
repository, just read access so I can't complete the pull request.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAARPPIRAYIG7A624TGDJE3UUBQ4VANCNFSM5KTYG3AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
The fix is now in master. |
::sigh:: still a minor problem (probably a missed call). |
FYI,
sanity-check doesn't test or require any floating point arithmetic,
since SPITBOL can be configured to not support floating point arithmetic.
It just checks that the system is capable of rebuilding itself, and that
the rebuilt system can also rebuild itself. All this is to make sure some
nasty bug doesn't creep in only to show up later.
thanks,
dave
…On Mon, Jan 3, 2022 at 12:36 PM Cheyenne Wills ***@***.***> wrote:
::sigh:: still a minor problem (probably a missed call).
—
Reply to this email directly, view it on GitHub
<#14 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAARPPPTXOL4MURBNUKWVFLUUHNBFANCNFSM5KTYG3AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
I found the problem with the floating point. There needed to be some checks for floating point "problems" with some of the operations (+-/*). I have a "fix" for that as well.. New PR coming in for that.. |
PR #16 should better handle the problem with some floating point operations. I was getting the error: "test/float.sbl(9) : error 264 -- subtraction caused real overflow". The above PR should fix that. |
as of Jan 04, 2 pm the master branch still causing the floating point exception. I checked that having bunch of lines of float operations does not cause the exception. But multiple "output = " with floats does. x = 2.0 |
I've merged the latest changes (PR #16) into master. |
thanks Cheyenne. master is working ok now (Jan 6, 00:28). The only thing is the pre-built bin/sbl is causing "illegal instruction" and maybe should not be included. Also a few lines could be added to the README to do a make bootsbl first and then follow with make BASEBOL=./bootsbl and finally make bininst to copy the sbl to the bin directory. |
I built the x64 spitbol on my ubuntu 18.04 laptop. Building and running sanitychecjk went ok and I installed it. But trying it on the files in the test subdirectory, I am having a problem with float.sbl file.
../sbl float.sbl
5. expect 5.0
test/float_orig.sbl(9) : error 264 -- subtraction caused real overflow
in file test/float_orig.sbl
in line 9
in statement 9
stmts executed 9
execution time msec 0
in line 0
memory used (bytes) 12792
memory left (bytes) 249344
same thing happens with the spitbol executable from the bin subdir.. But if build the 32 bit version from github/x32 then that spitbol runs the float.sbl without any problems. Also if switch floats to integers, it also works.
What could be the problem/where to look ???
TIA
The text was updated successfully, but these errors were encountered: