robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
393 stars 48 forks source link

Crash on fixed-point `PRINT USING` of small floats #219

Closed A-Mosimann closed 1 year ago

A-Mosimann commented 1 year ago

Hello, Rob, I recently downloaded your PC-Basic 2.0.6 software so that I could incorporate the code for a structural analysis program that I worked with in the 1980s. The original code was in Fortran, published in the textbook “Computer Methods of Structural Analysis” in 1970. I converted the Fortran code to GW-Basic and used it successfully for many years. I re-rote the code using your PC-Basic 2.0.6 and ran an example problem from the textbook successfully. However, when I tried to run two other structure configurations, I got fatal errors. Those crash logs are attached.
The data statements for the textbook example that runs successfully are these: 1 DATA BOOK EXAMPLE 2 DATA 3,4,1,1,1,1,200,53.13,46.85,40 3 DATA 1,1,1,1,1,1,1,10,0,8.5 4 DATA 2,0,0,0,0,0,0,10,10,8.5 5 DATA 3,1,1,1,1,1,1,0,10,8.5 6 DATA 4,1,1,1,1,1,1,0,0,0 7 DATA 1,1,2,0,.25,1,1,.25,1,90,1,0 8 DATA 2,2,3,0,.25,1,1,.25,1,90,0,0 9 DATA 3,2,4,0,.25,1,1,.25,1,90,1,0 10 DATA L,1,0,2.4,0,10,0,0,0 11 DATA E,0,0,0,0,0,0,0,0 My entire code listing is attached to the end of the crash log. If you replace the data statements with these it will run fine. Augie Mosimann

Bug report

Problem

Steps

Program

Crash log crash-20221212-z695mvzk.log

crash-20221212-gtkxu_d7.log

Notes

PC-BASIC version:
Operating system version:

A-Mosimann commented 1 year ago

I'm not able to attach the full program because the .BAS file type is not supported.

robhagemans commented 1 year ago

Thanks for the report! I can work with the listing from the crash log so no need to attach the program.

(It seems Github limits the file extensions it's willing to attach, putting the file in a zip archive before attaching would probably work)

robhagemans commented 1 year ago

Crash can be reproduced with print using "###.##"; 2e-04;