LoadSeg() or VERSION command crash with corrupted binary

Have a question about our Software Developer Kit? Ask them here.

LoadSeg() or VERSION command crash with corrupted binary

Postby zzd10h » Sat Feb 11, 2017 11:37 am

Hi,
Trying
BPTR seg = LoadSeg(file);
to determine the version of a file crashs on incomplete binaries (half downloaded file).

Trying OS4 Version command on the same file crashs too.

Do you know a way to safe use LoadSeg ?

Thanks

Code: Select all
Crash log for task "version"
Generated by GrimReaper 53.19
Crash occured in module elf.library.kmod at address 0x0216F980
Type of crash: DSI (Data Storage Interrupt) exception
Alert number: 0x80000003
...
    native kernel module elf.library.kmod+0x00000e40
    native kernel module elf.library.kmod+0x00000fec
    native kernel module elf.library.kmod+0x000071cc
    native kernel module elf.library.kmod+0x00007524
    native kernel module dos.library.kmod+0x00041d98
    native kernel module dos.library.kmod+0x0001b3d4
    module version at 0x7F5FFA88 (section 4 @ 0xA64)
    module version at 0x7F5FFEAC (section 4 @ 0xE88)
    module version at 0x7F60099C (section 4 @ 0x1978)
    version:_start()+0x184 (section 1 @ 0x1B0C)
    native kernel module dos.library.kmod+0x000255c8
    native kernel module kernel+0x000420ac
    native kernel module kernel+0x000420f4

PPC disassembly:
 0216f978: 38600000   li                r3,0
 0216f97c: 4e800020   blr               
*0216f980: 9421ffe0   stwu              r1,-32(r1)
 0216f984: 7c0802a6   mflr              r0
 0216f988: 90010024   stw               r0,36(r1)
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: LoadSeg() or VERSION command crash with corrupted binary

Postby salass00 » Sat Feb 11, 2017 7:25 pm

You could just scan the file contents for the "$VER:" sequence that starts the version tag.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 466
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: LoadSeg() or VERSION command crash with corrupted binary

Postby zzd10h » Sat Feb 11, 2017 8:32 pm

thank you for the reply,
therefore no way that loadseg() or version command don't crash ?
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: LoadSeg() or VERSION command crash with corrupted binary

Postby xenic » Sat Feb 11, 2017 10:36 pm

zzd10h wrote:thank you for the reply,
therefore no way that loadseg() or version command don't crash ?

I just aborted the D/L of a large file with Odyssey and then used the Version command to try to find the version. It took a second or 2 to complete but the Version command reported it didn't find a version and did not crash. However, when I cut a binary command in half, then the version command crashes. The problem only seems to affect binary programs and not other truncated or corrupt files.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 975
Joined: Sun Jun 19, 2011 1:06 am


Return to SDK Support

Who is online

Users browsing this forum: No registered users and 1 guest