program crashes at start

W

wongjoekmeu

Hiya all,
I have a strange problem. I have compiled a program with g++ compiler.
It seems to compile fine. I can even compile it with debug (-g) option.
However at the very beginning when I run the program I get a
segmentation fault. "Program receive SIGSEGV signal." is what I see
when I use a debugger. I have even put a print state right in the
beginning of the main() function. It seems that the program does not
reach this state at all. Since the crash does not deliver any more
information, I am stuck. Can anyone help me please with solving this
problem by giving me some direction ?
Many thanks in advance.
RWJM
 
B

benben

Hiya all,
I have a strange problem. I have compiled a program with g++ compiler.
It seems to compile fine. I can even compile it with debug (-g) option.
However at the very beginning when I run the program I get a
segmentation fault. "Program receive SIGSEGV signal." is what I see
when I use a debugger. I have even put a print state right in the
beginning of the main() function. It seems that the program does not
reach this state at all. Since the crash does not deliver any more
information, I am stuck. Can anyone help me please with solving this
problem by giving me some direction ?
Many thanks in advance.
RWJM

Since the OP doesn't supply any code for diagnostics I am assuming that
he has at least one static object of a type which has a constructor that
accesses invalid memory.

Regards,
Ben
 
T

Thomas Tutone

Hiya all,
I have a strange problem. I have compiled a program with g++ compiler.
It seems to compile fine. I can even compile it with debug (-g) option.
However at the very beginning when I run the program I get a
segmentation fault. "Program receive SIGSEGV signal." is what I see
when I use a debugger. I have even put a print state right in the
beginning of the main() function. It seems that the program does not
reach this state at all. Since the crash does not deliver any more
information, I am stuck. Can anyone help me please with solving this
problem by giving me some direction ?
Many thanks in advance.
RWJM

My crystal ball tells me the following FAQ may be your problem:

http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12

If that's not it, you're going to have to post a short _compilable_
example that illustrates the problem.

Best regards,

Tom
 
N

Noah Roberts

Hiya all,
I have a strange problem. I have compiled a program with g++ compiler.
It seems to compile fine. I can even compile it with debug (-g) option.
However at the very beginning when I run the program I get a
segmentation fault. "Program receive SIGSEGV signal." is what I see
when I use a debugger. I have even put a print state right in the
beginning of the main() function. It seems that the program does not
reach this state at all. Since the crash does not deliver any more
information, I am stuck. Can anyone help me please with solving this
problem by giving me some direction ?
Many thanks in advance.
RWJM

Run a backtrace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top