unkwon exception throwing

P

Philipp Kraus

Hello,

I have written a numerical algorithm for optimizing and on large input
data size an exception with "program fault" is thrown, but I don't have
written this exception, so I would like to understand, how can I solve
the error(s). What's the meaning of this exception (max stack / heap
size is reached)? I know the method, which is throw the exception, but
I don't know why the exception is created

Thanks a lot

Phil
 
G

gwowen

Hello,

I have written a numerical algorithm for optimizing and on large input
data size an exception with "program fault" is thrown, but I don't have
written this exception, so I would like to understand, how can I solve

Without any information on your platform, and compiler (at the very
least) no-one will be able to help, I'm afraid.
 
P

Philipp Kraus

Without any information on your platform, and compiler (at the very
least) no-one will be able to help, I'm afraid.

Compiler is g++ under OSX 10.5 & 10.6
 
F

Fred Zwarts

Philipp Kraus said:
Hello,

I have written a numerical algorithm for optimizing and on large input
data size an exception with "program fault" is thrown, but I don't have
written this exception, so I would like to understand, how can I solve the
error(s). What's the meaning of this exception (max stack / heap size is
reached)? I know the method, which is throw the exception, but I don't
know why the exception is created

What exactly do you mean with an 'exception with "program fault"'?
Is it an exception of type string with value "program fault" that is thrown?
Probably, no one, except the author of this exception, knows what it means.

If you know the method in which the exception is thrown
and you can show us the code, maybe someone does understand
under which conditions the exception is thrown.
 
P

Philipp Kraus

What exactly do you mean with an 'exception with "program fault"'?
Is it an exception of type string with value "program fault" that is thrown?
Probably, no one, except the author of this exception, knows what it means.

If you know the method in which the exception is thrown
and you can show us the code, maybe someone does understand
under which conditions the exception is thrown.

I've found the exception, it comes from an external component (but it
was not documentated)
 
Ö

Öö Tiib

Try to describe your problem exactly and write down the messages
letter-by-letter since
1) you are software developer not aunt Annie and
2) most of us can not read minds.
Compiler is g++ under OSX 10.5 & 10.6

You tried it on two Macs? This is about 99.9% not OSX or compiler
problem but defect in your source code.

It feels that your running software is trying to tell you that it
throws unhandled exceptions and so it has to close. The message (that
you fail to reproduce here) likely tells that it is program's (as
opposed to its user's) fault that it closes.

You have to debug your program (run it in debugger or use post-mortem
debugger) to see what exception and from where has been actually
thrown. Otherwise we can't help.
 
J

Juha Nieminen

Philipp Kraus said:
Compiler is g++ under OSX 10.5 & 10.6

Compile the program with the -g compiler option and then run the
program with gdb (iow. "gdb ./yourprogram" and then "run"), and if/when
it crashes it should show the line where it does. (If the line is
nondescriptive eg. because it's in some system library, write "bt"
to get a backtrace. The first line in the backtrace which is in your
own code is usually a good indicative.)
 
J

James Kanze

Compile the program with the -g compiler option and then run the
program with gdb (iow. "gdb ./yourprogram" and then "run"), and if/when
it crashes it should show the line where it does. (If the line is
nondescriptive eg. because it's in some system library, write "bt"
to get a backtrace. The first line in the backtrace which is in your
own code is usually a good indicative.)

Except when it's not:). Corrupting the free space arena is a
frequent cause of such problems, and of course, the "crash"
occurs in an allocation totally unrelated to where the error
was.

(Such problems are really fun to debug:). To top it off, the
last time I had to attack one, 1) I'd just entered a new
company, and had never seen the half a million lines of code
before I was asked to debug it, and 2) the actual problem was
due to the compiler generating wrong code in a tight loop. Both
very exceptional cases, which multiply the difficulty by several
orders of magnitude. On the other hand, without such difficult
problems, I'd be hard pressed to justify how much I'm paid, so I
won't complain too much.)
 
J

Juha Nieminen

James Kanze said:
Except when it's not:). Corrupting the free space arena is a
frequent cause of such problems, and of course, the "crash"
occurs in an allocation totally unrelated to where the error
was.

valgrind is a good tool to find such problems. I don't know if it's
available for Mac, though.
 
M

Marc

Juha said:
valgrind is a good tool to find such problems. I don't know if it's
available for Mac, though.

It is, but the port isn't as mature as the linux one.
 

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

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top