flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Crash on fasm 1.71.17 and 1.71.19

Author
Thread Post new topic Reply to topic
profkid13



Joined: 21 Aug 2003
Posts: 112
profkid13
Hi,

I managed to crash fasm with an intermediate version of my code.
(I'm converting this driver from MS COFF to PE format and refactoring some things along the way)

Halfway the assembly process, fasm literally crashes.
I tried fasmw 1.71.17 and 1.71.19, and cli version fasm 1.71.17.
All this on a windows 7 64-bit platform.

It's very likely there are still a bunch of bugs and inconsistencies in the code, but this doesnt mean fasm is allowed to crash, is it? Smile

EDIT: original source code removed


Last edited by profkid13 on 01 Mar 2014, 13:33; edited 1 time in total
Post 26 Feb 2014, 12:41
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
profkid13 wrote:
It's very likely there are still a bunch of bugs and inconsistencies in the code, but this doesnt mean fasm is allowed to crash, is it?
No. It is not supposed to crash.

I have confirmed the bug and stickied the thread for Tomasz's attention.
Post 26 Feb 2014, 12:48
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
yup - definitely chrashes.
It is on line 1634 of formats.inc:
Code:
      store_fixup:
        add     dword [ebx],2      <- access violation here
        mov     ah,[esi+1]
        and     ah,0Fh
        mov     al,[esi+4]
        shl     al,4
        or      ah,al
        mov     al,[esi]
        stos    word [edi]
        add     esi,5
        loop    make_fixup
    
Post 26 Feb 2014, 12:58
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
I have reduced the reproducing code into this one:
Code:
format PE

dd $

data fixups
end data

dd $    
There was a bug in the backward patching of the fixups. I have corrected it for the 1.71.20 release.
Post 27 Feb 2014, 12:32
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Is "code cannot be generated" known behavior for the following code?
Code:
format PE DLL native    

It seems to be somehow related to the non-configurable section alignment attribute (remember the discussion? Smile), but I actually don't see any significant difference compared to this compilable code:
Code:
format PE DLL native
section '.flat' code data readable writable executable    

_________________
Faith is a superposition of knowledge and fallacy
Post 27 Feb 2014, 13:40
View user's profile Send private message Reply with quote
profkid13



Joined: 21 Aug 2003
Posts: 112
profkid13
Thanks for the quick help and fix.
Post 01 Mar 2014, 13:33
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.