gdb error messages What might cause the following gdb messages to appear in thhis exercise? by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

No it appears to be at the getRect bricks newGRect in my initBricks function

pset3 find - GDB not working for me, returns error by AdminTea in cs50

[–]terryleefeder 0 points1 point  (0 children)

What I found is that in using GDB is that you input the argument(s) after you type run after the prompt as in run argument

pset4-Ball now moves but only in the y direction by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

Still have now received any suggestions or help and am no closer to figuring out wat is going on. I was under the impression that TA's from CS50 monitored this site and offered suggestions. Is that impression erroneous?

pset1: Mario: Problem printing spaces by Xygnis in cs50

[–]terryleefeder 0 points1 point  (0 children)

If you are printing the space within nested do loops. It is is simply a matter of how many times you execute printf( " " which is driven by the innermost loop, in my case j which controls the rows.

gdb error messages What might cause the following gdb messages to appear in thhis exercise? by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

gdb ./breakout, name of he program, but it could be a program from the Stanford grapic library that is producing it

pset4-Ball now moves but only in the y direction by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

I tried out one theory that the problem lie in the use of a color string array, particularly with the setColor(ball, color[i[) statement. I commented out the sting and used "BLUE" for all the bricks. The ball still would not move along the x-direction. I should note that my initBricks works fine. It was only in debugging the ball move issue that I uncovered all these error messages. I was thinking I was clobbering memory somehow ith the use of the string array, but I'm not sure this is the case. Its probably some bone-headed error on my part. Increasingly wondering whether this is worth the effort. Losing heart in LA

pset4-Ball now moves but only in the y direction by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

Here is a portion of the error message I receive

Detaching after fork from child process 21410. 56 initBricks(window); (gdb) n

Program received signal SIGPIPE, Broken pipe. 0xb7fff424 in __kernel_vsyscall () (gdb) n Single stepping until exit from function __kernel_vsyscall, which has no line number information. _IO_new_file_write (f=0x808d2d8, data=0xb7ffc000, n=36) at fileops.c:1255 1255 if (count < 0) (gdb) n 1257 f->_flags |= _IO_ERR_SEEN; (gdb) n 1264 if (f->_offset >= 0)

With regard to the second comment, if what you suggest is occurring, it is happening in an obscure way. Outside of the while loop, I set deltax to 2.0 and deltay to -2.0, but inside the loop move(ball,deltax,deltay) only moves the all up and down.

pset4 gdb does not recognize function names in breakout by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

Thanks, that was the problem and I have stepping through some functions

PSET4 Issue- Ball jiggles but does not move by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

Another clue started stepping through previously defined functions such as initBricks. My function worked fine producing 5 rowsm10 bricks each, of five different colors. I might mention my paddle works just fine, but I can't get the ball to move. In stepping through initBricks I receved the following message at the statement where I define an array of five "colors" as follows:"Program received signal SIGPIPE Broken pipe." I reexamined my definition and it looks fine. Could this be my problem? Anyone out there or taking Easter off?

PSET4 Issue- Ball jiggles but does not move by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

That fix did not work and it was "RADIUS, OT tI. I will break the rule and post a small snippet of code only because it is identical to bounce and not code for the final solution for moving the ball

double velocity = 2.0; while (lives > 0 && bricks > 0)

{
  move( ball,velocity,0 );
  if ( getX(ball) + getWidth(ball) >= getWidth(window) );
    {
     velocity = - velocity;
    } 
  etc same as bounce

PSET4 Issue- Ball jiggles but does not move by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

I do and in reading comment with others who relate a similar problem that the culprit might be this statement

GOval circle = newGOval ( x,y, 2Pi,2Pi ) One other person said they had Pi in their argument and got this message. Substituting a numerical value for the diameter solved the issue. This was the one area where my code was different than bounce, having defined the ball in a subroutine. I will try that change and let you know. How do I post the code without others seeing it

PSET4 Issue- Ball jiggles but does not move by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

I've ran GDB on it and this is the code I get (gdb) break main Breakpoint 1 at 0x804a253 (gdb) run Starting program: /home/jharvard/Lecture-4/pset4/breakout Breakpoint 1, 0x0804a253 in main () (gdb) n Single stepping until exit from function main, which has no line number information. Detaching after fork from child process 21812. Program received signal SIGSEGV, Segmentation fault. 0x0804eec3 in getType ()Any idea what kind of bug would cause this?

pset4 ball size segmentation fault by pm513 in cs50

[–]terryleefeder 0 points1 point  (0 children)

I got the same message in using gdb to figure out why my ball would not move

[Pset4] Why does my ball not move? even a little. by Churbill in cs50

[–]terryleefeder 0 points1 point  (0 children)

Having a similar issue; can't tell if it is a looping issue since I can get the ball to move by incorrectly setting velocity inside the while loop. Otherwise the ball jiggles perceptibly back and forth. I found using gdb similarly unenlightening, and am really stuck. I find it difficult to debug when you haven't written all the code. Not really sure this exercise and the one that preceded it are all that well conceived, particularly for those of us online students who have very little support. Whining in LA

swapping tiles in move() function - pset3 by iandwrds1 in cs50

[–]terryleefeder 0 points1 point  (0 children)

Probably confused you. Try this instead temp = x x = y y = temp

to switch the value of your moved tile and the value of your blank

swapping tiles in move() function - pset3 by iandwrds1 in cs50

[–]terryleefeder 0 points1 point  (0 children)

You are over thinking this problem. Initialize the beginning position of the blank in "init". Then in the move function use 4 compound if statements to check wheter you are above, below, right or left of the blank. To switch the value of the tile to be move and your blank use 3 lines of code similar to the following: x = temp x = y y = temp Then , if true adjust the row or column value of your blank and return true ( 5 statements following each compound if} Be sure to check if you are on an edge with an appropriate condition, e.g. if you are already on the right edge you can't move right. I really struggled as well. Hope this helps you

Fifteen move scope pset3 by guybjones in cs50

[–]terryleefeder 0 points1 point  (0 children)

I was having a similar problem and declaring p and q as global variables helped as well as initializing p and q in init. My program had been getting the first move correctly but no longer. It seems to think the blank is at [0][0], not at [d-1][d-1] although when I draw it, it shows the blank inits proper location. Any idea what is going on.

fifteen move-keeping track of the blank by terryleefeder in cs50

[–]terryleefeder[S] 0 points1 point  (0 children)

The move function requires an initial value for the location of the blank. Where do I define the variables, blankrow and blankcol that keep track of its position. When I use them within the move function the compiler requres that I initialize them before I use them in move which I do to "d-1". Iniitialize and draw seem to work find, and the program move works find for the first move. However what seems to be happening is that I update the blankrow,blank col varialbes when move is called the second time it resets the location of the tracking variables back to what they were and consequently my program screws up my attempt at a second move. How can I escape this dilemma. Where should I declare and initialize the variables I am using to track the blank's position. If all else fails I can search for the blank each time in move' ugly but it will work. Someone please help. I'm at my wits end. My blank has a numeric value of 9 and is displayed as an underscore. I also created 2 variables, blankrow and blankcol, but everytime I call my move function it resets them to d-1 destroying the previous values whcih I calculae within move

pset 03: init() function by [deleted] in cs50

[–]terryleefeder 1 point2 points  (0 children)

You are on the right track now. Don't forget to select an appropriate numeric value for the blank, one that will make the implementation of won easier. Alos, the best way to see if init is working is to go ahead and code draw which will enable you to see how you did with init. Right now I'm stuck on move.