News: 1602585827

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

We won't leave you hanging any longer: Tool strips freeze-inducing bugs from Java bytecode while in production

(2020/10/13)


Boffins from North Carolina State University and IBM Research have devised a software framework that can automatically repair a majority of the common code patterns that cause Java programs to hang.

In a paper to be presented next week at the virtual Symposium on Cloud Computing ( [1]SoCC ’20 ), computer scientists Jingzhu He, Xiaohui Gu, and Guoliang Jin from NC State, and Ting Dai from IBM Research will outline HangFix, software that can patch [2]Java bytecode in production cloud environments to eliminate freeze-inducing failures. The paper cites The Register , among many others, as a source.

Hang bugs are code errors that lead systems to become unresponsive. Whereas crash bugs can be dangerous because they may be exploitable, hang bugs tend to be merely frustrating, causing outages through infinite loops or just slowing things down for a while.

The authors of the paper, titled "HangFix: Automatically Fixing Software Hang Bugs for Production Cloud Systems," point out that hang bugs tend to be difficult to find because they don't usually produce much diagnostic information. They're also difficult to catch in code tests because they're often the result of unanticipated runtime data corruption or inter-process communication failures that show up in production.

Oracle's Java 15 rides into town, waving the 'we're number one' flag, demands 25th birthday party [3]READ MORE

They're also potentially expensive. A [4]British Airways service outage in 2017 that cost the company an estimated £80m (~$104m) followed from a hang bug that arose after data got corrupted due to a data center failover, the paper says. Similarly, the [5]five-hour failure of Amazon DynamoDB in 2015, which affected customers like Netflix, Airbnb, and IMDb, is attributed to a hang bug, the result of bad error handling that overloaded a metadata server with too many requests.

"We have implemented a prototype of HangFix and evaluated our system using 42 reproduced real-world software hang bugs in 10 commonly used cloud server systems (e.g., Cassandra, HDFS, Mapreduce, HBase)," the paper says. "HangFix successfully fixes 40 of them in seconds, many of which take days for the developers to manually fix them."

The remaining two bugs had to be fixed with the help of human programmers.

HangFix can recognize 76 per cent of the 237 hang bug types that have been identified so far, it's claimed. Among the bugs it can flag, the system can prevent programs from hanging in all cases and can completely repair the root cause 75 per cent of the time.

"The remaining hang bugs are mostly concurrency and synchronization bugs, which can be solved by other concurrency bug detection tools,' said NC State computer science professor Xiaohui (Helen) Gu told The Register .

HangFix targets four code patterns likely to cause hang bugs: unexpected function return values in loops; misconfigured parameters in loops; improper exception handling in loops; and blocking operations without loops.

Gu said the plan is to release HangFix, developed with US National Science Foundation grants, on GitHub as an open source tool. She is also the founder and CTO of devops biz InsightFinder and her company is working to integrate the software into its own tools.

While HangFix was designed for Java applications, it should be possible to adapt it to other programming languages.

"The technology is not unique to Java," said Gu. "We can apply the same technique to any language if we can plug our analysis into some static binary code analysis tools." ®

Get our [6]Tech Resources



[1] https://acmsocc.github.io/2020/accepted-papers.html

[2] https://en.wikipedia.org/w/index.php?title=Java_bytecode&oldid=975162269

[3] https://www.theregister.com/2020/09/15/java_15_rides_into_town/

[4] https://www.theregister.com/2017/06/15/bas_it_systems_meltdown_to_cost_airline_80m/

[5] https://www.theregister.com/2015/09/20/aws_database_outage/

[6] https://whitepapers.theregister.com/

What has happened to deterministic behavior?

EricM

In which type of "production" system is it desireable to have a program carrying on after some kind of corruption/hang was fixed based on statistical data?

A hanging program at least stops making stupid things. A statistically "fixed" program may do basically anything ,,,

This cure might be worse than the desease.

Call me old-fashioned, but I prefer my programs to behave deterministically.

If that means failing at a certain event, so be it ...

Re: What has happened to deterministic behavior?

Richard Boyce

Agreed. The people operating the system may only be concerned with outward appearances, content with the automated papering over of the cracks. The quantity of data corruption that could accumulate over years could do serious damage to a business. Backups won't help.

RachelG

Does it produce any kind of useful report that the developers of a targeted app could actually use to fix the bug in source? I mean, you'd think that would be obvious, but it doesn't say so...

Dehn Loder

Even if a report of 'fixed hangs' is produced, will they ever be fixed in source?

"Ah, HangFix is addressing that nicely, it can wait until the next sprint."

fidodogbreath

...have devised a software framework that can automatically repair a majority of the common code patterns that cause Java programs to hang...

Great news! Dev teams can now be even more agile since they no longer need to waste time on QA!

IDE's

Chris Gray 1

What they should now spend a bunch of effort on is putting their detection technology into as many IDE's as possible. That way, the possible problems are reported to developers, who can then implement a *proper* fix. Heck, I expect you can put it into compilers. Add it to "javac", "gcc", "lcc", etc. as a warning.

Warning: in some situations, loop will never exit.

It's the drinking water

vtcodger

These folks think arbitrarily altering code without checking with the code's creators is a nifty idea.

It's clearly the drinking water .. I tell you, it has to be something in their drinking water.

Do not count your chickens before they are hatched.
-- Aesop