Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:30 03 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Bug reports

     Page 3 of 17    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 11:01am 31 May 2020
Copy link to clipboard 
Print this post

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
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 11:32am 31 May 2020
Copy link to clipboard 
Print this post

Thanks - trivial to fix, will be in next release. Same issue with mm.info(modified
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 07:12am 01 Jun 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8592
Posted: 07:38am 01 Jun 2020
Copy link to clipboard 
Print this post

  Quote  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.


Thanks Rob. Same issue - will fix in the next release
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 02:17pm 01 Jun 2020
Copy link to clipboard 
Print this post

All known bugs fixed in RC44 - see main thread for download and details
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1369
Posted: 01:32am 03 Jun 2020
Copy link to clipboard 
Print this post

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.
It's all too hard.
Mike.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5911
Posted: 02:56am 03 Jun 2020
Copy link to clipboard 
Print this post

  Quote  
RC36
OPTION MODES command removed. Increased video stability in recent releases makes this now redundant.


We are permanently UNLOCKED

Jim
VK7JH
MMedit   MMBasic Help
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1369
Posted: 04:40am 03 Jun 2020
Copy link to clipboard 
Print this post

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.
It's all too hard.
Mike.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 01:37pm 04 Jun 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8592
Posted: 03:31pm 04 Jun 2020
Copy link to clipboard 
Print this post

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 Zealand
Posts: 2290
Posted: 04:07pm 04 Jun 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3848
Posted: 08:41pm 04 Jun 2020
Copy link to clipboard 
Print this post

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
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 09:54pm 04 Jun 2020
Copy link to clipboard 
Print this post

  Quote  This appears to be happening after a file handling error has been reported, but I'm unable to reproduce using a simple example.


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 Kingdom
Posts: 3848
Posted: 08:31am 05 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  Please explain what you were doing to cause the file handling error. Sounds like some corruption following on from this.


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
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 01:44pm 05 Jun 2020
Copy link to clipboard 
Print this post

  thwill said  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.


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
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 01:59pm 05 Jun 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3848
Posted: 02:24pm 05 Jun 2020
Copy link to clipboard 
Print this post

  matherp said  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.


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.
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 10:43am 06 Jun 2020
Copy link to clipboard 
Print this post

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
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 11:05am 06 Jun 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8592
Posted: 02:10pm 06 Jun 2020
Copy link to clipboard 
Print this post

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
 
     Page 3 of 17    
Print this page
© JAQ Software 2024