Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
Ryhadar
Gerbil XP
Topic Author
Posts: 463
Joined: Tue Oct 21, 2008 9:51 pm

What's this phenomenon called?

Wed Apr 03, 2013 2:54 pm

That point where you suspect the compiler/interpreter to be wrong after you've re-read your failing code (that should work) hundreds of times now.

There's gotta be a name for that.
 
DancinJack
Maximum Gerbil
Posts: 4494
Joined: Sat Nov 25, 2006 3:21 pm
Location: Kansas

Re: What's this phenomenon called?

Wed Apr 03, 2013 2:59 pm

Programming?
i7 6700K - Z170 - 16GiB DDR4 - GTX 1080 - 512GB SSD - 256GB SSD - 500GB SSD - 3TB HDD- 27" IPS G-sync - Win10 Pro x64 - Ubuntu/Mint x64 :: 2015 13" rMBP Sierra :: Canon EOS 80D/Sony RX100
 
druidcent
Minister of Gerbil Affairs
Posts: 2510
Joined: Wed Aug 07, 2002 7:55 pm
Location: Earth, Sol, Milky Way
Contact:

Re: What's this phenomenon called?

Wed Apr 03, 2013 3:13 pm

Time to take a break.. or being a student? :) Unless you are writing a compiler/interpreter... in that case, I'd say homework..
 
Orwell
Gerbil
Posts: 51
Joined: Wed Apr 03, 2013 3:28 pm

Re: What's this phenomenon called?

Wed Apr 03, 2013 3:31 pm

Debugger time?

Not related to the thread title: I suggest explaining your code to someone else or a duck. Works much better than staring.
2600K @ 4400MHz/1.3V | MSI GTX780Ti | Asus Maximus GENE IV | Samsung 850 500GB | Dell U2713HM | Boston Acoustics A26
 
TheEmrys
Minister of Gerbil Affairs
Posts: 2529
Joined: Wed May 29, 2002 8:22 pm
Location: Northern Colorado
Contact:

Re: What's this phenomenon called?

Wed Apr 03, 2013 3:40 pm

Hubris? Somewhat tongue-in-cheek.
Sony a7II 55/1.8 Minolta 100/2, 17-35D, Tamron 28-75/2.8
 
Igor_Kavinski
Minister of Gerbil Affairs
Posts: 2077
Joined: Fri Dec 22, 2006 2:34 am

Re: What's this phenomenon called?

Wed Apr 03, 2013 3:48 pm

To the OP: Trust me, been through that soooo many times that now I don't really blame the compiler for my mistakes anymore :D I bet whatever's doing your head in is something so simple that you will kick yourself for overlooking it.
 
liquidsquid
Minister of Gerbil Affairs
Posts: 2661
Joined: Wed May 29, 2002 10:49 am
Location: New York
Contact:

Re: What's this phenomenon called?

Wed Apr 03, 2013 4:12 pm

In my field I will look at the assembly output. Sometimes the answer becomes obvious. There has been occasions where the compiler has messed up, but this is on smaller microcontrollers.
 
superjawes
Minister of Gerbil Affairs
Posts: 2475
Joined: Thu May 28, 2009 9:49 am

Re: What's this phenomenon called?

Wed Apr 03, 2013 4:20 pm

Not to one up you, buuuuuuut....

Write HDL code
Simulate code
Works fine in test
Synthesize to FPGA
Does not work
Re-simulate code
Works fine in test
Simulate individual blocks
Individual blocks work fine in test
Synthesize individual blocks
Blocks work on FPGA
Synthesize full code
Does not work on FPGA
Show instructor
Instructor cannot fix
Instructor still penlizes final score
Flip table

True story.

EDIT: okay, I didn't flip the table because it was bolted to the floor.
On second thought, let's not go to TechReport. It's infested by crypto bull****.
 
Aranarth
Graphmaster Gerbil
Posts: 1435
Joined: Tue Jan 17, 2006 6:56 am
Location: Big Rapids, Mich. (Est Time Zone)
Contact:

Re: What's this phenomenon called?

Wed Apr 03, 2013 6:19 pm

Uncertainty principle?
Main machine: Core I7 -2600K @ 4.0Ghz / 16 gig ram / Radeon RX 580 8gb / 500gb toshiba ssd / 5tb hd
Old machine: Core 2 quad Q6600 @ 3ghz / 8 gig ram / Radeon 7870 / 240 gb PNY ssd / 1tb HD
 
ChronoReverse
Gerbil Elite
Posts: 757
Joined: Wed Dec 12, 2007 4:20 pm

Re: What's this phenomenon called?

Wed Apr 03, 2013 6:22 pm

Time to let someone else take a look at the code? Sometimes the most obvious errors just can't be seen by the writer of the code.
 
mortifiedPenguin
Gerbil Elite
Posts: 812
Joined: Mon Oct 08, 2007 7:46 pm

Re: What's this phenomenon called?

Wed Apr 03, 2013 6:45 pm

ChronoReverse wrote:
Time to let someone else take a look at the code? Sometimes the most obvious errors just can't be seen by the writer of the code.
If you don't have somebody around to look at your code, I've found that rewriting that portion from scratch (and without referring to the original code) has been an effective method of fixing these issues.
2600K @ 4.8GHz; XSPC Rasa/RX240/RX120 Phobya Xtreme 200; Asus P8Z68-V Pro; 16GB Corsair Vengeance 1333 C9; 2x7970 OC w/ Razor 7970; Force GT 120GB; 3x F3 1TB; Corsair HX750; X-Fi Titanium; Corsair Obsidian 650D; Dell 2408WFP Rev. A01; 2x Dell U2412m
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: What's this phenomenon called?

Wed Apr 03, 2013 7:12 pm

ChronoReverse wrote:
Time to let someone else take a look at the code? Sometimes the most obvious errors just can't be seen by the writer of the code.

This. I've lost count of how many times I've been on both ends of:

Developer #1: "I've been trying to figure this bug out all day, think you could take a look?"

(30 second pause)

Developer #2: "Umm, WTF is this line here supposed to be doing? That doesn't look right."

Developer #1: "D'oh! Can't believe I missed that."

Your brain plays tricks on you. Sometimes you read what you *think* should be there, not what's *actually* there. And reading it over and over again just reinforces it.

This is also why the original developer of a piece of code should not be involved in the final verification testing of that code. You're unlikely to think of testing the corner cases you overlooked while writing the code; you didn't think of them the first time around, so you're probably not going to think of them when you test either.

Edit: If the code in question is reasonably self-contained and you don't mind posting it publicly I'm sure there are people here who would be willing to take a look (provided we're not doing your homework for you).

Edit 2: What language? If it is a compiled language try disabling compiler optimizations.
Nostalgia isn't what it used to be.
 
Ryhadar
Gerbil XP
Topic Author
Posts: 463
Joined: Tue Oct 21, 2008 9:51 pm

Re: What's this phenomenon called?

Wed Apr 03, 2013 7:37 pm

Good responses all. :D

I was actually the one helping someone at their wits end (for a change) and was wondering if there was a term for it.
 
SecretSquirrel
Minister of Gerbil Affairs
Posts: 2726
Joined: Tue Jan 01, 2002 7:00 pm
Location: North DFW suburb...
Contact:

Re: What's this phenomenon called?

Wed Apr 03, 2013 7:42 pm

Ryhadar wrote:
Good responses all. :D

I was actually the one helping someone at their wits end (for a change) and was wondering if there was a term for it.


Yep. It's called being a developer. :wink:

That said, I have actually run into occasions where the compiler was screwing things up during optimization, but it has always been for small microcontroller environments.

--SS
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: What's this phenomenon called?

Wed Apr 03, 2013 7:50 pm

SecretSquirrel wrote:
That said, I have actually run into occasions where the compiler was screwing things up during optimization, but it has always been for small microcontroller environments.

I've seen that a fair bit as well, but I've also seen gcc do it on x86 at -O2 and above, especially when the developer makes implicit assumptions about aliasing of values stored at the same memory location (e.g. doing a brute force pointer cast instead of using a union).
Nostalgia isn't what it used to be.
 
sid1089
Gerbil Team Leader
Posts: 290
Joined: Wed Jul 26, 2006 4:56 am

Re: What's this phenomenon called?

Wed Apr 03, 2013 7:55 pm

Every single time I have accused the compiler of being wrong, I have been wrong myself. So I don't even play that game anymore.
Carpe diem quam minimum credula postero
 
SecretSquirrel
Minister of Gerbil Affairs
Posts: 2726
Joined: Tue Jan 01, 2002 7:00 pm
Location: North DFW suburb...
Contact:

Re: What's this phenomenon called?

Wed Apr 03, 2013 7:56 pm

just brew it! wrote:
SecretSquirrel wrote:
That said, I have actually run into occasions where the compiler was screwing things up during optimization, but it has always been for small microcontroller environments.

I've seen that a fair bit as well, but I've also seen gcc do it on x86 at -O2 and above, especially when the developer makes implicit assumptions about aliasing of values stored at the same memory location (e.g. doing a brute force pointer cast instead of using a union).


The common factor being that the programmer is trying to make use of their knowledge of the hardware to write effecient code -- something you obviously have to do in a microcontroller. The times I've seen it on big platforms, I or someone else assumed that sizeof(void*)==sizeof(int).
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: What's this phenomenon called?

Wed Apr 03, 2013 8:05 pm

SecretSquirrel wrote:
The common factor being that the programmer is trying to make use of their knowledge of the hardware to write effecient code -- something you obviously have to do in a microcontroller. The times I've seen it on big platforms, I or someone else assumed that sizeof(void*)==sizeof(int).

The most recent one I've seen (on x86 gcc) was a developer assuming you could cast the address of an int as (float *) and use the resulting pointer to access the data at that address as a float. Works up to -O1, but breaks at -O2 and above. IIRC the culprit was the -fstrict-aliasing option (implied by -O2).
Nostalgia isn't what it used to be.
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: What's this phenomenon called?

Thu Apr 04, 2013 8:06 am

I've lost count of the number of times I've started explaining my block of non-working code to a colleague when the obvious bug has suddenly struck me. This is after I'd been staring at it for hours not seeing why it won't work.

I have found compiler bugs in the past, but they are very rare and it's always been possible to break the code down and come up with a really simple version of what is broken.

Always compile your code with -Wall -Werror, there's a reason for warnings. Others have been commenting on gcc and pointer aliasing, newer versions of gcc complain more about that than before.
 
Arvald
Gerbil Elite
Posts: 761
Joined: Tue Sep 27, 2011 12:14 pm
Location: Gerbil-land, Canada

Re: What's this phenomenon called?

Thu Apr 04, 2013 8:11 am

I work in an environment with 1 other developer on a regular basis. We call each over to look at stuff when it is not working. The peer review 90% of the time we figure out our own mistakes and the other has no clue what they were looking at. There is a shift in your thinking when you are reviewing it with someone else.

The other 10% their different viewpoint finds issues with something your brain has glossed over.

That said I have had some pretty wonky compiler issues over the last 20 years. a bug search can help if you are 100% sure that it is not your code.
 
Waco
Maximum Gerbil
Posts: 4850
Joined: Tue Jan 20, 2009 4:14 pm
Location: Los Alamos, NM

Re: What's this phenomenon called?

Thu Apr 04, 2013 8:46 am

Arvald wrote:
I work in an environment with 1 other developer on a regular basis. We call each over to look at stuff when it is not working. The peer review 90% of the time we figure out our own mistakes and the other has no clue what they were looking at. There is a shift in your thinking when you are reviewing it with someone else.

The other 10% their different viewpoint finds issues with something your brain has glossed over.

That said I have had some pretty wonky compiler issues over the last 20 years. a bug search can help if you are 100% sure that it is not your code.

This.

Every time I find something difficult I end up calling someone over just in time to realize exactly what I did wrong and how obvious it should have been. :lol:
Victory requires no explanation. Defeat allows none.
 
SuperSpy
Minister of Gerbil Affairs
Posts: 2403
Joined: Thu Sep 12, 2002 9:34 pm
Location: TR Forums

Re: What's this phenomenon called?

Thu Apr 04, 2013 10:57 am

Yeah I can't count how many times I've brought over a sample of code I've been slamming my head on the desk for hours over just to have the other dude in 30 seconds go 'uh why are you doing this part here? *points*'

"..."
"crap."
Desktop: i7-4790K @4.8 GHz | 32 GB | EVGA Gefore 1060 | Windows 10 x64
Laptop: MacBook Pro 2017 2.9GHz | 16 GB | Radeon Pro 560
 
druidcent
Minister of Gerbil Affairs
Posts: 2510
Joined: Wed Aug 07, 2002 7:55 pm
Location: Earth, Sol, Milky Way
Contact:

Re: What's this phenomenon called?

Thu Apr 04, 2013 1:01 pm

Best interview question I had...

The position was for a Project Manager role, and the interviewer was an engineer setting up a scenario about a problem the engineering team had..

He gave me some code and said this isn't working, and the team is stuck what should we do. I looked at it for about 20 sec, told them they had array indexing issues, and to fix that and get back to work :) Of course that led to some new issues, and we went back and forth on the problem for about 20 min, with the new issues getting harder for me to resolve.. Best line was when the interviewer said "Now that the engineers were thoroughly embarrassed by the project manager debugging their code in 30 sec..."

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On