Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


m32 flag - segmentation fault

Posted on 2010-08-17
Medium Priority
Last Modified: 2012-05-10

i am running my code on a 64 bit machine and it works fine. But, when I put m32 flag, after a while, i get segmentation faults...what could the problem be..anything is appreciated..thanks
Question by:zizi21
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 53

Expert Comment

ID: 33461690
>> anything is appreciated..

That's precisely what could be the problem : anything :)

Without seeing the code, and without information about where and under which circumstances the segmentation fault occurs, there's not much to say, except guess.
LVL 40

Expert Comment

ID: 33462634
Time to work on your post-mortem debugging skills (trust me it's a bit of a learning curve but it is one you really will get a great deal of payback from in the future!)...

Have you tried using your debugger to analyse the core file?

You'll need to set ulimit to allow the core to be created if you don't currently get one, setting it to unlimited is the easiest thing.

ulimit -c unlimited]


Also, if you've not already done so you'll need to build with symbols (assuming gcc you add the -g flag).

Using GDB is pretty simple (I presume this will be the debugger you use). Open the core file using the debugger.

gdb -c

Then use the backtrace (bt) command to look at the callstack. You can then analyse different stack frames are you see fit.

Some links that looked like they might be useful:

Author Comment

ID: 33462921
can i confirm something..if a server has a physical ram 4 gb, when m32 flag, is used, how much of memory can the program used..it is just that previously the machine was 32 bit and with top, you get 3 gb of memory and now, the operating system is reinstalled too 64 bit and the memory with top is 4 gb. my guess is that with m32 flag, you can't use 4 gb of ram but less . this is because i had a program that use 2 gb plus ram and it is fine...only when it is more than 3gb, it gets seg fault...

my question is if you use m32 flag, is there a limitation of the ram that you can use...has it been set somewhere..apologize for not explaining this earlier..
LVL 40

Accepted Solution

evilrix earned 2000 total points
ID: 33463006
>> my question is if you use m32 flag, is there a limitation of the ram that you can use

Since the address space becomes 32 bit the maximum memory a 32 bit process can possible address is 4GB. That said, in reality the amount of user memory is a lot less (usually 1 or 2 GB) since the rest is reserve in the processes memory map for various other reasons (such as for use my the kernel to map devices - this is probably a poor example).

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question