Author Topic: Ubuntu 9.10 issues  (Read 8868 times)

nobody

  • Guest
Ubuntu 9.10 issues
« on: November 06, 2009, 05:05:46 PM »
It seems that my assembled application is crashing before it even gets to run any code, I say that because even when I have a breakpoint set on the first instruction if fails.

This is only happening on my 9.10 box.


Any advice from those with superior knowledge?



***$*** uname -a

Linux msi 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

code:
-
section .data
section .text
global _start
_start:
nop



***$*** nasm -f elf32 -g -F stabs sandbox.asm -l sandbox.lst

***$*** ld -o sandbox sandbox.o

***$*** ./sandbox

Segmentation fault

---

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Ubuntu 9.10 issues
« Reply #1 on: November 06, 2009, 08:03:25 PM »
I am highly inexpert on gdb. I consider it "unfriendly".

A quick test on your code seems to be "not stopping" on a breakpoint set at _start. If I put a label after the "nop" and set a breakpoint there (and another "nop" after it), instead of on "_start", it does seem to stop(?).

I'd put an "exit" at the end of this, even if it's intended to only be run in a "sandbox" (although Jeff Duntemann doesn't always do so - you got his new book?)

Dunno if that helps...

Best,
Frank

nobody

  • Guest
Re: Ubuntu 9.10 issues
« Reply #2 on: November 06, 2009, 08:27:39 PM »
First, I must commemorate you on your catch of my recent purchase.

Adding the exit has made it work, which just make me feel silly for not trying it sooner.

Thanks,

:)