Discussion:
More BASIC woes
(too old to reply)
Alan Adams
2019-05-14 11:44:50 UTC
Permalink
Hi

I'm now getting a strange crash from Wimp_PollIdle, but only on rpi's
(which I have tried using 5.23 and 5.24) but not on the ARX6 running 5.25.

It occurs when I drag the corner of a window with attached pane to resize
the window. There are a series of reason code 2 events, then a null event,
and the next reason code 2 crashes with a pc in a very high address.

The end of the Reporter log follows:

reason%=0 then%=1793 now%=1789 ~mask%=&83830 ~wimpblock%=&42598
Basic Stack
284 REPEAT
~mask%=&83830
reason%=2 then%=1793 now%=1790 ~mask%=&83830 ~wimpblock%=&42598
Basic Stack
284 REPEAT
~mask%=&83830
reason%=0 then%=1798 now%=1794 ~mask%=&83830 ~wimpblock%=&42598
Basic Stack
284 REPEAT
~mask%=&83830
reason%=2 then%=1798 now%=1794 ~mask%=&83830 ~wimpblock%=&42598
Basic Stack
284 REPEAT
~mask%=&83830
reason%=2 then%=1798 now%=1795 ~mask%=&83830 ~wimpblock%=&42598
Basic Stack
284 REPEAT
Scroll: createoffset: nent%=-1
Scroll: createoffsets: I%=0 num$(I%)="" max%=41
Scroll: creasteoffsets: bibmax%=2 max%=41
Scroll2: print%=0 width%=156 namewidth%=44 totalfix%=5 classfix%=0
mixedfix%=0 boatfix%=0 divfix%=0
A$="Pos NuName Club Age Time Pens
Total Best
"
Scroll: createoffset: nent%=-1
Scroll: createoffsets: I%=0 num$(I%)="" max%=41
Scroll: creasteoffsets: bibmax%=2 max%=41
Scroll2: print%=0 width%=156 namewidth%=44 totalfix%=5 classfix%=0
mixedfix%=0 boatfix%=0 divfix%=0
~mask%=&83830
reason%=2 then%=1803 now%=1799 ~mask%=&83830 ~wimpblock%=&42598
Basic Stack
284 REPEAT
procwimperror running
Memory: Prog=51,070 Vars=301,512 Free=671,616 Stack=56 Undefined=0
Slot=1004K
** Error ** ERR=&80000002 Internal error: abort on data transfer at
&FC1546F4 ERL=299
Scroll: CLOSING DOWN
Memory: Prog=51,070 Vars=301,624 Free=671,488 Stack=72 Undefined=0
Slot=1004K
Address &FC1546F4 in Module WindowManager @ &FC149AD0 + &AC24
Register dump (at &2001B7D0) is:
pc = &FC1546F4 Flags=&A0000113=NzCv if Mode=SVC 32 bit
r0 = &20002224 : $". : 536879652 => &0000016B : k... : 363
r1 = &00000002 : .... : 2
r2 = &00000002 : .... : 2
r3 = &FFFFFFFF : .... : 4294967295
r4 = &FFFFFFFF : .... : 4294967295
r5 = &00000000 : .... : 0
r6 = &FFFFFFFE : .... : 4294967294
r7 = &FFFFFFFE : .... : 4294967294
r8 = &00000A02 : .... : 2562
r9 = &00000802 : .... : 2050
r10 = &2013F3F8 : øó. : 538178552 => &646E6957 : Wind : 1684957527
r11 = &00042598 : ˜%.. : 271768
r12 = &2001DCB4 : ´Ü. : 536992948 => &00000000 : .... : 0
r13 = &FA207F8C : Œ. ú : 4196433804 =>
r14 = &FFFFFFFE : .... : 4294967294
Code around address is:
FC1546BC : Invalid address

Reporter 2.67a (22 Aug 2012) Listed 191 lines

The program at that point is:

IF DEBUG%AND8 THEN *reporttrace PROC
reason%=-1
SYS "OS_ReadMonotonicTime" TO then%
REPEAT
SYS "OS_ReadMonotonicTime" TO now%
WHILE (now%-then%)>0
then%=then%+polltime%
ENDWHILE
IF DEBUG%AND8 THEN *report Scroll: polltime%

mask%=idleflag% OR mainmask%
IF DEBUG%AND1 THEN *report ~mask%
REM SYS "OS_Byte",229,1,0
REM SYS "OS_Byte",124
IF DEBUG%AND1 THEN *report reason% then% now% ~mask% ~wimpblock%
IF DEBUG%AND1 THEN *reportstack
SYS "Wimp_PollIdle",mask%,wimpblock%,then%,0 TO reason%

The line number of the crash is the last above, i.e. the Wimp_PollIdle
call.

This is a tricky section of code to debug, because a drag of the main
window size requires a resize of the pane and then a window_open for both
of them in the correct order. It also requires adjustment of what is being
displayed, because in a smaller window some information has to be omitted.
This adjustment is done in the null event, (the createoffsets shown above)
and thus immediately precedes the crash.
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
j***@mdfs.net
2019-05-15 04:03:19 UTC
Permalink
This may sound a non-obvious question, but does it still crash
if you turn debugging off?
Alan Adams
2019-05-15 09:17:27 UTC
Permalink
Post by j***@mdfs.net
This may sound a non-obvious question, but does it still crash
if you turn debugging off?
It's a good question, and the answer is that it crashes just the same, at
the same address.
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
n***@sprow.co.uk
2019-05-15 21:41:57 UTC
Permalink
Post by Alan Adams
I'm now getting a strange crash from Wimp_PollIdle, but only on rpi's
(which I have tried using 5.23 and 5.24) but not on the ARX6 running 5.25.
[...]
Post by Alan Adams
pc = &FC1546F4 Flags=&A0000113=NzCv if Mode=SVC 32 bit
r0 = &20002224 : $". : 536879652 => &0000016B : k... : 363
r1 = &00000002 : .... : 2
r2 = &00000002 : .... : 2
r3 = &FFFFFFFF : .... : 4294967295
r13 = &FA207F8C : Œ. ú : 4196433804 =>
r14 = &FFFFFFFE : .... : 4294967294
FC1546BC : Invalid address
Invalid? Says who? It looks like a reasonable address in the OS. What does
*MemoryI FC1546BC -40 +80
*ShowRegs
show. That might give some clues,
Sprow.
News
2019-05-15 22:54:11 UTC
Permalink
Post by n***@sprow.co.uk
Post by Alan Adams
FC1546BC : Invalid address
Invalid? Says who?
I have a memory of seeing this depending on whether the code was set
to display as bytes, double bytes or words. I cannot remember now
which of the three display formats failed.
--
Chris Johnson
Alan Adams
2019-05-16 11:56:52 UTC
Permalink
Post by n***@sprow.co.uk
Post by Alan Adams
I'm now getting a strange crash from Wimp_PollIdle, but only on rpi's
(which I have tried using 5.23 and 5.24) but not on the ARX6 running 5.25.
[...]
Post by Alan Adams
pc = &FC1546F4 Flags=&A0000113=NzCv if Mode=SVC 32 bit
r0 = &20002224 : $". : 536879652 => &0000016B : k... : 363
r1 = &00000002 : .... : 2
r2 = &00000002 : .... : 2
r3 = &FFFFFFFF : .... : 4294967295
r13 = &FA207F8C : š. ú : 4196433804 =>
r14 = &FFFFFFFE : .... : 4294967294
FC1546BC : Invalid address
Invalid? Says who?
!Reporter
Post by n***@sprow.co.uk
It looks like a reasonable address in the OS. What does
*MemoryI FC1546BC -40 +80
*ShowRegs
show. That might give some clues,
Sprow.*memory fc1546bc -40 +80
Address : F E D C 3 2 1 0 7 6 5 4 B A 9 8 F E D C
3 2 1 0 7 6 5 4 B A 9 8 : ASCII Data
FC15467C : E1A0B00D EBFFF0AA E28DD020 E8BD0FFE E8BD8001
E3A05000 EB000661 E59CE0C0 : .° áªðÿë Ѝâþ.½è.€½è.P ãa..ëÀàœå
FC15469C : E33E0000 1A00006B E59CE0BC E31E0020 1A000068
E52D0004 E28C0B02 E2800F75 : ..>ãk...¼àœå ..ãh.....-å..Œâu.€â
FC1546BC : E590E000 E133000E 15803000 E28C0B02 E2800F76
0590E000 0134000E 15804000 : .àå..3á.0€...Œâv.€â.à...4..@€.
FC1546DC : E49D0004 0A00005B E92D04FF E243E001 E59EE004
E37E0001 1A000005 EF020042 : ..ä[...ÿ.-é.àCâ.àžå..~ã....B..ï
*showregs
Register dump (stored at &2001B770) is:
R0 = 20002624 R1 = 00000002 R2 = 00000002 R3 = FFFFFFFF
R4 = FFFFFFFF R5 = 00000000 R6 = FFFFFFFE R7 = FFFFFFFE
R8 = 00000A02 R9 = 00000802 R10 = 201417B8 R11 = 00042B8C
R12 = 2001DCB4 R13 = FA207F8C R14 = FFFFFFFE R15 = FC1546F4
Mode SVC32 flags set: NzCvqjggggeAift PSR = A0000113
*

Reporter shows

12:43:31.48 ** Error **
Error : &80000002
Message: Internal error: abort on data transfer at &FC1546F4
procwimperror running
12:43:31.48 ** WimpError ** from Scroll
Error : &80000002
Message: WimpError: Internal error: abort on data transfer at &FC1546F4:
error line=302, err code = -2147483646
Memory: Prog=52,576 Vars=301,556 Free=670,068 Stack=56 Undefined=0
Slot=1004K
** Error ** ERR=&80000002 Internal error: abort on data transfer at
&FC1546F4 ERL=302
Scroll: CLOSING DOWN
Memory: Prog=52,576 Vars=301,668 Free=669,940 Stack=72 Undefined=0
Slot=1004K
Address &FC1546F4 in Module WindowManager @ &FC149AD0 + &AC24
Register dump (at &2001B770) is:
pc = &FC1546F4 Flags=&A0000113=NzCv if Mode=SVC 32 bit
r0 = &20002624 : $&. : 536880676 => &00000124 : $... : 292
r1 = &00000002 : .... : 2
r2 = &00000002 : .... : 2
r3 = &FFFFFFFF : .... : 4294967295
r4 = &FFFFFFFF : .... : 4294967295
r5 = &00000000 : .... : 0
r6 = &FFFFFFFE : .... : 4294967294
r7 = &FFFFFFFE : .... : 4294967294
r8 = &00000A02 : .... : 2562
r9 = &00000802 : .... : 2050
r10 = &201417B8 : ¸.. : 538187704 => &646E6957 : Wind : 1684957527
r11 = &00042B8C : Œ+.. : 273292
r12 = &2001DCB4 : ´Ü. : 536992948 => &0700F13D : =ñ.. : 117502269
r13 = &FA207F8C : Œ. ú : 4196433804 =>
r14 = &FFFFFFFE : .... : 4294967294
Code around address is:
FC1546BC : Invalid address

Reporter 2.67a (22 Aug 2012) Listed 85 lines

I've narrowed down the part causing the problem. It collects information
about the main window, calculates a lot of adjustments, then deletes the
window and re-creates it using the adjusted data, and opens it. Commenting
that out stops the crash, but the window is now incorrectly displayed.

I've yet to work out exactly why I did that. There was something I
couldn't change on the existing window, I think. Looking at the comments
in the code, I am moving and resizing several icons. Is there a way to do
this without deleting and creating the window?

It does occur to me that this is AFTER the pane window is opened in front
of this main window, and the window handle to open behind it still set in
the adjusted data. I can't see why this wouldn't work, and indeed it has
worked for several years on earlier versions of RISC OS.
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
Alan Adams
2019-05-16 15:26:04 UTC
Permalink
Post by Alan Adams
Post by n***@sprow.co.uk
Post by Alan Adams
I'm now getting a strange crash from Wimp_PollIdle, but only on rpi's
(which I have tried using 5.23 and 5.24) but not on the ARX6 running 5.25.
So after a lot of experimenting, I can confirm that setting up a main
window with a superimposed pane, then deleting the main window crashes the
application on an rPi, whether running RO5.23 or 5.24.

It doesn't crash on an ARMX6 running the R-Comp supplied RO5.25

In case it was because of the link from the pane to the main I tried the
following sequence:

Close the pane

Remember the handle of the main window.
Create a new copy of the main window, updating the handle

Re-open the pane window.

open the new main window behind the pane.

Delete the old main window, using the remembered handle. Crash.

Alternatively close the old main window. It remains open.
Now the pane seems to be over the old main window, while the updated data
goes into the new main window.

Bizarre!

=========

So:

I'm deleting and re-creating the window because I am resizing the icons at
the top of it, and I can't find another way to get the new sizes used.
Am I missing something?

Alan
Post by Alan Adams
Post by n***@sprow.co.uk
[...]
Post by Alan Adams
pc = &FC1546F4 Flags=&A0000113=NzCv if Mode=SVC 32 bit
r0 = &20002224 : $". : 536879652 => &0000016B : k... : 363
r1 = &00000002 : .... : 2
r2 = &00000002 : .... : 2
r3 = &FFFFFFFF : .... : 4294967295
r13 = &FA207F8C : ?. ú : 4196433804 =>
r14 = &FFFFFFFE : .... : 4294967294
FC1546BC : Invalid address
Invalid? Says who?
!Reporter
Post by n***@sprow.co.uk
It looks like a reasonable address in the OS. What does
*MemoryI FC1546BC -40 +80
*ShowRegs
show. That might give some clues,
Sprow.*memory fc1546bc -40 +80
Address : F E D C 3 2 1 0 7 6 5 4 B A 9 8 F E D C
3 2 1 0 7 6 5 4 B A 9 8 : ASCII Data
FC15467C : E1A0B00D EBFFF0AA E28DD020 E8BD0FFE E8BD8001
E3A05000 EB000661 E59CE0C0 : .° áªðÿë Ð?âþ.½è.?½è.P ãa..ëÀà?å
FC15469C : E33E0000 1A00006B E59CE0BC E31E0020 1A000068
E52D0004 E28C0B02 E2800F75 : ..>ãk...¼à?å ..ãh.....-å..?âu.?â
FC1546BC : E590E000 E133000E 15803000 E28C0B02 E2800F76
FC1546DC : E49D0004 0A00005B E92D04FF E243E001 E59EE004
E37E0001 1A000005 EF020042 : ..?ä[...ÿ.-é.àCâ.à?å..~ã....B..ï
*showregs
R0 = 20002624 R1 = 00000002 R2 = 00000002 R3 = FFFFFFFF
R4 = FFFFFFFF R5 = 00000000 R6 = FFFFFFFE R7 = FFFFFFFE
R8 = 00000A02 R9 = 00000802 R10 = 201417B8 R11 = 00042B8C
R12 = 2001DCB4 R13 = FA207F8C R14 = FFFFFFFE R15 = FC1546F4
Mode SVC32 flags set: NzCvqjggggeAift PSR = A0000113
*
Reporter shows
12:43:31.48 ** Error **
Error : &80000002
Message: Internal error: abort on data transfer at &FC1546F4
procwimperror running
12:43:31.48 ** WimpError ** from Scroll
Error : &80000002
error line=302, err code = -2147483646
Memory: Prog=52,576 Vars=301,556 Free=670,068 Stack=56 Undefined=0
Slot=1004K
** Error ** ERR=&80000002 Internal error: abort on data transfer at
&FC1546F4 ERL=302
Scroll: CLOSING DOWN
Memory: Prog=52,576 Vars=301,668 Free=669,940 Stack=72 Undefined=0
Slot=1004K
pc = &FC1546F4 Flags=&A0000113=NzCv if Mode=SVC 32 bit
r0 = &20002624 : $&. : 536880676 => &00000124 : $... : 292
r1 = &00000002 : .... : 2
r2 = &00000002 : .... : 2
r3 = &FFFFFFFF : .... : 4294967295
r4 = &FFFFFFFF : .... : 4294967295
r5 = &00000000 : .... : 0
r6 = &FFFFFFFE : .... : 4294967294
r7 = &FFFFFFFE : .... : 4294967294
r8 = &00000A02 : .... : 2562
r9 = &00000802 : .... : 2050
r10 = &201417B8 : ¸.. : 538187704 => &646E6957 : Wind : 1684957527
r11 = &00042B8C : ?+.. : 273292
r12 = &2001DCB4 : ´Ü. : 536992948 => &0700F13D : =ñ.. : 117502269
r13 = &FA207F8C : ?. ú : 4196433804 =>
r14 = &FFFFFFFE : .... : 4294967294
FC1546BC : Invalid address
Reporter 2.67a (22 Aug 2012) Listed 85 lines
I've narrowed down the part causing the problem. It collects information
about the main window, calculates a lot of adjustments, then deletes the
window and re-creates it using the adjusted data, and opens it. Commenting
that out stops the crash, but the window is now incorrectly displayed.
I've yet to work out exactly why I did that. There was something I
couldn't change on the existing window, I think. Looking at the comments
in the code, I am moving and resizing several icons. Is there a way to do
this without deleting and creating the window?
It does occur to me that this is AFTER the pane window is opened in front
of this main window, and the window handle to open behind it still set in
the adjusted data. I can't see why this wouldn't work, and indeed it has
worked for several years on earlier versions of RISC OS.
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
News
2019-05-16 15:42:54 UTC
Permalink
Post by Alan Adams
I'm deleting and re-creating the window because I am resizing the
icons at the top of it, and I can't find another way to get the
new sizes used. Am I missing something?
Can you not delete the icon and recreate it at the new size and
position?
--
Chris Johnson
Steve Fryatt
2019-05-16 19:07:35 UTC
Permalink
On 16 May, News wrote in message
Post by Alan Adams
I'm deleting and re-creating the window because I am resizing the icons
at the top of it, and I can't find another way to get the new sizes
used. Am I missing something?
Can you not delete the icon and recreate it at the new size and position?
Or use the Wimp_ResizeIcon SWI, which does what it says on the tin...
--
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/
Alan Adams
2019-05-16 19:39:16 UTC
Permalink
Post by Steve Fryatt
On 16 May, News wrote in message
Post by Alan Adams
I'm deleting and re-creating the window because I am resizing the icons
at the top of it, and I can't find another way to get the new sizes
used. Am I missing something?
Can you not delete the icon and recreate it at the new size and position?
Or use the Wimp_ResizeIcon SWI, which does what it says on the tin...
I hadn't noticed that one. I'll give that a try.
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
Loading...