flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > FASMW 1.62 crashes on macro-generated macro

Author
Thread Post new topic Reply to topic
Frank



Joined: 17 Jun 2003
Posts: 100
Frank
Bug report:

I have been playing around with the "allow_nesting" macro from FASMW's include files. After a couple of changes, FASMW crashed during compilation, with an "unknown software exception at 0x00417759". Here is some minimal code to reproduce the crash reliably (FASMW 1.62 as downloaded today; Win2k SP4; Pentium 4):
Code:
macro somemacro
{
  macro anothermacro
  \{
     somemacro
     anothermacro
  \}
}

somemacro


        anothermacro
        ret
    
Post 08 Jul 2005, 19:24
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
Your source makes an infinite recurrence and causes the stack overflow - the behavior on stack overflow is dependent on the OS, for example my Windows for some reason doesn't display any message, only terminates the program in such case.

It's up to the interfaces to handle the stack overflows, I might think about catching them to display fasm's error message somehow, but this would perhaps need a separate solution for each interface (that is for each OS).
Post 08 Jul 2005, 19:36
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
I've got one nice solution, but it needs the interface to provide the stack size to the core. For DOS and Win32 it's not a problem, but can you advice me how to get the size of stack in Linux?


Last edited by Tomasz Grysztar on 08 Jul 2005, 20:02; edited 1 time in total
Post 08 Jul 2005, 19:43
View user's profile Send private message Visit poster's website Reply with quote
Frank



Joined: 17 Jun 2003
Posts: 100
Frank
Thank you, I had overlooked the infinite recursion. As for Linux: sorry ... that's not my ballpark (yet).
Post 08 Jul 2005, 19:55
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7797
Location: Kraków, Poland
Tomasz Grysztar
OK, I've just hardcoded the 16 KB stack limit for the Linux version and it seems to be OK. I've updated the 1.62 with this nice little error message on stack overflow. Wink
Post 08 Jul 2005, 20:11
View user's profile Send private message Visit poster's website Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 604
Location: Germany
MCD
Great, because I was just trying to tell you that similar stack overflow errors occur when including files recursively or when parenthesis are to deep nested.
Post 11 Jul 2005, 11:38
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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.