![]() |
Forum Index : Microcontroller and PC projects : CMM2: Bug reports
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Bug: MM.INFO(FILESIZE f$) does not handle file paths correctly To reproduce 1. Create the following file structure: A:/ foo.txt subdir/ bar.txt 2. Run the following sequence of commands Chdir "A:/" Print MM.INFO(FILESIZE "foo.txt") Print MM.INFO(FILESIZE "A:/foo.txt") Print MM.INFO(FILESIZE "absent.txt") Print MM.INFO(FILESIZE "A:/absent.txt") Print MM.INFO(FILESIZE "subdir/bar.txt") Print MM.INFO(FILESIZE "A:/subdir/bar.txt") Print MM.INFO(FILESIZE "subdir/missing.txt") Print MM.INFO(FILESIZE "A:/subdir/missing.txt") Chdir "subdir" Print MM.INFO(FILESIZE "../foo.txt") Print MM.INFO(FILESIZE "A:/foo.txt") Print MM.INFO(FILESIZE "../absent.txt") Print MM.INFO(FILESIZE "A:/absent.txt") Print MM.INFO(FILESIZE "bar.txt") Print MM.INFO(FILESIZE "A:/subdir/bar.txt") Print MM.INFO(FILESIZE "missing.txt") Print MM.INFO(FILESIZE "A:/subdir/missing.txt") Expected output <size of "foo.txt"> <size of "foo.txt"> -1 -1 <size of "bar.txt"> <size of "bar.txt"> -1 -1 <size of "foo.txt"> <size of "foo.txt"> -1 -1 <size of "bar.txt"> <size of "bar.txt"> -1 -1 __Actual output__ <size of "foo.txt"> 0 -1 0 <size of "bar.txt"> 0 -1 0 -1 0 -1 0 <size of "bar.txt"> 0 -1 0 Best wishes, Tom Edited 2020-05-31 21:02 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
Thanks - trivial to fix, will be in next release. Same issue with mm.info(modified |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2398 |
hi peter, you might want to check that when connected to the CMM2's console and using the editor, pressing shift-f4 to shift-f10 do NOT produce unexpected results. it may be worthwhile checking all possible combinations of shift and function keys. with the micromite, these key combinations either unexpectedly exit the editor (if no edits have been made), or prompt to exit, as they generate escape sequences that the editor does not know about. cheers, rob :-) Edited 2020-06-01 17:23 by robert.rozee |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
Thanks Rob. Same issue - will fix in the next release |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
All known bugs fixed in RC44 - see main thread for download and details |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1828 |
OPTION MODES UNLOCKED or LOCKED Error: Unrecognised option. Release RC44 Is this command no longer used? Once again, I could be having a seniors moment. (I did search) Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6219 |
We are permanently UNLOCKED Jim VK7JH MMedit |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1828 |
Thanks Jim, I could not see that in the docs, and it's still under options in the user manual, I did download the latest one Geoff posted a few days ago, so maybe I missed an update again, I'll check just in case. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2398 |
1. using an xterm talking to the CMM2 serial console: pressing ESCAPE three times in the editor causes an exit. after the first press, a message reading "WARNING!!! File has unsaved changes. Press ESC 2 more times to quit." is displayed at the bottom of the terminal screen. after the second press, a message reading "WARNING!!! File has unsaved changes. Press ESC 1 more times to quit." is displayed. if ESCAPE is only pressed once or twice, then any other keys are pressed, the warning message still remains at the bottom of the terminal screen, indefinitely it would seem. yet the 'ESCAPES in a row' counter is reset back to zero. if the warning message is displayed, then a key other than ESCAPE is pressed, the previous bottom line content ("ESC=Quit, F1=Save current, F2=Run, F6=Save, F7=Insert file, ^F=Find, ^S=Select, ^V=Paste, ^W=Backup") should be restored. --- 2. NOT A BUG, JUST A SUGGESTION FOR A FUTURE REVISION: it may be worth considering providing an OPTION TERM name setting, where name can be either VT102 or XTERM, and the default XTERM. when set to VT102, the following changes would apply: - the xterm resize text area escape sequence (\033[8;50;101t) would not be sent; - 80x24 screen size would be assumed from the serial console; - the VGA edit area would be limited to an 80x24 windowed area to match, with the font size possibly bumped up from 8x12 pixels to 10x25 pixels (allowing the full 800x600 VGA screen to be filled), or 10x15 pixels with 120 pixel blank strips top and bottom. so the vga and serial console edit areas would remain locked together, while headless operation/editing with only a vt102/vt2xx terminal would be possible. cheers, rob :-) cheers, rob :-) Edited 2020-06-04 23:38 by robert.rozee |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
1. Thanks - Will fix 2. Disagree, why would you want to restrict the edit resolution? Putty and Teraterm are the default terminal options and both resize properly. |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2398 |
just adds a little more versatility for those few folks who wish to use the serial console as their main interface, without adversely impacting anyone else. there is a wide world of terminals beyond Putty and Teraterm, along with many computers that lack enough vertical screen resolution to accommodate 50 lines. think, for example, of the netbooks that sit on many workbenches, a large number with a 10" screen that is just 600 pixels high. then there are our older mite-users, who's weaker eyes need much bigger fonts to be able to see their source code clearly. i can certainly see why the serial console and VGA edit screen are locked together, and hence why OPTION DISPLAY is read-only, but if able (without major effort) to provide some extra versatility, why not? btw, i notice that the serial console does not support mouse control, whereas the MX170 mites do. cheers, rob :-) |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
BUG: Error: Nothing to edit - HANG!!! No reproduction instructions I'm afraid but I've been seeing this a lot recently from the command line: > edit Error: Nothing to edit Followed by a hang requiring the Waveshare to be reset! This is despite having previously edited a file. This appears to be happening after a file handling error has been reported, but I'm unable to reproduce using a simple example. On a related note any chance of DIR$() and LIST FILES being enhanced in the future to allow a path to be specified rather than operating only on the current working directory. It's a pain in the arse to have to Chdir to and fro within a BASIC program - or am I being thick Best regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
Please explain what you were doing to cause the file handling error. Sounds like some corruption following on from this. |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
I was changing into a directory (CHDIR), listing files (DIR$), restoring the working directory and then opening a file. The actual failing call was (due to f$ being empty): OPEN f$ FOR INPUT AS #1 I'll make a concerted effort to reproduce tonight, I just let you know early because if you had an "Aha!" moment that would have saved time. Best regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Peter, Do you want me to update to RC44 (which you suggest includes mitigation of the effect) or should I try and reproduce with my current firmware so you can find the actual source ? Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
It would be good to know the source. The cause of the error is very simple in that the code tests a particular location to see if there is a file loaded into flash. The pointer to that location was previously held in RAM now it is in flash memory so can't be overwritten. Overwriting it could have been been done by a POKE or by some other bounds error in the firmware. Entering the editor cleans up memory so in the new code if other locations were also trampled that may correct things (but not certain) but as always it is better to get at the root cause. |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
OK, I will do my best. Your explanation about memory corruption seems likely as I recall seeing some other transient weirdness with a corrupted string variable in the same area of code. I'm afraid I failed to document that as I've been focusing on my own code rather than bug hunting the last few evenings. Tom. MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Hi Peter, Here are instructions to reproduce the issue with 5.0.5.02RC41: 1. Unzip mem_corrupt.zip to the root, creating this structure: A:/ mem_corrupt.bas subdir/ one.txt two.txt three.txt 2. Reset the Waveshare 3. edit "mem_corrupt.bas" 4. F2 5. Select 1 6. You get the expected output: A:/subdir/one.txt-missing [59] Error: Could not find the file 7. edit 8. F2 9. Select 1 10. Output as per (6) 11. edit 12. Output: Error: Nothing to edit The Waveshare has now hung!!! Hope this helps, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
Tom Thanks for the diagnostic which replicates perfectly. It does seem fixed in the release version which is good news but I can now investigate the code to see what was causing it. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10065 |
Found it and fixed it. The bug could have been causing other problems. I've updated the download but still the same version - bad practice I know but..... Thank you very much for the great diagnostic ![]() |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |