Printf stalling
by Richard_H · in Torque Game Engine · 02/27/2007 (7:13 pm) · 8 replies
It seems that I very innocent looking line has caused my program to come to a halt. No error, it merely seems to freeze up, as if in an infinite loop.
I've traced the culprit down to this line:
Does anyone know what error I am making?
Note: I can include more code if this isn't enough.
Edit: Can someone please move this to the private forums?
I've traced the culprit down to this line:
Con::printf("Beginning to populate [%d][%d] sized mission.", maxX, maxY);Both maxX and maxY are S16s and when I debugged they had the value 3.Does anyone know what error I am making?
Note: I can include more code if this isn't enough.
Edit: Can someone please move this to the private forums?
About the author
#2
02/28/2007 (3:23 am)
It seems that further debugging revealed it's merely not printing input and the program is stalling later. I tried changing the %d 's to %ld 's or %hd 's, but it still refuses to print.
#3
02/28/2007 (6:44 am)
First... where do you expect it to print? If you want it to go to a log file then you must have the log file opened.
#4
02/28/2007 (10:49 am)
Are you running this from a different thread? The engine uses Con::printf *everywhere*, it is entirely possible that, somehow, there is a deadlock going on.
#5
02/28/2007 (2:18 pm)
I believe I have solved my problem, It seems that I messed it up after changing some seemingly unrelated code. The problem was at first it worked fine, but after other changes printf stopped working and refused to start again. Other printf statements would work fine, but this one statement continued to cause issues. Finally, after fixing up my code it works again, but it seems to have a lag to it. I used my debugger and only several statements later did the line appear in my log file, but at least it works.
#6
i believe that's normal - the console.log is buffered.
02/28/2007 (3:17 pm)
Quote:I used my debugger and only several statements later did the line appear in my log file, but at least it works
i believe that's normal - the console.log is buffered.
#7
I have never seen any lag though.
02/28/2007 (4:08 pm)
Sounds to me like you tried to access an invalid address (maxX/Y?).I have never seen any lag though.
#8
02/28/2007 (4:16 pm)
Quote:... when I debugged they had the value 3I checked the value of both variables.
Torque 3D Owner Tony Richards
Also, since this is C++, you'd be better off posting in the private forums.