Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Subjunctive
Sep 12, 2006

✨sparkle and shine✨

ExcessBLarg! posted:

It's quite common for large projects to be partitioned into modules that have different maintainers. You generally have commit access to the modules you maintain, but if you need to make changes elsewhere you'll have to submit those changes to a maintainer for review.

Code review by primary developer isn't the same thing as requiring that the primary developer commit. (It can be close if you use pull requests, but doesn't have to be.)

Adbot
ADBOT LOVES YOU

Chin Strap
Nov 24, 2002

I failed my TFLC Toxx, but I no longer need a double chin strap :buddy:
Pillbug

Nitrocat posted:

not necessarily a "horror", but very accurate and incredibly, painfully true.

welcome to the arnoldJS, where all of your fears have come true: https://github.com/analytalica/ArnoldJS

Best line:

code:
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE : .

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

(Restricted commit also conflicts with a very important rule of keeping multi-developer projects on the rails: "the correct response to a failing test is immediate remorseless back-out, and anyone can/should do so".)

Mr Shiny Pants
Nov 12, 2012

Weird, up to a couple of weeks ago I'd never heard of Cache until I visited a friend who also works in healthcare. And now I come across it on SA forums.

Weird how that works.....

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Mr Shiny Pants posted:

Weird, up to a couple of weeks ago I'd never heard of Cache until I visited a friend who also works in healthcare. And now I come across it on SA forums.

Weird how that works.....

Lots of the big health care IT companies have been around forever, and since MUMPS was initially created by a hospital for use in medical databases, lots of us have been on some flavor of MUMPS forever. Caché happens to be the most powerful and well-supported implementation of MUMPS so lots of us use it these days.

lord of the files
Sep 4, 2012

programming 101 protip.

print this and post it everywhere, live it, breathe it, cry over it.

Only registered members can see post attachments!

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

"It doesn't happen on your dev server? Great, we'll send a billion users to your dev server then."

No Safe Word
Feb 26, 2005

Subjunctive posted:

"It doesn't happen on your dev server? Great, we'll send a billion users to your dev server then."

I've had no fewer than 3 bosses tell that same story with minor variations.

"What's that? Works on your laptop? Well, pack it up and ship it to the customer then!"

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

No Safe Word posted:

I've had no fewer than 3 bosses tell that same story with minor variations.

"What's that? Works on your laptop? Well, pack it up and ship it to the customer then!"

er, that seems extremely hostile. I have some bugs that I really, really want to fix but literally cannot reproduce no matter how many times a user tells me. It's not that I don't believe them, it's just that I can't track it down until I have more info.

No Safe Word
Feb 26, 2005

Yeah to be clear it wasn't in response to me directly. It was always anecdotal and usually not passive-aggressively directed at failed debugging efforts, but more of a tongue-in-cheek thing said when someone was struggling to reproduce something.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

You don't necessarily need to reproduce a bug to fix it. The endgame of the JIT project I worked on was identifying and fixing bugs (often timing-sensitive) based on metadata in crash reports. Even without the ability to find the root cause, you can often find a mitigation that's cheap/solid enough to ship.

The vast majority of browser crashes don't have repro for the developer, I expect. You do need good error reporting though.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Subjunctive posted:

You don't necessarily need to reproduce a bug to fix it. The endgame of the JIT project I worked on was identifying and fixing bugs (often timing-sensitive) based on metadata in crash reports. Even without the ability to find the root cause, you can often find a mitigation that's cheap/solid enough to ship.

The vast majority of browser crashes don't have repro for the developer, I expect. You do need good error reporting though.

This is the area of software development that's still somewhat sorcery to me. I'm just starting to get comfortable kind muddling my way through .net stack traces and such to debug, but I'm still pretty lost without the ability to step through code most of the time. People who can actually design robust and usable error reporting systems are like wizards to me.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Subjunctive posted:

You don't necessarily need to reproduce a bug to fix it. The endgame of the JIT project I worked on was identifying and fixing bugs (often timing-sensitive) based on metadata in crash reports. Even without the ability to find the root cause, you can often find a mitigation that's cheap/solid enough to ship.

The vast majority of browser crashes don't have repro for the developer, I expect. You do need good error reporting though.

I'd be happy if most of my bug reports had stack traces attached. Error reporting is hard when your core product is, by design, not always online.

omeg
Sep 3, 2012

I'm now trying to find the cause of a bug that only manifests when two drivers are active at once (one is mine). And the symptoms are random memory corruptions with stack traces like below that don't contain any of the two drivers' code:

code:
nt!DbgBreakPointWithStatus
nt!KiBugCheckDebugBreak+0x12
nt!KeBugCheck2+0x71e
nt!KeBugCheckEx+0x104
nt!KiBugCheckDispatch+0x69
nt!KiPageFault+0x260
nt!IoGetRelatedDeviceObject
netbt!TdiSendDatagram+0x38
netbt!UdpSendDatagram+0x1b1
netbt!SendNameServiceRequest+0x38b
netbt!MSnodeCompletion+0x2b0
netbt!TimerExpiry+0x5b
nt!KiProcessTimerDpcTable+0x6c
nt!KiProcessExpiredTimerList+0xc6
nt!KiTimerExpiration+0x1be
nt!KiRetireDpcList+0x277
nt!KiIdleLoop+0x5a
Driver verifier doesn't catch anything. At least I know something is loving up DPC lists so that's a start.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Suspicious Dish posted:

I'd be happy if most of my bug reports had stack traces attached. Error reporting is hard when your core product is, by design, not always online.

Oh, there are ways around that, if you're sufficiently... creative.



"Sir, your exception."

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

NihilCredo posted:

Oh, there are ways around that, if you're sufficiently... creative.



"Sir, your exception."

Heh.


I noticed some links disappeared when I was checking my credit card account online. I decided to see what they were. (Truncated version)
code:
<!-- Fix for DTSYS00146990 - CDIWoudLikeToTable class is replaced with CDMessageBorder class -->
<div id="IWouldLikeToID" class="CDMessageBorder rounded">
    <div id="IWldMTransfer" style="/* display: none; */">
        <a class="CDIWouldLikeToLink" onclick="nav_ToTransferMoney()" style="text-decoration: none">
            Transfer Money</a><br>
    </div>
    <div id="IWldMSendToPerson" style="/* display: none; */">
        <a class="CDIWouldLikeToLink" onclick="nav_GoToPaymentsSendMoney()" style="text-decoration: none">
            Send Money to a Person</a><br>
    </div>
    <!--DTSYS00142100  PCR 120 Removed  -"Deposit a Check Online" div as per this defect(DTSYS00142100) -->
     
     
     <!-- End May 2015 - PRJ16002 CreditScore Link on CustomerDashboard for all customers -->
    
     <!-- PCR 120 - below div added for Test & Target space -->
                <div id="TNT_Id_Like_To">
                </div>
</div>
I find it a little strange that they're leaving these comments in production code. I decided to look around more.

Couple more tidbits I found:
code:
<input type="hidden" id="CMSContentHSAToolboxText" value="ERROR: CMS STRING NOT FOUND">
    <input type="hidden" id="CMSContentPFMChartNoDataMessage" value="ERROR: CMS STRING NOT FOUND">
    <input type="hidden" id="CMSContentACAAccessDenied" value="<p>It looks like you’ve disabled access to this feature via Advanced Security. 
To restore access, please change your Advanced Security settings.</p>
:ohdear:

JavaScript code:
//PCR 458 - Publish Omniture tag for the pages visited with persistent message - Start
function PublishOmnitureTagForUnsupportedBrowser() {
    if (document.getElementById("message_box") !== null) {
        var browserNameVersion = "AppleWebKit 537";
        //DTSYS00158415 - Production Defect Fix - commented the below line to remove the second image request on every page where using an unsupported browser               
    }
}
//PCR 458 - Publish Omniture tag for the pages visited with persistent message - End
I don't believe this does anything at all...

JavaScript code:
/***********************************
** DO NOT CHANGE THIS CODE - V1.0 -
** Campaign Name: PRJ 17019 OLB CD RL for New Cons Chkg Cust(Live Prod 09/09/2015)
** Recipe Name: D_Msg4
** Campaign ID: 70123
** Recipe ID: 23
** Mbox PCID: 1438961997994-337097.28_21
** 17019_DaysCalculation_Prod:
** Split_FiveGroups_of_traffic:D
************************************
*/
</script>
<div id="clicktrack" style="display:none"></div>
<style>
	#TnT_learnMore a:hover {
		background-color:#0c2074 !important;
	}
</style>

<script type="text/javascript">

	/* var prj17019 = function (){
		var _loggingOn = false;
		return {
			log: function(message) {
				if (_loggingOn) {
					console.log(message);
				}
			}
		}
	}
	var prj17019Obj = prj17019(); */
DONT CHANGE THIS CODE - has first block of code commented out.

code:
        } else {
	// recipe A1, B1, B2
	//console.log('processBuscCookie: recipe A1, B1, or B2, buscCookieValue is ' + buscCookieValue); 
		if ((buscCookieValue.indexOf('1|0') != -1 || buscCookieValue.indexOf('0|0') != -1)) {
			//console.log('processBuscCookie: buscCookieValue was 1|0 or 0|0, so will start tour if tour == empty string'); 
			
			if (tour == '') {
				//console.log('processBuscCookie: tour was empty string so about to make mBox and start tour'); 
				makeTourWelcomeMBox();
				startTour();
			} else {
				//console.log('processBuscCookie: tour was not empty string, so about to create take tour link');		
				taketourlink();
			}
	} else { 
There's lots more small stuff like this. Found it kind of funny. I'm not sure why they're not using source control for most of this/how this stuff got into production.

Knyteguy fucked around with this message at 23:22 on Sep 29, 2015

Space Kablooey
May 6, 2009


I think the biggest horror is that people were being confused by the arcane term "Transfer money".

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

HardDisk posted:

I think the biggest horror is that people were being confused by the arcane term "Transfer money".

What makes you say that?

FoiledAgain
May 6, 2007

edit: I just realized that this was posted in the wrong thread...

FoiledAgain fucked around with this message at 16:27 on Oct 1, 2015

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

No Safe Word posted:

I've had no fewer than 3 bosses tell that same story with minor variations.

"What's that? Works on your laptop? Well, pack it up and ship it to the customer then!"

That's douche-y.

The correct response is to canary your change and make you watch as 100k requests fail.

Space Kablooey
May 6, 2009


Dessert Rose posted:

What makes you say that?

Because I misread it. :downs: I noticed that the div with the transfer money had display:none set, but I didn't see that it was commented out.

loinburger
Jul 10, 2004
Sweet Sauce Jones
loin: Why did you delete all of the "volatile" keywords in that file? [Java]
co-worker: I didn't know what they meant
loin: :(

omeg
Sep 3, 2012

loinburger posted:

loin: Why did you delete all of the "volatile" keywords in that file? [Java]
co-worker: I didn't know what they meant
loin: :(

What exactly does volatile do in Java? Was it some interop with native code?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

omeg posted:

What exactly does volatile do in Java? Was it some interop with native code?

It gives you a stricter memory model to play with, which in turn makes it possible to write correct multithreaded code with fewer explicit locks. Remove the "volatile" bits, and your formerly-safe code is now full of race conditions.

Using it outside of a handful of well-known patterns is very probably wrong, though.

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?

omeg posted:

What exactly does volatile do in Java? Was it some interop with native code?

When you write something to a variable the new value will only be in the registers and cache of the core running the thread. Using volatile makes sure it is consistent across threads.
You could also explicitly lock and unlock the variable before reading from or writing to it.

On a plain old x86 architecture it is not necessary because the CPU doesn't make the kind of cache optimizations that volatile negates.

omeg
Sep 3, 2012

Jarl posted:

When you write something to a variable the new value will only be in the registers and cache of the core running the thread. Using volatile makes sure it is consistent across threads.
You could also explicitly lock and unlock the variable before reading from or writing to it.

On a plain old x86 architecture it is not necessary because the CPU doesn't make the kind of cache optimizations that volatile negates.

Yeah, I know what it does in C/C++, just didn't think it was needed in a managed language like Java.

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?

omeg posted:

Yeah, I know what it does in C/C++, just didn't think it was needed in a managed language like Java.

This does not have anything to do with whether a language is managed or not.

Edit:
Well, it could be. But I think it would be a bad idea.

Jarl fucked around with this message at 14:54 on Oct 2, 2015

1337JiveTurkey
Feb 17, 2005

omeg posted:

Yeah, I know what it does in C/C++, just didn't think it was needed in a managed language like Java.

It's the same underlying concept but for a different purpose. In C/C++, volatile is used for memory mapped IO like writing to hardware registers. However it is not usable for multithreading because it doesn't guarantee that the operations are atomic and it's not a memory barrier. In other words it can rearrange operations so that a write to another variable goes afterward. In pseudocode one thread could do:

code:
foo = 123
volatile bar = 456
And another thread could do:

code:
baz = bar
quux = foo
And it is perfectly valid for quux to be 0 or some other value even if baz is 456 as expected. It can rearrange the writes in whatever order it wants as well as the reads. Managed languages like Java don't read or write hardware registers but do guarantee that reads and writes to volatiles are atomic and act as a memory barrier with respect to other threads reading and writing the same variable.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Jarl posted:

On a plain old x86 architecture it is not necessary because the CPU doesn't make the kind of cache optimizations that volatile negates.

It is absolutely still necessary to use volatile on x86 in Java; the JVM is otherwise free to change the order in which it performs memory accesses, as well as to use instructions (like non-temporal stores) with weaker memory ordering rules than the default. If anything, the strength of x86's memory ordering makes not using volatile properly worse, because it is both much cheaper to use liberally and much more likely to allow a race condition bug to escape into production because it doesn't show up until the nth-tier JIT reorders a couple of stores.

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?

rjmccall posted:

It is absolutely still necessary to use volatile on x86 in Java; the JVM is otherwise free to change the order in which it performs memory accesses, as well as to use instructions (like non-temporal stores) with weaker memory ordering rules than the default. If anything, the strength of x86's memory ordering makes not using volatile properly worse, because it is both much cheaper to use liberally and much more likely to allow a race condition bug to escape into production because it doesn't show up until the nth-tier JIT reorders a couple of stores.

Of course, makes sense JVM would exploit it - as it should.

loinburger
Jul 10, 2004
Sweet Sauce Jones
The "volatile" stuff was a bandage for a database cache that I'm probably going to just wind up getting rid of. It used to consist of about a half dozen of these
code:
private List<Foo> foo;

public void invalidateFoo() {
    foo = null;
}

public List<Foo> getFoo() {
    if(foo == null) {
        foo = // retrieve foo from database
    }
    return foo;
}
which I replaced with
code:
private volatile ImmutableList<Foo> foo;

public void invalidateFoo() {...}

public ImmutableList<Foo> getFoo() {
    ImmutableList<Foo> temp = foo;
    if(temp == null) {
        temp = // retrieve foo from database
        foo = temp;
    }
    return temp;
}
I haven't done any performance testing yet, but I doubt that the cache is doing any good: we're frequently invalidating it, the query isn't very expensive, and I suspect that the database is already caching the query results for us.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
If your problem was that multiple threads are touching the cache concurrently and it was stuffing up, just making it volatile doesn't necessarily solve your problem...

For example, you still have a race that ends up with the cache "stuck" holding on to an old value.

loinburger
Jul 10, 2004
Sweet Sauce Jones
I hadn't considered that, but it's a lovely bandaid for a lovely cache; for example, "Foo" is mutable so somebody could still gently caress with my "ImmutableList<Foo>". The best solution is to just get rid of the stupid thing, but I've got to do some performance testing first to justify deleting somebody else's code.

Soricidus
Oct 21, 2010
freedom-hating statist shill
Deleting other people's code is never wrong.

loinburger
Jul 10, 2004
Sweet Sauce Jones
It's likely that nobody will notice or care, but if they do I'd rather say "I deleted the cache because it wasn't performant" or whatever as opposed to "I deleted the cache because it had a race condition and I'm too lazy to fix it"

Though realistically, "not performant" in this case means something like "didn't give at least a 3x performance boost," because it's not worth maintaining this code for anything less than that

loinburger fucked around with this message at 16:44 on Oct 3, 2015

Soricidus
Oct 21, 2010
freedom-hating statist shill
Just tell them you measured it, it's not like anyone's going to check

loinburger
Jul 10, 2004
Sweet Sauce Jones
Good point

Kazinsal
Dec 13, 2011


What happens when someone writes an IRC bot in COBOL and then passes "output intermediate C only" to see what it generates before passing the intermediate to GCC?

https://gist.github.com/heddwch/8dbd1d5bf0af21f643b3

This nightmare.

pseudorandom name
May 6, 2007

That's actually extremely readable for a C-as-IR.

IIRC, there was a Haskell or similar that generated C, compiled the C to assembly, and then textually transformed the assembly source before assembling it into the final object.

Adbot
ADBOT LOVES YOU

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

pseudorandom name posted:

That's actually extremely readable for a C-as-IR.

IIRC, there was a Haskell or similar that generated C, compiled the C to assembly, and then textually transformed the assembly source before assembling it into the final object.

GHC did this in the past. It involved a Perl script called the "evil munger" or something like that.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply