flat assembler
Message board for the users of flat assembler.

Index > Main > listing - semgentation fault

Author
Thread Post new topic Reply to topic
Kicer



Joined: 30 Apr 2005
Posts: 34
Location: Poland
Kicer
Hi

i've fasm 1.69.14 and 1.68 (linux). In both there is a problem:
Code:
[michal@Kicer build]$ listing -a test2.fas test2.lst 
Interrupted
[michal@Kicer build]$ 
    


test2.lst is cuted after 977 lines at first instruction (first 977 lines are bodies of macros).
Without includes which include those macros, listing works fine.
Conclusion:
small files are sucessfuly processed, big ones generate problem (listing is interrupted).
Post 06 Aug 2010, 14:51
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
Kicer wrote:
small files are sucessfuly processed, big ones generate problem (listing is interrupted).
I have many big files on which listing works fine, therefore it would be much more helpful if you provided some example source that causes the problem.


Just a quick test that demonstrates that it's not the size that is the problem - get this piece of code:
Code:
db 'use32',10

rept 1000000 i
{
  db 'label',`i,':',10
  db 'mov eax,[ebx+label',`i,']',10
  db 'jmp label',`i,10
}    
Save it as "breed.asm" and execute the same commands as I did:
Quote:

$ fasm breed.asm test.asm -m 1000000
flat assembler version 1.69.14 (1000000 kilobytes memory)
1 passes, 9.2 seconds, 54666694 bytes.
$ fasm test.asm -s test.fas -m 1000000
flat assembler version 1.69.14 (1000000 kilobytes memory)
1 passes, 9.2 seconds, 7999921 bytes.
$ listing test.fas test.lst
It produces ~250MB listing file without any complaint.
Post 06 Aug 2010, 15:34
View user's profile Send private message Visit poster's website Reply with quote
Kicer



Joined: 30 Apr 2005
Posts: 34
Location: Poland
Kicer
Code:
[michal@Kicer tmp]$ cat breed.asm 
db 'use32',10

rept 1000000 i
{
  db 'label',`i,':',10
  db 'mov eax,[ebx+label',`i,']',10
  db 'jmp label',`i,10
}
[michal@Kicer tmp]$ fasm breed.asm test.asm -m 1000000 
flat assembler  version 1.69.14  (1000000 kilobytes memory)
1 passes, 11.0 seconds, 54666694 bytes.
[michal@Kicer tmp]$ fasm test.asm -s test.fas -m 1000000 
flat assembler  version 1.69.14  (1000000 kilobytes memory)
1 passes, 9.0 seconds, 7999921 bytes.
[michal@Kicer tmp]$ listing test.fas test.lst 
Naruszenie ochrony pamici
[michal@Kicer tmp]$ 
    


for one who doesn't know: "Naruszenie ochrony pamięci" means "Segmentation Fault" Wink

i'm wondering if problem is somewhere outside fasm: I've not changed my asm file for a few weeks. It used to work, just today i've noticed it doesn't. maybe some changens in my system are the reason? I've updated fasm meanwhile, but as i said problem is also with version i've previously used.

it may be also related to my another problem:
http://board.flatassembler.net/topic.php?t=11756

I always recompile original fasm binaries, to be fully compatible with my libc.
Post 06 Aug 2010, 19:37
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
It appears it is a solely problem of "listing" executable. How did you link it?
Post 06 Aug 2010, 19:41
View user's profile Send private message Visit poster's website Reply with quote
Kicer



Joined: 30 Apr 2005
Posts: 34
Location: Poland
Kicer
just gcc -m32 -o listing listing.o
Post 06 Aug 2010, 20:31
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
Haven't you used some older sources for the listing by mistake? Please compare them with the source from the latest package.
Post 06 Aug 2010, 20:49
View user's profile Send private message Visit poster's website Reply with quote
Kicer



Joined: 30 Apr 2005
Posts: 34
Location: Poland
Kicer
the problem was actually with fasm...
when i used my fasm (i used sources from "libc" directory), generated *.fsm was different than one generated by fasm executable from original package.

now i use fasm from Linux directory and it's ok.

edit:
and also my problem with "8" exit code has disappeared
Post 07 Aug 2010, 05:14
View user's profile Send private message Reply with quote
Kicer



Joined: 30 Apr 2005
Posts: 34
Location: Poland
Kicer
Problem returned in fasm .17 and .18
listing gives segmentation fault (with my code and "breed" code)
Post 03 Sep 2010, 09:32
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
Oh, I see now - the new "ccall" macro (doing additional stack alignment to make the tools work on MacOS systems) was not preserving EBP, and I forgot that listing tool uses this register. I updated the packages with a corrected macro.
Post 03 Sep 2010, 11:29
View user's profile Send private message Visit poster's website Reply with quote
Kicer



Joined: 30 Apr 2005
Posts: 34
Location: Poland
Kicer
seems to work now, thx
Post 04 Sep 2010, 20:06
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 YouTube, Twitter.

Website powered by rwasa.