Skip to content

Some code broken on 68k because ignoring LONG alignment in DOS related stuff #72

@aros-sg

Description

@aros-sg

AROS initially used to have a different filesystem API (not the AOS 68k compatible packet based one). There it was not a problem that code did not make sure that some things like "FileInfoBlock" (or other structs which embed this, like AnchorPath used for pattern matching) were not LONG word aligned. Also on other CPUs (x86) AROS used BPTR == APTR, ie. no multiply/devide by 4 in BADDR/MKBADDR. So even less an issue in this cases.

But with AOS 68k compatible filesystem and real BPTRs (multiplied/divided by 4) there's code in AROS sources which is broken because it does not make sure the structures like FileInfoBlock or AnchorPath are aligned correctly. And this will cause problems/crashes.

For example workbench/c/Copy.c contains such buggy code.

Just look for code which creates this structs on the stack (and does not use explicit alignment tricks) and does not allocate them.

Maybe add debug output to functions like rom/dos/examine.c to see if functions gets called with non aligned fileinfoblock.

(realized after seeing a "... MatchFirst/MatchNext ..." thread on www.amigans.net)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions