RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Bugs →

Strange * command

Subscribe to Strange * command 8 posts, 4 voices

 
Jan 31, 2012 10:48am
Avatar Rik Griffin (98) 248 posts

RISC OS 5.19 15 Jan 2012 softloaded on on Iyonix.

*s
Internal error: undefined instruction at &FC01E71C
*where
Address FC01E71C is at offset 000001AC in module UtilityModule

There’s no binary called “s” on my Run$Path, in fact this happens with Run$Path not set at all. A bug in UtilityModule?

(edit – still happens on the 30 Jan build)

 
Jan 31, 2012 1:35pm
Avatar Jeffrey Lee (213) 5984 posts

Interesting – guess I’ll have to take a look at this when I get home.

There’s also another odd bug that I’m aware of – on my RiscPC I’ve got a couple of obeyfiles to move folders around to swap between the 3.7 and 5.x boot sequences. If I run the obeyfiles from the command line just by typing their name, I get an abort, but if I *exec them then they work fine. But since that bug also happens in 3.7 I haven’t felt too compelled to look into it.

 
Feb 1, 2012 12:04am
Avatar Jeffrey Lee (213) 5984 posts

That’s a very nice bug you found there! It looks like it was introduced when the hashed *command lookup was added for RISC OS 4. The code that looked up hash values in the special UtilityModule hash table wasn’t checking for null hash table entries. This resulted in the main command table lookup code attempting to treat the UtilityModule module header as a command table. So if you typed a command which didn’t have a hash entry, and that command appears in the UtilityModule header (before the search gets terminated by encountering a null command string) then it would try executing random code and crash horribly. It looks like ‘s’ is the only command which would have triggered the bug, at least in this OS version; perhaps RISC OS 4/6 has a similar bug lurking in it still?

I’ve submitted a fix now, so there should be some nice non-crashy ROMs ready by the morning.

 
Feb 1, 2012 12:45pm
Avatar Andrew Conroy (370) 684 posts

perhaps RISC OS 4/6 has a similar bug lurking in it still?

*s on RO4.02 and 5.16 just gives “File ‘s’ not found” as expected.

 
Feb 1, 2012 1:06pm
Avatar Sprow (202) 999 posts

RO4.02 and 5.16 just gives “File ‘s’ not found” as expected.

The hash table is generated on boot up in RAM, so differing modules will cause different hash tables to be made. Therefore the bug might exist there, but the exact mix of modules running might result in NULLs for some other non matched command.

 
Feb 1, 2012 1:31pm
Avatar Jeffrey Lee (213) 5984 posts

*s on RO4.02 and 5.16 just gives “File ‘s’ not found” as expected.

The nature of the bug means that different OS versions might be vulnerable to different commands (or might not be vulnerable at all; 5.12 and 5.16 look to be immune).

Therefore the bug might exist there, but the exact mix of modules running might result in NULLs for some other non matched command.

Not exactly. There are three sets of hash tables in use; the utilitymodule hash table (held in ROM), the system commands hash table (held in ROM), and the main hash table used for all the non-kernel commands (built dynamically in RAM). All three of them have their own lookup functions, but it was only the main hash table code which was checking for null entries. Since the dodgy hash tables are held in ROM, whether ‘s’ (or similar) will cause a crash or not is completely independent of which other modules you’ve got loaded.

 
Feb 1, 2012 3:20pm
Avatar Sprow (202) 999 posts

There are three sets of hash tables in use

Ah – I didn’t realise that, I’d always assumed one monolith.

 
Feb 1, 2012 4:52pm
Avatar Rik Griffin (98) 248 posts

I can confirm this seems to be fixed in the 1 Feb build. Thanks :)

Reply

To post replies, please first log in.

Forums → Bugs →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Bug discussions that aren’t covered by the bugs database.

Voices

  • Rik Griffin (98)
  • Jeffrey Lee (213)
  • Andrew Conroy (370)
  • Sprow (202)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys