Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
I think I'm going to watch TV instead.
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
I think I'm going to watch TV instead.
Yeah - you probably have an access beyond bounds problem - have fun finding it.
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
I think I'm going to watch TV instead.
--
"Women actually are capable of being far more than the feminists will
let them."
On a sunny day (Tue, 8 Aug 2023 18:35:51 +0100) it happened The Natural Philosopher <tnp@invalid.invalid> wrote in <uatudn$3g3qj$3@dont-email.me>:
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
Depends
I never use debuggiging code whatver that is
but every subroutine routine I write starts like this:
int connect_to_news_server(char *server, int port)
{
struct hostent *hp;
struct sockaddr_in sa; /* -Wall gets confused */
int a, i;
char temp[TEMP_SIZE];
char dotted_quad[TEMP_SIZE];
int flags;
time_t connect_timer;
extern int idle_cb();
int connect_flag;
unsigned long in;
int byname;
if(debug_flag)
{
fprintf(stdout, "connect_to_news_server(): arg server=%s port=%d\n",\
server, port);
}
/* argument check */
if(! server) return(0);
if(port <= 0) return(0);
So if I specify -v on the command line that sets 'debug_flag' and shows what is happening everywhere
If I just comment out the 'if(debug_flag)' it shows what's happening with / in that specific
routine.
If -v specified then with any argument error it wil exit with the last routine where it failed
Usually only takes a second to find a fault.
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
I think I'm going to watch TV instead.
On 08/08/2023 18:35, The Natural Philosopher wrote:
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
I think I'm going to watch TV instead.
Try changing the order in which variables are declared - perhaps you're overwriting something? Or something like that?
On 08 Aug 2023 at 18:35:51 BST, "The Natural Philosopher" <tnp@invalid.invalid> wrote:
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
I once earwigged on a conversation at CERN between a physicist and someone in the Program Enquiry Office, where users could go to get help with their programs. The physicist reported similar symptoms to you, and of course it turmned out that his conditional GOTO which was intended to skip the debugging
statements, was skipping a big chunk of that particular subroutine.
On Tue, 8 Aug 2023 18:35:51 +0100
The Natural Philosopher <tnp@invalid.invalid> wrote:
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
Many years ago a colleague of mine had one of those that he was
able to pin down to a bug in the register use tracking in that particular compiler (MS supplied IIRC). In the end the production code had a call out
to a function that did nothing just to force the compiler to behave.
I think I'm going to watch TV instead.
Yeah - you probably have an access beyond bounds problem - have fun finding it.
On 08/08/2023 18:35, The Natural Philosopher wrote:
Every time I add debugging code it works perfectly: every time I
remove it, it stops working....
I think I'm going to watch TV instead.
I try to make debug code part of the standard build, configurable at
runtime, e.g. loggers etc, is there a log4C? There is!
You might still have the same problem, but at least it is easier to switch.
On a sunny day (Tue, 8 Aug 2023 18:35:51 +0100) it happened The Natural Philosopher <tnp@invalid.invalid> wrote in <uatudn$3g3qj$3@dont-email.me>:
Every time I add debugging code it works perfectly: every time I remove
it, it stops working....
Depends
I never use debuggiging code whatver that is
but every subroutine routine I write starts like this:
int connect_to_news_server(char *server, int port)
{
struct hostent *hp;
struct sockaddr_in sa; /* -Wall gets confused */
int a, i;
char temp[TEMP_SIZE];
char dotted_quad[TEMP_SIZE];
int flags;
time_t connect_timer;
extern int idle_cb();
int connect_flag;
unsigned long in;
int byname;
if(debug_flag)
{
fprintf(stdout, "connect_to_news_server(): arg server=%s port=%d\n",\
server, port);
}
/* argument check */
if(! server) return(0);
if(port <= 0) return(0);
So if I specify -v on the command line that sets 'debug_flag' and shows what is happening everywhere
If I just comment out the 'if(debug_flag)' it shows what's happening with / in that specific
routine.
If -v specified then with any argument error it wil exit with the last routine where it failed
Usually only takes a second to find a fault.
I think I'm going to watch TV instead.
Yea but no football today?
Command line switched debug might be worthwhile in this case.--
"Women actually are capable of being far more than the feminists will
let them."
The Natural Philosopher wrote:
Every time I add debugging code it works perfectly: every time I
remove it, it stops working....
The lesser spotted heisenbug
On 8/8/23 14:43, Ahem A Rivet's Shot wrote:
Another possibility is a timing problem. Debug code can slow things down enough to change a race condition.
Yeah - you probably have an access beyond bounds problem - have fun >> finding it.
The only true bug I ran into was a precedence thing something like if(g=function(h) >0) where I forgot that assignment is a lower
priority than comparison...
int connect_to_news_server(char *server, int port)
{
struct hostent *hp;
struct sockaddr_in sa; /* -Wall gets confused */
int a, i;
char temp[TEMP_SIZE];
char dotted_quad[TEMP_SIZE];
int flags;
time_t connect_timer;
extern int idle_cb();
int connect_flag;
unsigned long in;
int byname;
if(debug_flag)
{
fprintf(stdout, "connect_to_news_server(): arg server=%s
port=%d\n",\
server, port);
}
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 371 |
Nodes: | 16 (2 / 14) |
Uptime: | 37:02:12 |
Calls: | 7,932 |
Calls today: | 2 |
Files: | 12,998 |
Messages: | 5,805,619 |