Venting thread

Topics that can go away
User avatar
Ryusenshi
Posts: 383
Joined: Sun Jul 08, 2018 1:57 pm
Location: Somewhere in France

Venting thread

Post by Ryusenshi »

Today, an interesting case of heisenbug: my program works perfectly on my laptop, but when I run it on a distant machine, I get a lot of NaN results... OK, so I add a handful of printf to try to localize the bug. And now the results are fine! So I remove the printf... and the NaNs are back. Unbelievable.

EDIT: hmm, apparently compiling with -O0 resolves the bug. It seems my compiler makes some unsafe optimization, but can't do it with a printf.
Travis B.
Posts: 6763
Joined: Sun Jul 15, 2018 8:52 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by Travis B. »

Ryusenshi wrote: Sat Dec 05, 2020 10:19 am Today, an interesting case of heisenbug: my program works perfectly on my laptop, but when I run it on a distant machine, I get a lot of NaN results... OK, so I add a handful of printf to try to localize the bug. And now the results are fine! So I remove the printf... and the NaNs are back. Unbelievable.

EDIT: hmm, apparently compiling with -O0 resolves the bug. It seems my compiler makes some unsafe optimization, but can't do it with a printf.
Heisenbugs are always fun. Note that the fact that it works only with -O0 or printf may indicate that your code is actually doing unsafe, which it just happens to be able to get away with under certain conditions.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Travis B.
Posts: 6763
Joined: Sun Jul 15, 2018 8:52 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by Travis B. »

I had a minor case of the stupids today; I was wondering why my breakpoints weren't catching, when I finally remembered that I was running code on the remote server, while I was setting breakpoints on my local server (I can't set breakpoints on the remote server), so obviously they were not going to catch!
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
zompist
Site Admin
Posts: 2912
Joined: Sun Jul 08, 2018 5:46 am
Location: Right here, probably
Contact:

Re: Venting thread that is tentatively once again all-inclusive

Post by zompist »

Travis B. wrote: Sat Dec 05, 2020 12:37 pm I had a minor case of the stupids today; I was wondering why my breakpoints weren't catching, when I finally remembered that I was running code on the remote server, while I was setting breakpoints on my local server (I can't set breakpoints on the remote server), so obviously they were not going to catch!
I feel like I do versions of this all the time. Not breakpoints per se, but getting frustrated because my obviously correct fix isn't working, and then realizing that the fix and the behavior I'm looking at are on different machines.
User avatar
Man in Space
Posts: 1666
Joined: Sat Jul 21, 2018 1:05 am

Re: Venting thread that is tentatively once again all-inclusive

Post by Man in Space »

For the past week or thereabouts I’ve been regularly starting my days well but then developing a 100+ fever and a stuffy nose in the evenings. Now joint pain is in the mix. I’m suspecting flu.
rotting bones
Posts: 1380
Joined: Tue Dec 04, 2018 5:16 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by rotting bones »

Man in Space wrote: Sat Dec 05, 2020 9:57 pm For the past week or thereabouts I’ve been regularly starting my days well but then developing a 100+ fever and a stuffy nose in the evenings. Now joint pain is in the mix. I’m suspecting flu.
Get well soon.
User avatar
Raphael
Posts: 4480
Joined: Sun Jul 22, 2018 6:36 am

Re: Venting thread that is tentatively once again all-inclusive

Post by Raphael »

Man in Space wrote: Sat Dec 05, 2020 9:57 pm For the past week or thereabouts I’ve been regularly starting my days well but then developing a 100+ fever and a stuffy nose in the evenings. Now joint pain is in the mix. I’m suspecting flu.
Good luck!
User avatar
Ryusenshi
Posts: 383
Joined: Sun Jul 08, 2018 1:57 pm
Location: Somewhere in France

Re: Venting thread that is tentatively once again all-inclusive

Post by Ryusenshi »

Problem solved, by passing the result through a variable instead of inserting it into the array directly (which was probably the unsafe step).
Travis B.
Posts: 6763
Joined: Sun Jul 15, 2018 8:52 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by Travis B. »

Ryusenshi wrote: Sun Dec 06, 2020 12:10 pm Problem solved, by passing the result through a variable instead of inserting it into the array directly (which was probably the unsafe step).
That is odd - I don't see why that'd make a difference unto itself.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
Ryusenshi
Posts: 383
Joined: Sun Jul 08, 2018 1:57 pm
Location: Somewhere in France

Re: Venting thread that is tentatively once again all-inclusive

Post by Ryusenshi »

Travis B. wrote: Sun Dec 06, 2020 12:16 pmI don't see why that'd make a difference unto itself.
This is what I thought about printf in the first place, and yet here we are.
Travis B.
Posts: 6763
Joined: Sun Jul 15, 2018 8:52 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by Travis B. »

Ryusenshi wrote: Sun Dec 06, 2020 12:51 pm
Travis B. wrote: Sun Dec 06, 2020 12:16 pmI don't see why that'd make a difference unto itself.
This is what I thought about printf in the first place, and yet here we are.
The significance of printf is that it prevents optimizations from taking place by breaking up the code. However I would be hesitant to blame the compiler unless all the other possible causes can be ruled out.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
alice
Posts: 954
Joined: Mon Jul 09, 2018 11:15 am
Location: 'twixt Survival and Guilt

Re: Venting thread that is tentatively once again all-inclusive

Post by alice »

Travis B. wrote: Sun Dec 06, 2020 12:58 pm The significance of printf is that it prevents optimizations from taking place by breaking up the code. However I would be hesitant to blame the compiler unless all the other possible causes can be ruled out.
printf? Real programmers flash the lights on their keyboard in optimised Morse code!
Self-referential signatures are for people too boring to come up with more interesting alternatives.
rotting bones
Posts: 1380
Joined: Tue Dec 04, 2018 5:16 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by rotting bones »

Let's be real. A real programmer can solve any problem in the world by inducing viscous flow in the sweat collected in his own belly button. Source: https://gilkalai.wordpress.com/2014/02/ ... computers/
Travis B.
Posts: 6763
Joined: Sun Jul 15, 2018 8:52 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by Travis B. »

alice wrote: Sun Dec 06, 2020 1:03 pm
Travis B. wrote: Sun Dec 06, 2020 12:58 pm The significance of printf is that it prevents optimizations from taking place by breaking up the code. However I would be hesitant to blame the compiler unless all the other possible causes can be ruled out.
printf? Real programmers flash the lights on their keyboard in optimised Morse code!
One could limit oneself to blinking LED's on one's board...

but even most MCU's (and we are talking tiny systems here) at least come with a USART which one can hook up to a serial dongle, and thus communicate with with a terminal emulator.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
rotting bones
Posts: 1380
Joined: Tue Dec 04, 2018 5:16 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by rotting bones »

I've been feeling absolutely terrible since yesterday. Today, it's worse. I can't eat or sleep. All I feel is anxiety. I don't think anything is wrong with me. I have to present my final project tomorrow, and I can't concentrate on my work. I even cleared my schedule since Thursday so I'd have lots of time. It didn't work. It wouldn't be so bad if I didn't have to teach two 1.5 hour classes tomorrow as well.
User avatar
Raphael
Posts: 4480
Joined: Sun Jul 22, 2018 6:36 am

Re: Venting thread that is tentatively once again all-inclusive

Post by Raphael »

rotting bones wrote: Sun Dec 06, 2020 9:22 pm I've been feeling absolutely terrible since yesterday. Today, it's worse. I can't eat or sleep. All I feel is anxiety. I don't think anything is wrong with me. I have to present my final project tomorrow, and I can't concentrate on my work. I even cleared my schedule since Thursday so I'd have lots of time. It didn't work. It wouldn't be so bad if I didn't have to teach two 1.5 hour classes tomorrow as well.
I hope this somehow works out and you get better.
Travis B.
Posts: 6763
Joined: Sun Jul 15, 2018 8:52 pm

Re: Venting thread that is tentatively once again all-inclusive

Post by Travis B. »

I feel utterly stuck on my priority inversion-resistant lock implementation. In a particular test scenario, one task that is holding a number of locks and then releasing them so other tasks can take them is getting descheduled inexplicably; even when I put code in the scheduling and descheduling routines they do not record the task getting descheduled, but when I test the task after the fact it clearly has been descheduled. It's been like a couple weeks now and I have gotten nowhere on this.
Yaaludinuya siima d'at yiseka wohadetafa gaare.
Ennadinut'a gaare d'ate eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
malloc
Posts: 555
Joined: Mon Jul 09, 2018 8:42 pm
Location: The Vendée of America

Re: Venting thread that is tentatively once again all-inclusive

Post by malloc »

Over the past few months, I have gotten several calls saying that I've been charged with some unspecified crime. My family says they are just scams, but they keep coming and I am starting to worry. I cannot think of anything illegal I have done over the past year, apart maybe from voting absentee without a sufficiently compelling reason or making some mistake when filing my income taxes.
Mureta ikan topaasenni.
Koomát terratomít juneeratu!
Anti-TESCREAL Action | He/him
User avatar
alice
Posts: 954
Joined: Mon Jul 09, 2018 11:15 am
Location: 'twixt Survival and Guilt

Re: Venting thread that is tentatively once again all-inclusive

Post by alice »

malloc wrote: Thu Dec 10, 2020 10:08 am Over the past few months, I have gotten several calls saying that I've been charged with some unspecified crime. My family says they are just scams, but they keep coming and I am starting to worry. I cannot think of anything illegal I have done over the past year, apart maybe from voting absentee without a sufficiently compelling reason or making some mistake when filing my income taxes.
Rest assured, these are scam calls. If you really were being charged with something, you would be told what it was, and it's very unlikely you would be told by phone. Is there a person or organisation you can call who deals with nuisance calls?
Self-referential signatures are for people too boring to come up with more interesting alternatives.
User avatar
Raphael
Posts: 4480
Joined: Sun Jul 22, 2018 6:36 am

Re: Venting thread that is tentatively once again all-inclusive

Post by Raphael »

Could it be someone who knows malloc, knows about his anxiety issues, and is playing a cruel prank on him?
Post Reply