Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I am the wandering glitch -- catch me if you can.


computers / comp.sys.raspberry-pi / Re: The C Gods hate me.

SubjectAuthor
* The C Gods hate me.The Natural Philosopher
+* Re: The C Gods hate me.Andy Burns
|`- Re: The C Gods hate me.The Natural Philosopher
+* Re: The C Gods hate me.David Taylor
|`- Re: The C Gods hate me.The Natural Philosopher
+* Re: The C Gods hate me.TimS
|`- Re: The C Gods hate me.The Natural Philosopher
+* Re: The C Gods hate me.Ahem A Rivet's Shot
|+* Re: The C Gods hate me.Dennis
||`- Re: The C Gods hate me.The Natural Philosopher
|`- Re: The C Gods hate me.The Natural Philosopher
+- Re: The C Gods hate me.Computer Nerd Kev
+* Re: The C Gods hate me.Jan Panteltje
|+- Re: The C Gods hate me.Pancho
|`* Re: The C Gods hate me.The Natural Philosopher
| `- Re: The C Gods hate me.Tauno Voipio
`* Re: The C Gods hate me.Pancho
 `* Re: The C Gods hate me.The Natural Philosopher
  `- Re: The C Gods hate me.Richard Kettlewell

1
The C Gods hate me.

<uatudn$3g3qj$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6872&group=comp.sys.raspberry-pi#6872

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: The C Gods hate me.
Date: Tue, 8 Aug 2023 18:35:51 +0100
Organization: A little, after lunch
Lines: 10
Message-ID: <uatudn$3g3qj$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 17:35:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="98aecfee9a1a74a1e68b7dfa32955af5";
logging-data="3673939"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tY9KxrIyWrcnaMirBcWJWQrsKclR3kh4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:JTmPSn9qm6bxqdiLxSWGOrS18B0=
Content-Language: en-GB
 by: The Natural Philosop - Tue, 8 Aug 2023 17:35 UTC

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."

Re: The C Gods hate me.

<kjfd6uFjv73U1@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6873&group=comp.sys.raspberry-pi#6873

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: use...@andyburns.uk (Andy Burns)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Tue, 8 Aug 2023 18:43:59 +0100
Lines: 7
Message-ID: <kjfd6uFjv73U1@mid.individual.net>
References: <uatudn$3g3qj$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net NEjOHC2VGgD+RrE8rW1YXgo8bkkPLCm0S4gFZVjmzA0p/si2SL
Cancel-Lock: sha1:C2mQIMZHAMtLzxEDrmCjdiu6L7Y= sha256:6V4DF+XPYGTfsMdRyoez7MRivicIZvV4Mg+Ksq4b/1Y=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <uatudn$3g3qj$3@dont-email.me>
 by: Andy Burns - Tue, 8 Aug 2023 17:43 UTC

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

Re: The C Gods hate me.

<uatuvq$37t04$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6874&group=comp.sys.raspberry-pi#6874

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david-ta...@blueyonder.co.uk.invalid (David Taylor)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Tue, 8 Aug 2023 18:45:30 +0100
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uatuvq$37t04$1@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me>
Reply-To: david-taylor@blueyonder.co.uk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 17:45:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="207442193633568fa5b09d6c8bbf777a";
logging-data="3404804"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Als18teh1a+Vsb685PK5TD22og+mi9l8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:tt+TypCjQDj+zLm13NkD5yp+oI8=
In-Reply-To: <uatudn$3g3qj$3@dont-email.me>
Content-Language: en-GB
 by: David Taylor - Tue, 8 Aug 2023 17:45 UTC

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?
--
Cheers,
David
Web: https://www.satsignal.eu

Re: The C Gods hate me.

<kjfdppFk7hsU1@mid.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6875&group=comp.sys.raspberry-pi#6875

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: tim...@streater.me.uk (TimS)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: 8 Aug 2023 17:54:01 GMT
Lines: 14
Message-ID: <kjfdppFk7hsU1@mid.individual.net>
References: <uatudn$3g3qj$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 7c79lGKAIuJoSX/1kasTlQvVZgJxCCJyhqnyUk7nxnWX1PKW9v
Cancel-Lock: sha1:VOXH/qzoA5ZOyYUroTsMBhKZpYU= sha256:WnI8CRCec72ayh3HUd78ucTEAwpGmdAEttCDpt+oafI=
X-Face: "M;\x&0=#cxDW4-*uL~{5d@+P7KmbB:]::l[1_h]^tu#H9yQ#.X4kSbDi;atp9otO=_G|Z2 t<Cay~&S1ru:A{I$SdbF$KS43iuPUwIh,8X"%3L;9=T~]BLW=IKvZ|/}D@Rml{4D#!Uc)|mu`34(e~ x[(n[\3.'{ChZ!"cF'!%M)iM0u~wQ"%,JC}JOhtI;:<EF5?fcf<^2T,{u.&U|?`X%B_eD##Y=ZdC2< Mq_b}MHzYQg8x-N,4)~`n*K*k?No"WVa3]]dntN(76o.nd1`;l}[-O<wJB{MQNv=H^6M`>CL2oMg$~ oW5:YPiBg[-rf40JdIu#K4A+M2gSW<LK5!!SEt:%K0z&:[N:7
User-Agent: Usenapp for MacOS
X-Usenapp: v1.27.1/l - Full License
 by: TimS - Tue, 8 Aug 2023 17:54 UTC

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.

--
Tim

Re: The C Gods hate me.

<20230808204319.345c9d6672d6b8805509794f@eircom.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6876&group=comp.sys.raspberry-pi#6876

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ste...@eircom.net (Ahem A Rivet's Shot)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Tue, 8 Aug 2023 20:43:19 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <20230808204319.345c9d6672d6b8805509794f@eircom.net>
References: <uatudn$3g3qj$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="ecb719d90f30306ca81384d0f10510a4";
logging-data="3718582"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FgnaorwAqrUelxhwpxEzyDjQsR+943is="
Cancel-Lock: sha1:1sdCRL3h3JGmZREIE1RGCPI8Qdg=
X-Clacks-Overhead: "GNU Terry Pratchett"
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1)
 by: Ahem A Rivet's - Tue, 8 Aug 2023 19:43 UTC

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.

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/
Host: Beautiful Theory meet Inconvenient Fact
Obit: Beautiful Theory died today of factual inconsistency

Re: The C Gods hate me.

<uaueg8$3il6k$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6877&group=comp.sys.raspberry-pi#6877

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: den...@none.none (Dennis)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Tue, 8 Aug 2023 17:10:16 -0500
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uaueg8$3il6k$1@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me>
<20230808204319.345c9d6672d6b8805509794f@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 22:10:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="04976e5159ed4596485ecf11b063770b";
logging-data="3757268"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Xralfy9Ea8tEEX/N1ux1JLtd5mZ87zl8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:8ry9U6ExfQDryhKzn1XNk8iGKWc=
In-Reply-To: <20230808204319.345c9d6672d6b8805509794f@eircom.net>
Content-Language: en-US
 by: Dennis - Tue, 8 Aug 2023 22:10 UTC

On 8/8/23 14:43, Ahem A Rivet's Shot wrote:
>
> Yeah - you probably have an access beyond bounds problem - have fun
> finding it.
>
Another possibility is a timing problem. Debug code can slow things down
enough to change a race condition.

Re: The C Gods hate me.

<64d2c92a@news.ausics.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6878&group=comp.sys.raspberry-pi#6878

  copy link   Newsgroups: comp.sys.raspberry-pi
Message-ID: <64d2c92a@news.ausics.net>
From: not...@telling.you.invalid (Computer Nerd Kev)
Subject: Re: The C Gods hate me.
Newsgroups: comp.sys.raspberry-pi
References: <uatudn$3g3qj$3@dont-email.me>
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i586))
NNTP-Posting-Host: news.ausics.net
Date: 9 Aug 2023 09:00:59 +1000
Organization: Ausics - https://www.ausics.net
Lines: 13
X-Complaints: abuse@ausics.net
Path: i2pn2.org!i2pn.org!news.bbs.nz!news.ausics.net!not-for-mail
 by: Computer Nerd Kev - Tue, 8 Aug 2023 23:00 UTC

The Natural Philosopher <tnp@invalid.invalid> wrote:
> Every time I add debugging code it works perfectly: every time I remove
> it, it stops working....

You could also try Gdb on the version with the debugging code
turned off. But building with Gdb support enabled can change
program behaviour too. I found it wasn't friendly with (direct)
GPIO operations on the Pi Zero and things only worked sensibly
without it.

--
__ __
#_ < |\| |< _#

Re: The C Gods hate me.

<uav8ug$3jlb$1@solani.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6881&group=comp.sys.raspberry-pi#6881

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ali...@comet.invalid (Jan Panteltje)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 09 Aug 2023 05:41:36 GMT
Message-ID: <uav8ug$3jlb$1@solani.org>
References: <uatudn$3g3qj$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; ISO-8859-15
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Aug 2023 05:41:36 -0000 (UTC)
Injection-Info: solani.org;
logging-data="118443"; mail-complaints-to="abuse@news.solani.org"
User-Agent: NewsFleX-1.5.7.5 (Linux-5.15.32-v7l+)
Cancel-Lock: sha1:SszB23CTslk62mE0XtHc1jHuJUw=
X-Newsreader-location: NewsFleX-1.5.7.5 (c) 'LIGHTSPEED' off line news reader for the Linux platform
NewsFleX homepage: http://www.panteltje.nl/panteltje/newsflex/ and ftp download ftp://sunsite.unc.edu/pub/linux/system/news/readers/
X-User-ID: eJwFwQkRADAIAzBL4ykFOdwY/iUsgYXEpQfCsVhBqbzRjSckhHf8BJBTnlBrHjt1J3WNVqIsLJ3Zgu71Dxy9E/s=
 by: Jan Panteltje - Wed, 9 Aug 2023 05:41 UTC

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?

>--
>"Women actually are capable of being far more than the feminists will
>let them."
>
>
>

Re: The C Gods hate me.

<uavdo8$3q9gu$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6883&group=comp.sys.raspberry-pi#6883

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Pancho.J...@proton.me (Pancho)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 08:03:36 +0100
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uavdo8$3q9gu$1@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 07:03:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71f76884b64a2e3b59d45a31219aa24d";
logging-data="4007454"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+V3VJA1QSSPXxf1tPCFoNQsHmudn8ru78="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:c2r7mTosu3Ra2ovaNPC9cZjwFlQ=
Content-Language: en-GB
In-Reply-To: <uatudn$3g3qj$3@dont-email.me>
 by: Pancho - Wed, 9 Aug 2023 07:03 UTC

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.

Re: The C Gods hate me.

<uave6v$3q9gu$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6884&group=comp.sys.raspberry-pi#6884

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Pancho.J...@proton.me (Pancho)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 08:11:27 +0100
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <uave6v$3q9gu$2@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <uav8ug$3jlb$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 07:11:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71f76884b64a2e3b59d45a31219aa24d";
logging-data="4007454"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pnDHvnjjMqP2a1kQoCNj/5fze3dJ2En8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:oOdzhVtoXWdDhLqZwF3srs0mrbI=
Content-Language: en-GB
In-Reply-To: <uav8ug$3jlb$1@solani.org>
 by: Pancho - Wed, 9 Aug 2023 07:11 UTC

On 09/08/2023 06:41, Jan Panteltje wrote:
> 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.
>

Sorry, I should have read your post before I posted mine. I made the
same kind of point. Diagnostics should be permanent.

Although, what you are suggesting looks a bit like a verbose version of
ASSERT. Which can cause problems. In general, I prefer loggers.

Re: The C Gods hate me.

<uavmko$3smkd$10@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6885&group=comp.sys.raspberry-pi#6885

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:35:20 +0100
Organization: A little, after lunch
Message-ID: <uavmko$3smkd$10@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <kjfd6uFjv73U1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 09:35:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <kjfd6uFjv73U1@mid.individual.net>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:35 UTC

On 08/08/2023 18:43, Andy Burns wrote:
> 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
>
Murphy at work.

--
"It is an established fact to 97% confidence limits that left wing
conspirators see right wing conspiracies everywhere"

Re: The C Gods hate me.

<uavmo3$3smkd$11@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6886&group=comp.sys.raspberry-pi#6886

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:37:07 +0100
Organization: A little, after lunch
Message-ID: <uavmo3$3smkd$11@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <uatuvq$37t04$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Aug 2023 09:37:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <uatuvq$37t04$1@dont-email.me>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:37 UTC

On 08/08/2023 18:45, David Taylor wrote:
> 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?

Well obviously something utterly stupid is going on, and I still don't
feel very intelligent yet. More coffee may encourage me to look. It is
quite complex with about a dozen variables being compared to arrive at a
single state change.

--
"It is an established fact to 97% confidence limits that left wing
conspirators see right wing conspiracies everywhere"

Re: The C Gods hate me.

<uavmq4$3smkd$12@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6887&group=comp.sys.raspberry-pi#6887

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:38:12 +0100
Organization: A little, after lunch
Message-ID: <uavmq4$3smkd$12@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <kjfdppFk7hsU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 09:38:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <kjfdppFk7hsU1@mid.individual.net>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:38 UTC

On 08/08/2023 18:54, TimS wrote:
> 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.
>
Could be I deleted something else than the debug statements. Which was a
massive printf printing out everything..

--
"When one man dies it's a tragedy. When thousands die it's statistics."

Josef Stalin

Re: The C Gods hate me.

<uavmtp$3smkd$13@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6888&group=comp.sys.raspberry-pi#6888

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:40:09 +0100
Organization: A little, after lunch
Message-ID: <uavmtp$3smkd$13@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me>
<20230808204319.345c9d6672d6b8805509794f@eircom.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 09:40:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <20230808204319.345c9d6672d6b8805509794f@eircom.net>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:40 UTC

On 08/08/2023 20:43, Ahem A Rivet's Shot wrote:
> 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.
>
No, its nothing like that, its is a series of complicated 'if'
conditions. It may pay me to draw a state diagram and rewrite it
completely as a state machine.

--
"When one man dies it's a tragedy. When thousands die it's statistics."

Josef Stalin

Re: The C Gods hate me.

<uavmuo$3smkd$14@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6889&group=comp.sys.raspberry-pi#6889

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:40:40 +0100
Organization: A little, after lunch
Message-ID: <uavmuo$3smkd$14@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me>
<20230808204319.345c9d6672d6b8805509794f@eircom.net>
<uaueg8$3il6k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Aug 2023 09:40:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <uaueg8$3il6k$1@dont-email.me>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:40 UTC

On 08/08/2023 23:10, Dennis wrote:
> On 8/8/23 14:43, Ahem A Rivet's Shot wrote:
>>
>>     Yeah - you probably have an access beyond bounds problem - have fun
>> finding it.
>>
> Another possibility is a timing problem. Debug code can slow things down
> enough to change a race condition.
>
Its really not that complicated. That's what is annoying me.

--
"When one man dies it's a tragedy. When thousands die it's statistics."

Josef Stalin

Re: The C Gods hate me.

<uavn06$3smkd$15@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6890&group=comp.sys.raspberry-pi#6890

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:41:26 +0100
Organization: A little, after lunch
Message-ID: <uavn06$3smkd$15@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <uav8ug$3jlb$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 09:41:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <uav8ug$3jlb$1@solani.org>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:41 UTC

On 09/08/2023 06:41, Jan Panteltje wrote:
> 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?
>
>
>> --
>> "Women actually are capable of being far more than the feminists will
>> let them."
>>
>>
>>
Command line switched debug might be worthwhile in this case.

--
"When one man dies it's a tragedy. When thousands die it's statistics."

Josef Stalin

Re: The C Gods hate me.

<uavnd5$3smkd$16@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6891&group=comp.sys.raspberry-pi#6891

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.212.69.38.60!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 9 Aug 2023 10:48:21 +0100
Organization: A little, after lunch
Message-ID: <uavnd5$3smkd$16@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <uavdo8$3q9gu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Aug 2023 09:48:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="212.69.38.60";
logging-data="4086413"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Content-Language: en-GB
In-Reply-To: <uavdo8$3q9gu$1@dont-email.me>
 by: The Natural Philosop - Wed, 9 Aug 2023 09:48 UTC

On 09/08/2023 08:03, Pancho wrote:
> 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.

Its not a program bug so much as an logical aberration, the code is
written to do a given thing, but it only does it when I print out the
variables first.

I found tow nasties already - an fopen with no fclose that leaked memory
in an infinite loop, and a value that was a default of zero if no other
value was supplied, that said you were happy if the central heating left
the room at freezing point :-)

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...

Apart from the usual slew of syntax errors from missed
semicolons,,misspelt variable names, un-paired brackets etc. etc.

--
"When one man dies it's a tragedy. When thousands die it's statistics."

Josef Stalin

Re: The C Gods hate me.

<wwvpm3w5kql.fsf@LkoBDZeT.terraraq.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6894&group=comp.sys.raspberry-pi#6894

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.nntp4.net!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: inva...@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Wed, 09 Aug 2023 15:54:58 +0100
Organization: terraraq NNTP server
Message-ID: <wwvpm3w5kql.fsf@LkoBDZeT.terraraq.uk>
References: <uatudn$3g3qj$3@dont-email.me> <uavdo8$3q9gu$1@dont-email.me>
<uavnd5$3smkd$16@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="56968"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:6TvHOtvscTS12vnJs+wSn/6xBaU=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
 by: Richard Kettlewell - Wed, 9 Aug 2023 14:54 UTC

The Natural Philosopher <tnp@invalid.invalid> writes:
> 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...

The compiler can warn you about that one; but you do have to turn
warnings on. -Wall -Wextra is a common minimum. I usually use -Werror as
well to enforce that all warnings are cleaned up but that’s more of a
matter of taste.

$ cat t.c
int function(int);

int main(void) {
int g, h = 0;
if(g=function(h) >0)
return 0;
else
return 1;
}
$ gcc -c t.c
$ gcc -Wall -Wextra -c t.c
t.c: In function ‘main’:
t.c:5:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
5 | if(g=function(h) >0)
| ^

--
https://www.greenend.org.uk/rjk/

Re: The C Gods hate me.

<ub2ab9$b0j8$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6905&group=comp.sys.raspberry-pi#6905

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.dsl-jklbng11-54fb2c-139.dhcp.inet.fi!not-for-mail
From: tauno.vo...@notused.fi.invalid (Tauno Voipio)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: The C Gods hate me.
Date: Thu, 10 Aug 2023 12:23:52 +0300
Organization: A noiseless patient Spider
Message-ID: <ub2ab9$b0j8$1@dont-email.me>
References: <uatudn$3g3qj$3@dont-email.me> <uav8ug$3jlb$1@solani.org>
<uavn06$3smkd$15@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 10 Aug 2023 09:23:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="dsl-jklbng11-54fb2c-139.dhcp.inet.fi:84.251.44.139";
logging-data="361064"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <uavn06$3smkd$15@dont-email.me>
Content-Language: en-GB
 by: Tauno Voipio - Thu, 10 Aug 2023 09:23 UTC

On 9.8.2023 12:41 PM, The Natural Philosopher wrote:

>> 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);
>>      }
>>

Drop the backslash from the end of thew fprintf line. It is perfectly
allowable to have whitespace between the function arguments. Whitespace
includes newlines.

--

-TV

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor