Program stops, maybe owing to gmp or mpfr

I have a program and no idea what's wrong. I'm using variables both from the gmp and mpfr libraries. The program worked fine the first time, but now when I run it (with no changes to the code) it stops between two cout commands. It doesn't terminate, just stops and doesn't write to screen the next cout input. The strange thing is, if I cancel the second cout with // and put another with different input below, this new one is executed before the program stops again.

To clarify, this program writes "ok" but then stops and never writes "performing boot...":

1
2
3
4
5
6
7
8
9
10
11
12
13
(...)

	}
	positions.close();
	
	cout << "ok" << endl;
	
	cout << "performing bootstrap: polynomial weight 0";

	for(i2=0; i2<t; i2++) {
	cout << ", " << i2;

(...)


And this one writes "ok" and "ok2" and then stops:

1
2
3
4
5
6
7
8
9
10
11
12
(...)
	}
	positions.close();
	
	cout << "ok" << endl;
	
	//cout << "performing bootstrap: polynomial weight 0";
	cout << "ok2" << endl;

	for(i2=0; i2<t; i2++) {
	cout << ", " << i2;
(...)


I'm leaving out the rest of the code because it's really long. Any ideas to what could cause this?
I've seen similar crazy behavior when the stack has been trashed. If you're running this under Linux, try running it with valgrind and see if you're doing something with memory that you shouldn't be.
Thanks! Thought it might be something like that, since I'm unfamiliar with multiprecision libraries. I'm running windows but I'll try something similar to valgrind
Topic archived. No new replies allowed.