WindowManager and Wimp_SetCaretPosition
Pages: 1 2
Martin Avison (27) 1494 posts |
I have had a report from a user testing this morning’s v5.27 ROM (15/12/2019) of a Data Abort in Organizer that appears to be in the Wimp_SetCaretPosition SWI. The abort seems to be at WindowManager @ &FC1379B0 +&115A0. The aborting BASIC statement is This was on a Titanium, and I do not have parameter values, the registers or the affacted code, but I have downloaded a new RPi ROM and I will try to get further information when I can get that running. |
Bryan Hogan (339) 593 posts |
Something to do with the WIMP cut/paste additions maybe? |
Steve Fryatt (216) 2105 posts |
It seems a little unlikely, but do we know that the compiler issues identified the other week don’t affect any other non-64-bit-value parts of the build? The Wimp doesn’t use C anywhere directly, does it? Jeffrey’s ticket doesn’t seem to have progressed, so I’m assuming that nothing has been changed in the nightly-build toolchain since the problem was spotted? |
Steve Pampling (1551) 8172 posts |
Certainly didn’t show any evidence of C use when I last looked, but there a lot of inter-dependencies in the Desktop overall. Rather than Bryans forum reference I’d refer to the actual source code change for bits that Organizer may be accessing. |
Martin Avison (27) 1494 posts |
Certainly my suspicions were that the CnP Wimp changes are the cause – made stronger now I have reproduced it here on my RPi. Further details are…
I can see nothing wrong with my parameters to SetCaretPosition, although I have yet to verify that the window is a valid one. |
Martin Avison (27) 1494 posts |
I have had a look at the CnP Wimp changes … and there are hundreds of lines dealing with setting caret position. I cannot see where the code above is in the source, so I have come to the limits of my debugging for the moment. Currently Organizer v2.28a (and probably earlier versions) will not run on RO5.27 (15 Dec 2019). |
David Pitt (3386) 1248 posts |
I tried my luck, on the Titanium, with a simple test app that on opening its window gains the input focus and puts the caret part way down the string in a writable icon. It does not explode with the new copy and paste Wimp. *fx0 RISC OS 5.27 (15 Dec 2019) *help WindowManager ==> Help on keyword WindowManager Module is: Window Manager 5.65 (14 Dec 2019) Select click on iconbar icon. WHEN 4 PROCwimp_open(main%) SYS"Wimp_SetCaretPosition",main%,1,0,0,-1,10 Obviously there is a problem somewhere/somehow. There might be more to this, or my test isn’t valid. |
André Timmermans (100) 655 posts |
I’d suspect the changes in s/wimp05 starting at line 44: [ CnP ; if we're called with R5=-1 then R4,R5 are calculated from R0-R3 ; however, R4 is undefined on entry so could be anything. ; Internally we'd like to be able to use the call to put a ghost caret ; to a mouse click... ; we're doing the call by a SWI now, so need a way to get ghost caret calculations ; add R5=-2 for this purpose - calculate ghost caret details from x/y coords ; R4 *must* now be a valid flag set CMP R5,#-2 MOVEQ R5,#-1 ] BL int_set_caret_position R4 must be set to a valid flag set but are actually left undefined if R5 = -1. Now checking the SWI doc, it says that either R4 is either caret flags or -1 if no flags. This means that passing -1 on entry will result in an invalid set of flags. |
Martin Avison (27) 1494 posts |
@David: You beat me to it with a test app! Could you try @André: I did see those comments, and tried setting r4 to 40, but it had no effect. But I am not sure I understand the ramifications of all the register inter-dependancies, particularly as they seem to vary depending whether it is the original PRM, the SH manual, the comments above, or the ROOL wiki. It may be that Organizer is using a combination which was illegal but worked … until now. Ahah! I have just noticed that the failing instruction was |
David Pitt (3386) 1248 posts |
That does not crash here. |
Martin Avison (27) 1494 posts |
@David: Have you got alignment exceptions on or off? |
David Pitt (3386) 1248 posts |
alignment exceptions are on. |
Martin Avison (27) 1494 posts |
I have found the code that aborted in CnPCaret lines 708 onwards…
It seems that the macro Abs becomes SUB R10,R0,#1 , and handle is also r10.This looks suspicious to me – is handle supposed to have 1 subtracted? Even when it is aligned? |
Andy Vawer (5817) 28 posts |
Hi folks. It’s my bit of code causing you grief at the moment. Sorry for the inconvenience – I’m trying to track down the bug! On entry to check_unshaded_selection_window, handle is supposed to have 1 subtracted as R0 is a window handle on entry rather than an address. However, this means that there’s an invalid window handle stored for some reason at a previous time. That’s why most of the time the SetCaretPosition calls are succeeding OK. I just need to find how/why/when we get an invalid handle in there and then fix that… Martin, did you get the email I sent you this morning to a blueyonder address from the Organizer website? It may have gone to junk. In short, I was hoping to borrow a copy of Organizer that breaks the Wimp and if there’s a particular user/mouse sequence that reliably faults? Thanks |
Martin Avison (27) 1494 posts |
Glad you are on the track of the bug! The Blueyonder address is not mine – it is Nigel’s. In case he is not around to pass it on to me, at [address removed] |
Martin Avison (27) 1494 posts |
Further testing here has shown than previously an Error=&287 “Input focus window not found” was returned for this call (and ignored), and Andy is aware. |
John Williams (567) 768 posts |
I’m happy to report that Organizer’s clock display still works, and that one can access the diary page OK as well. It’s things more complicated than that which fall over! RPi 2 original version – latest ROM. Hopefully it’s only a temporary glitch for a day or so! My former headteacher (yes, I mean Head Master) used to bemoan the use of “hopefully” in this sense – but he’s well-dead! Even more pedantic than I am! Am I also becoming intolerant in my old-age? Probably! At least it’s possible we all won’t have to upgrade Organizer instead of continuing using whatever incarnation we’re on currently! I was preparing to demand that Martin offer multiple version patches if t’were his “bad” (down wit da kids)! |
Andy S (2979) 504 posts |
My former headteacher (yes, I mean Head Master) used to bemoan the use of “hopefully” in this sense Sorry to drag this temporarily off-topic. Self-confessed pedant, here. Is that because in your sentence it would be the glitch (or whatever the subject, “it” is referring to) that would be considered to be feeling hopeful? I must admit, I’m fascinated! :) |
Chris Mahoney (1684) 2165 posts |
I have almost certainly used “hopefully” in the same way, and I’m not sure what’s wrong with it. But my Kiwi brain twitches at seeing a Z in “Organiser”, so don’t ask me :) |
Clive Semmens (2335) 3276 posts |
|
Andy S (2979) 504 posts |
Bravo Clive! I learned to spell from the O.E.D. so I’m mostly with you on that, although you may catch the occasional ‘s’ creeping in now and again. |
Martin Avison (27) 1494 posts |
Organizer may ‘work’ on latest ROM, if Alignment Exceptions are turned off.
I have not heard of any other problems – can you PM me with details? The spelling of Organizer makes me wince a little … it was called Organiser until v1.31 (16th March 1998) when Chris changed it to shareware. I think the name change was to avoid a clash with something else, but my memory is a little vague. |
Clive Semmens (2335) 3276 posts |
It really shouldn’t. The S is a modern aberration, much encouraged by Microsoft. |
John Williams (567) 768 posts |
Interestingly, that great authority the King James bible has “baptize”, but no “organize” or “organise”. Shakespeare uses neither, though he does use that supposed Americanism “gotten” 6 times! Language of the Pilgrim Fathers! Having had my secondary education ’58 to ’65, I have always used “ise”, imagining “ize” was an Americanism, but it is amazing how one can be so wrong over so many years! I have stuck faithfully with “yoghurt” despite pressure to change! I quoted “Organizer”, which gave rise to this diversion, because that’s what it’s now called – whether we like it or not! I unfortunately can’t lay my hands on my Pocket Oxford Dictionary bought in 1958 and kept for sentimental reasons – it has the method for making nitrogen tri-iodide scrawled in the notes section at the back! If I find it I will complete this post in “Aldershot”, where it really belongs. I’m sure Clive is grammatically right, but MicroSoft has never influenced me in any way whatsoever and never will! On topic, I’m really pleased that it may be the revised Window Manager which may be at fault, as I really miss my Organizer (sic)! |
Clive Semmens (2335) 3276 posts |
This ain’t grammar, it’s spelling – and in modern English, it’s still optional, as it has been for at least seventy years, albeit moving from mainly Z to mainly S over that period. 8~) And yes, any further discussion of this really oughta be in Aldershot (Hampshire). |
Pages: 1 2