Re: Problem with debugging -m32 program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-07-11 06:57 +0000, Mahmood Naderan wrote:
> > Sorry, I don't get your point.
> > What else do you expect to happen?
> 
> 
> I don't expect a crash. Why? because the strcpy should simply copy an item to memory location. I wonder why it
> says "I can not access the memory location where is memory location is the data value"?!!!
> Why on earth strcpy wants to access a memory location where I didn't tell him to access?

Your program has jmp to 0x56555655 misteriously.  GDB is then confused and
can not determine the address of argc and argv properly.

It's GDB trying to access 0x90909090, not your program.

> Moreover, as I said multiple times, why w/o specifying -m32, the program finishes without error? 

Andrew has said clearly.  You're invoking undefined behaviour and anything
could happen.  Maybe "Segment fault",  "exit normally", or even "try to access
/usr/bin/42/42/42 and failed".
-- 
Xi Ruoyao <ryxi@xxxxxxxxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux