I have a piece of code about 600 lines long which currently doesn't run due to seg fault. I have run gdb but it isn't relly helping me as I don't know what I am looking for. I have also run valgrind which I have been led to believe i more helpful, but I am working on a mac and valgrind doesn't really work on mac. I don't have a linux box and so can't run valgrind properly. Is there anyone willing to run my code through valgrind to find the issue, or are there websites that do this?? The reason I ask here is because I have found websites, but because I am using the gmp bignum library, the website just kicks back error about the library not being there because they don't have it.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000008
0x000000010001ec2d in __gmpf_urandomb ()
#0 0x000000010001ec2d in __gmpf_urandomb ()
#1 0x0000000100002013 in main () at TammesA7.cc:60
(gdb) info frame
Stack level 0, frame at 0x7fff5fb61130:
rip = 0x10001ec2d in __gmpf_urandomb; saved rip 0x100002013
called by frame at 0x7fff5fbffb30
Arglist at 0x7fff5fb61128, args:
Locals at 0x7fff5fb61128, Previous frame's sp is 0x7fff5fb61130
rbx at 0x7fff5fb61108, r12 at 0x7fff5fb61110, r14 at 0x7fff5fb61118, r15 at 0x7fff5fb61120, rip at 0x7fff5fb61128
But I have copied the code with mpg_urandomb() into another file and compiled and run that, so I think I am using it right (with regard initialising etc.) so not sure why it is having an issue in this program.
I can post the code if needed, but like I say it is long and messy.
Yes I do, it is in a loop to assign random numbers (not integers) to floats, but like I said, I tooks this loops and put it in another program and that one runs fine which makes me wonder why it does not in this one...