FilterManager calls non-X SWI, and crashes without WindowManager
Charles Ferguson (8243) 427 posts |
Hiya, Simple one here… On RISC OS 5.27, FilterManager calls a non-X SWI during its initialisation which will causes a bad crash when the SWI is not present. The SWI is Wimp_ReadSysInfo. This raises a warning report in my system (because non-X SWIs should not be called in privileged modes, except maybe in special circumstances), and then an error report because the environment handler is being called for an error from such a SWI call (which indicates that it’s not just a theoretical case, it actually happened). Trace from the initialisation: Initialise module: # 72 FilterManager flags &00000001 Module instantiate: <Module(FilterManager @ &fc2b706c + &1398)> Instantiate module FilterManager: class=<class 'riscos.modules.Instance'> Calling module init for <Instance(FilterManager%Base, pw=&00000000)> Init dispatch for module FilterManager%Base (instance 0) to &fc2b7564 (arguments='') fc2b7564: {DA 'Extension ROM', module 'FilterManager': Entry Initialise} fc2b7574: {DA 'Extension ROM', module 'FilterManager'} ==== Begin SWI misuse ==== SWI called without X-bit from non-USR mode: &400f2 (Wimp_ReadSysInfo) Registers: r0 = &00000007, r1 = &00000000, r2 = &0700d4a4, r3 = &0000005c r4 = &00000000, r5 = &00000000, r6 = &00000000, r7 = &00000000 r8 = &00000000, r9 = &00000000, r10 = &07007dcc, r11 = &00000000 r12 = &0700d4a4, sp = &04107f98, lr = &04107fac, pc = &fc2b75bc CPSR= &60000013 : SVC-32 ARM fi ae qvCZn SPSR= &40000013 : SVC-32 ARM fi ae qvcZn Locations: r2 -> [&00000000, &00000000, &00000000, &00000000] r10 -> [&00000000, &00000000, &00000000, &00000000] pc is DA 'Extension ROM', module 'FilterManager' lr is DA 'SVC Stack' Recently executed code: ---- Block &fc2b7564, 4 instructions ---- fc2b7564: {DA 'Extension ROM', module 'FilterManager': Entry Initialise} fc2b7564: PUSH {r0, r1, r2, r3, lr} fc2b7568: LDR r2, [r12] fc2b756c: CMP r2, #0 fc2b7570: BNE &FC2B758C ---- Block &fc2b7574, 3 instructions ---- fc2b7574: {DA 'Extension ROM', module 'FilterManager'} fc2b7574: MOV r0, #6 fc2b7578: MOV r3, #&5c ; #92 = '\' fc2b757c: SWI XOS_Module ---- Block &fc2b7580, 2 instructions ---- fc2b7580: ADDVS sp, sp, #4 fc2b7584: POPVS {r1, r2, r3, pc} ---- Block &fc2b7588, 13 instructions ---- fc2b7588: STR r2, [r12] fc2b758c: MOV r12, r2 fc2b7590: MOV r0, #0 fc2b7594: STR r0, [r12, #4] fc2b7598: STR r0, [r12, #8] fc2b759c: STR r0, [r12, #&c] fc2b75a0: STR r0, [r12, #&10] fc2b75a4: STR r0, [r12, #&14] fc2b75a8: STR r0, [r12, #&18] fc2b75ac: STR r0, [r12, #&40] fc2b75b0: STR r0, [r12, #&54] fc2b75b4: MOV r0, #7 fc2b75b8: SWI Wimp_ReadSysInfo ==== End SWI misuse ==== ==== Begin error report ==== Error about to be reported to environment handler: [&1e6] SWI &400f2 (Wimp_ReadSysInfo) not known r0 = &00000007, r1 = &00000000, r2 = &0700d4a4, r3 = &0000005c r4 = &00000000, r5 = &00000000, r6 = &00000000, r7 = &00000000 r8 = &00000000, r9 = &00000000, r10 = &07007dcc, r11 = &00000000 r12 = &0700d4a4, sp = &04107f98, lr = &04107fac, pc = &fc2b75bc CPSR= &60000013 : SVC-32 ARM fi ae qvCZn SPSR= &40000013 : SVC-32 ARM fi ae qvcZn Locations: r2 -> [&00000000, &00000000, &00000000, &00000000] r10 -> [&00000000, &00000000, &00000000, &00000000] pc is DA 'Extension ROM', module 'FilterManager' lr is DA 'SVC Stack' Recently executed code: ---- Block &fc2b7564, 4 instructions ---- fc2b7564: {DA 'Extension ROM', module 'FilterManager': Entry Initialise} fc2b7564: PUSH {r0, r1, r2, r3, lr} fc2b7568: LDR r2, [r12] fc2b756c: CMP r2, #0 fc2b7570: BNE &FC2B758C ---- Block &fc2b7574, 3 instructions ---- fc2b7574: {DA 'Extension ROM', module 'FilterManager'} fc2b7574: MOV r0, #6 fc2b7578: MOV r3, #&5c ; #92 = '\' fc2b757c: SWI XOS_Module ---- Block &fc2b7580, 2 instructions ---- fc2b7580: ADDVS sp, sp, #4 fc2b7584: POPVS {r1, r2, r3, pc} ---- Block &fc2b7588, 13 instructions ---- fc2b7588: STR r2, [r12] fc2b758c: MOV r12, r2 fc2b7590: MOV r0, #0 fc2b7594: STR r0, [r12, #4] fc2b7598: STR r0, [r12, #8] fc2b759c: STR r0, [r12, #&c] fc2b75a0: STR r0, [r12, #&10] fc2b75a4: STR r0, [r12, #&14] fc2b75a8: STR r0, [r12, #&18] fc2b75ac: STR r0, [r12, #&40] fc2b75b0: STR r0, [r12, #&54] fc2b75b4: MOV r0, #7 fc2b75b8: SWI Wimp_ReadSysInfo ==== End error report ==== Instantiate failed: RISCOSSyntheticError('[&1e6] SWI &400f2 (Wimp_ReadSysInfo) not known',) Error: [&1e6] SWI &400f2 (Wimp_ReadSysInfo) not known Report from FilterManager 0.29; entry from *ROMModules: Extension ROM 1 : 73 : fc2b706c : Dormant : 0.29 : FilterManager |
Steve Pampling (1551) 8170 posts |
We might assume that has carried through to the current dev stream (v5.29) and is “baked in” on v5.28 stable, but maybe not. v5.27 is essentially history. Useful to step back to if a (apparently) new bug appears, otherwise – history. It can be a bit of a pain keeping up with the changes at times, not too bad in recent weeks though. |
Charles Ferguson (8243) 427 posts |
I’m sorry, I’m not sure what the point of your reply was. Are you saying that the report is not worthwhile because it’s about a ‘historic’ version? |
Rick Murray (539) 13840 posts |
While it is good practice to call X form SWIs when initialising 1, a part of me thinks that this “bug” is mostly happening due to a peculiarity of your setup. Namely, that your system appears to be trying to initialise a module that interacts with the Wimp environment on a system that doesn’t have the Wimp running, which would be “unusual”. 2 Still worth adding to the bug tracker though, because wrong is wrong. 1 Good form, as in the documentation (PRM p1-213) basically says do not generate errors and always call X form SWIs. ;-) 2 Makes me wonder if there are similar situations in other parts of the Desktop world, like Switcher or….. |
Steve Pampling (1551) 8170 posts |
Ooooh, no, no, no. I think it’s clearer if you read along with my comment on another post about stating the version, including a specific release date, that you are testing on. There are few enough people with time, inclination and talent doing anything for RO, so I wouldn’t want anyone to be chasing down something that was already found and fixed. Example items in the cut & paste work done in the latter months of 5.27 releases where different aspects might be faulty one day and fixed the next and possibly a fix a day over a week. |
Rick Murray (539) 13840 posts |
A quick look confirms it… https://gitlab.riscosopen.org/RiscOS/Sources/Desktop/Filter/-/blob/master/s/ModHead#L500 PS: I can’t add it to the bug tracker. It keeps asking me to log in, reporting that my login is unsuccessful (while the login to everything else works). Hmm… 🤔 |
Charles Ferguson (8243) 427 posts |
This bug remains in RISC OS 5.31 RC3, and presents in exactly the same way… Initialise module: # 72 FilterManager flags &00000001 ==== Begin SWI misuse ==== SWI called without X-bit from non-USR mode: &400f2 (Wimp_ReadSysInfo) Registers: r0 = &00000007, r1 = &00000000, r2 = &07019d9c, r3 = &0000005c r4 = &00000000, r5 = &00000000, r6 = &00000000, r7 = &00000000 r8 = &00000000, r9 = &00000000, r10 = &07012c9c, r11 = &00000000 r12 = &07019d9c, sp = &04107f98, lr = &04107fac, pc = &fc2ba24c CPSR= &60000013 : SVC-32 ARM fi ae qvCZn SPSR= &40000013 : SVC-32 ARM fi ae qvcZn Locations: r2 -> [&00000000, &00000000, &00000000, &00000000] in DA 'Module area', module 'FilterManager%Base' workspace r10 -> [&00000000, &000000d9, &fc10bfa0, &00018c48] in DA 'Module area' r12 -> [&00000000, &00000000, &00000000, &00000000] in DA 'Module area', module 'FilterManager%Base' workspace pc is DA 'Extension ROM', module 'FilterManager' lr is DA 'SVC Stack' Recently executed code: ---- Block &fc2ba1f4, 4 instructions ---- fc2ba1f4: {DA 'Extension ROM', module 'FilterManager': Entry Initialise} fc2ba1f4: PUSH {r0, r1, r2, r3, lr} fc2ba1f8: LDR r2, [r12] fc2ba1fc: CMP r2, #0 fc2ba200: BNE &FC2BA21C ---- Block &fc2ba204, 3 instructions ---- fc2ba204: {DA 'Extension ROM', module 'FilterManager'} fc2ba204: MOV r0, #6 fc2ba208: MOV r3, #&5c ; #92 = '\' fc2ba20c: SWI XOS_Module ---- Block &fc2ba210, 2 instructions ---- fc2ba210: ADDVS sp, sp, #4 fc2ba214: POPVS {r1, r2, r3, pc} ---- Block &fc2ba218, 13 instructions ---- fc2ba218: STR r2, [r12] fc2ba21c: MOV r12, r2 fc2ba220: MOV r0, #0 fc2ba224: STR r0, [r12, #4] fc2ba228: STR r0, [r12, #8] fc2ba22c: STR r0, [r12, #&c] fc2ba230: STR r0, [r12, #&10] fc2ba234: STR r0, [r12, #&14] fc2ba238: STR r0, [r12, #&18] fc2ba23c: STR r0, [r12, #&40] fc2ba240: STR r0, [r12, #&54] fc2ba244: MOV r0, #7 fc2ba248: SWI Wimp_ReadSysInfo ==== End SWI misuse ==== Regarding Rick’s comment about it being a pecularity of my system… Not having a WindowManager (or not having ANY module) might be odd, but as you also say, it’s wrong to have such SWIs present. Failng to handle such cases it causes obscure problems during reinitialisation, or if softload is happening, or if someone is just trying to use a system that isn’t in the same configuration as the default distribution. |