Computer

HHS Announces New Study of Cellphone Radiation and Health

Slashdot - 3 hours 22 min ago
An anonymous reader quotes a report from U.S. News & World Report: U.S. health officials plan a new study investigating whether radiation from cellphones may affect human health. A spokesperson for the U.S. Department of Health and Human Services (HHS) said the research will examine electromagnetic radiation and possible gaps in current science. The initiative stems from numerous concerns raised by Health Secretary Robert F. Kennedy Jr., who has linked cellphone use to neurological damage and cancer. "The [U.S. Food and Drug Administration] removed webpages with old conclusions about cell phone radiation while HHS undertakes a study on electromagnetic radiation and health research to identify gaps in knowledge, including on new technologies, to ensure safety and efficacy," HHS spokesman Andrew Nixon said. He added that the study was directed in a strategy report from the president's Make America Healthy Again Commission. Some webpages from the FDA and the U.S. Centers for Disease Control and Prevention say current research does not show clear harm from cellphone radiation. The National Cancer Institute, which is part of the National Institutes of Health, says that "evidence to date suggests that cellphone use does not cause brain or other kinds of cancer in humans.".

Read more of this story at Slashdot.

Categories: Computer, News

UK Mulls Australia-Like Social Media Ban For Users Under 16

Slashdot - 4 hours 4 min ago
The UK government has launched a public consultation on whether to ban social media use for children under 16, drawing inspiration from Australia's recently enacted age-based restrictions. "It would also explore how to enforce that limit, how to limit tech companies from being able to access children's data and how to limit 'infinite scrolling,' as well as access to addictive online tools," reports Engadget. "In addition to seeking feedback from parents and young people themselves, the country's ministers are going to visit Australia to see the effects of the country's social media ban for kids, according to Financial Times."

Read more of this story at Slashdot.

Categories: Computer, News

Majority of CEOs Report Zero Payoff From AI Splurge

Slashdot - Tue, 2026-01-20 23:40
A PwC survey of more than 4,500 CEOs found that over half report no revenue growth or cost savings from their AI investments so far, despite massive spending. Of the 4,454 business leaders surveyed, only 12% saw both lower costs and higher revenue, while 56% saw neither benefit. "26% saw reduced costs, but nearly as many experienced cost increases," adds The Register. From the report: AI adoption remains limited. Even in top use cases like demand generation (22 percent), support services (20 percent), and product development (19 percent), only a minority are deploying AI extensively. Last year, a separate PwC study found that only 14 percent of workers indicated they were using generative AI daily in their work. Despite the CEOs' repsonses, PwC concludes more investment is required. It claims that "isolated, tactical AI projects" often don't deliver measurable value, and that tangible returns instead come from enterprise-wide deployments consistent with business strategy. [...] In terms of the broader picture, PwC says it found CEO confidence has hit a five-year low, with only 30 percent optimistic about revenue growth (down from 38 percent last year). This points to growing geopolitical risk and intensifying cyber threats, as well as uncertainty over the benefits and downsides of AI. Unsurprisingly, concern remains over tariffs as the Trump administration continues its erratic approach to policy, with almost a third of company chiefs saying tariffs are expected to reduce their company's profit margin in the year ahead. In the U.S., 22 percent indicate their corporation is highly or extremely exposed to tariffs. PwC warns that companies avoiding major investments due to geopolitical uncertainty underperform peers by two percentage points in growth and three points in profit margins.

Read more of this story at Slashdot.

Categories: Computer, News

Meta's Oversight Board Takes Up Permanent Bans In Landmark Case

Slashdot - Tue, 2026-01-20 23:02
An anonymous reader quotes a report from TechCrunch: Meta's Oversight Board is tackling a case focused on Meta's ability to permanently disable user accounts. Permanent bans are a drastic action, locking people out of their profiles, memories, friend connections, and, in the case of creators and businesses, their ability to market and communicate with fans and customers. This is the first time in the organization's five-year history as an oversight body that permanent account bans have been a subject of the Oversight Board's focus, the organization notes. The case being reviewed isn't exactly one of an everyday user. Instead, the case involves a high-profile Instagram user who repeatedly violated Meta's Community Standards by posting visual threats of violence against a female journalist, anti-gay slurs against politicians, content depicting a sex act, allegations of misconduct against minorities, and more. The account had not accumulated enough strikes to be automatically disabled, but Meta made the decision to permanently ban the account. The Board's materials didn't name the account in question, but its recommendations could impact others who post content that targets public figures with abuse, harassment, and threats, as well as users who have their accounts permanently banned without receiving transparent explanations. Meta referred this specific case to the Board, which included five posts made in the year before the account was permanently disabled. The Board says it's looking for input about several key issues: how permanent bans can be processed fairly, the effectiveness of its current tools to protect public figures and journalists from repeated abuse and threats of violence, the challenges of identifying off-platform content, whether punitive measures effectively shape online behaviors, and best practices for transparent reporting on account enforcement decisions. [...] Whether the Oversight Board has any real sway to address issues on Meta's platform continues to be debated, of course. [...] After the Oversight Board issues its policy recommendations to Meta, the company has 60 days to respond. The Board is also soliciting public comments on this topic. The report notes that Meta's Oversight Board is able to overturn individual moderation decisions and offer recommendations, but largely sidelined from major policy shifts driven by Mark Zuckerberg.

Read more of this story at Slashdot.

Categories: Computer, News

56% of Companies Have Seen Zero Financial Return From AI Investments, PwC Survey Says

Slashdot - Tue, 2026-01-20 22:22
More than half of companies haven't seen any financial benefit from their AI investments, according to PwC's latest Global CEO Survey [PDF], and yet the spending shows no signs of slowing down. Some 56% of the 4,454 chief executives surveyed across 95 countries said their companies have realized neither higher revenues nor lower costs from AI over the past year. Only 12% reported getting both benefits -- and those rare winners tend to be the ones who built proper enterprise-wide foundations rather than chasing one-off projects. CEO confidence in near-term growth has taken a notable hit. Just 30% feel strongly optimistic about revenue growth over the next 12 months, down from 38% last year and nowhere near the 56% who felt that way in 2022.

Read more of this story at Slashdot.

Categories: Computer, News

Setapp Mobile To Close in February as Alternative iOS App Store Economics Prove Untenable

Slashdot - Tue, 2026-01-20 21:45
MacPaw, the Ukraine-based developer, has announced that Setapp Mobile -- its alternative iOS app store for European Union users that launched in open beta in September 2024 -- will shut down on February 16, 2026, citing "still-evolving and complex business terms" for alternative marketplaces that don't fit its current business model. Alternative iOS stores became possible under the Digital Markets Act but face challenges including Apple's controversial Core Technology Fee, which Epic Games CEO Tim Sweeney has called "ruinous for any hopes of a competing store getting a foothold."

Read more of this story at Slashdot.

Categories: Computer, News

Anthropic CEO Says Government Should Help Ensure AI's Economic Upside Is Shared

Slashdot - Tue, 2026-01-20 21:02
An anonymous reader shares a report: Anthropic Chief Executive Dario Amodei predicted a future in which AI will spur significant economic growth -- but could lead to widespread unemployment and inequality. Amodei is both "excited and worried" about the impact of AI, he said in an interview at Davos Tuesday. "I don't think there's an awareness at all of what is coming here and the magnitude of it." Anthropic is the developer of the popular chatbot Claude. Amodei said the government will need to play a role in navigating the massive displacement in jobs that could result from advances in AI. He said there could be a future with 5% to 10% GDP growth and 10% unemployment. "That's not a combination we've almost ever seen before," he said. "There's gonna need to be some role for government in the displacement that's this macroeconomically large." Amodei painted a potential "nightmare" scenario that AI could bring to society if not properly checked, laying out a future in which 10 million people -- 7 million in Silicon Valley and the rest scattered elsewhere -- could "decouple" from the rest of society, enjoying as much as 50% GPD growth while others were left behind. "I think this is probably a time to worry less about disincentivizing growth and worry more about making sure that everyone gets a part of that growth," Amodei said. He noted that was "the opposite of the prevailing sentiment now," but the reality of technological change will force those ideas to change.

Read more of this story at Slashdot.

Categories: Computer, News

AI Agents 'Perilous' for Secure Apps Such as Signal, Whittaker Says

Slashdot - Tue, 2026-01-20 20:22
Signal Foundation president Meredith Whittaker warned that AI agents that autonomously carry out tasks pose a threat to encrypted messaging apps [non-paywalled source] because they require broad access to data stored across a device and can be hijacked if given root permissions. Speaking at Davos on Tuesday, Whittaker said the deeper integration of AI agents into devices is "pretty perilous" for services like Signal. For an AI agent to act effectively on behalf of a user, it would need unilateral access to apps storing sensitive information such as credit card data and contacts, Whittaker said. The data that the agent stores in its context window is at greater risk of being compromised. Whittaker called this "breaking the blood-brain barrier between the application and the operating system." "Our encryption no longer matters if all you have to do is hijack this context window," she said.

Read more of this story at Slashdot.

Categories: Computer, News

Palantir CEO Says AI To Make Large-Scale Immigration Obsolete

Slashdot - Tue, 2026-01-20 19:35
AI will displace so many jobs that it will eliminate the need for mass immigration, according to Palantir CEO Alex Karp. Bloomberg: "There will be more than enough jobs for the citizens of your nation, especially those with vocational training," said Karp, speaking at a World Economic Forum panel in Davos, Switzerland on Tuesday. "I do think these trends really do make it hard to imagine why we should have large-scale immigration unless you have a very specialized skill." Karp, who holds a PhD in philosophy, used himself as an example of the type of "elite" white-collar worker most at risk of disruption. Vocational workers will be more valuable "if not irreplaceable," he said, criticizing the idea that higher education is the ultimate benchmark of a person's talents and employability.

Read more of this story at Slashdot.

Categories: Computer, News

Crypto News Outlet Cointelegraph Loses 80% of Traffic After Google Penalty For Parasitic Blackhat SEO Deal

Slashdot - Tue, 2026-01-20 19:02
Cointelegraph, once one of the most-visited cryptocurrency news sites, has seen its monthly traffic plummet from roughly 8 million visits to 1.4 million -- an 80% drop in three months -- after Google issued a manual penalty in October 2025 for the outlet's partnership with a blackhat SEO firm that used Cointelegraph's domain authority to promote affiliate links to offshore casinos and betting platforms. The CEO, who had no prior media experience, proceeded despite warnings from Google earlier in 2025 and repeated objections from the outlet's three most senior editorial staff members throughout the year. The penalty removed Cointelegraph from Google News, Discover and search results entirely; a search for "Cointelegraph" now returns CoinDesk as the top result. Jon Rice, the former editor-in-chief, resigned on December 31st and described the situation as an "existential threat to business."

Read more of this story at Slashdot.

Categories: Computer, News

He Went To Prison for Gene-Editing Babies. Now He's Planning To Do It Again

Slashdot - Tue, 2026-01-20 18:21
He Jiankui, the Chinese scientist who served three years in prison after creating the world's first gene-edited babies in 2018, is now preparing for another attempt at germline editing -- this time to prevent Alzheimer's disease. In an interview, He said he has established an independent lab in south Beijing and raised $7 million from private donors to fund research into introducing a protective genetic mutation found in Icelandic populations. The three girls born from his original experiment are now in primary school and healthy, according to He. Since germline editing remains banned in China, He said he plans to conduct future human trials in South Africa and has already spoken with contacts there. He estimates he needs two more years to complete mouse and monkey studies before seeking regulatory approval abroad. He said his lab is developing techniques to make 12 simultaneous genetic edits in a single embryo, targeting genes associated with cancer, cardiovascular disease, HIV, and other conditions. He is currently working on human cell lines and has not yet begun embryo experiments.

Read more of this story at Slashdot.

Categories: Computer, News

Europe Must Invest in Open Source AI or Cede To China, Schmidt Says

Slashdot - Tue, 2026-01-20 17:44
An anonymous reader shares a report: Europe must invest in its own open source artificial intelligence labs and address soaring energy prices, or it will quickly find itself dependent on Chinese models, former Google chief executive and tech investor Eric Schmidt said. "In the US, the companies are largely moving to closed source, which means they'll be purchased and licensed and so forth. And it is also the case that China is largely open weight, open source in its approach," Schmidt said at the World Economic Forum in Davos, Switzerland, on Tuesday. "Unless Europe is willing to spend lots of money for European models, Europe will end up using the Chinese models. It's probably not a good outcome for Europe."

Read more of this story at Slashdot.

Categories: Computer, News

Ukraine To Share Wartime Combat Data With Allies To Help Train AI

Slashdot - Tue, 2026-01-20 17:05
An anonymous reader shares a report: Ukraine will establish a system allowing its allies to train their AI models on Kyiv's valuable combat data collected throughout the nearly four-year war with Russia, newly appointed Defence Minister Mykhailo Fedorov has said. Fedorov -- a former digitalisation minister who last week took up the post to drive reforms across Ukraine's vast defence ministry and armed forces -- has described Kyiv's wartime data trove as one of its "cards" in negotiations with other nations. Since Russia's invasion in February 2022, Ukraine has gathered extensive battlefield information, including systematically logged combat statistics and millions of hours of drone footage captured from above. Such data is important for training AI models, which require large volumes of real-world information to identify patterns and predict how people or objects might act in various situations.

Read more of this story at Slashdot.

Categories: Computer, News

Energy Costs Will Decide Which Countries Win the AI Race, Microsoft's Nadella Says

Slashdot - Tue, 2026-01-20 16:29
Energy costs will be key to deciding which country wins the AI race, Microsoft CEO Satya Nadella has said. CNBC: As countries race to build AI infrastructure to capitalize on the technology's promise of huge efficiency gains, Nadella told the World Economic Forum (WEF) on Tuesday that "GDP growth in any place will be directly correlated" to the cost of energy in using AI. He pointed to a new global commodity in "tokens" -- basic units of processing that are bought by users of AI models, allowing them to run tasks. "The job of every economy and every firm in the economy is to translate these tokens into economic growth, then if you have a cheaper commodity, it's better." "I would say we will quickly lose even the social permission to actually take something like energy, which is a scarce resource, and use it to generate these tokens, if these tokens are not improving health outcomes, education outcomes, public sector efficiency, private sector competitiveness across all sectors," Nadella said.

Read more of this story at Slashdot.

Categories: Computer, News

Amazon CEO Jassy Says Tariffs Have Started To 'Creep' Into Prices

Slashdot - Tue, 2026-01-20 15:40
Amazon CEO Andy Jassy said President Donald Trump's sweeping tariffs are starting to be reflected in the price of some items, as sellers weigh how to absorb the shock of the added costs. From a report: Amazon and many of its third-party merchants pre-purchased inventory to try to get ahead of the tariffs and keep prices low for customers, but most of that supply ran out last fall, Jassy said in a Tuesday interview with CNBC's Becky Quick at the World Economic Forum in Davos, Switzerland. "So you start to see some of the tariffs creep into some of the prices, some of the items, and you see some sellers are deciding that they're passing on those higher costs to consumers in the form of higher prices, some are deciding that they'll absorb it to drive demand and some are doing something in between," Jassy said. "I think you're starting to see more of that impact." The comments are a notable shift from last year, when Jassy said Amazon hadn't seen "prices appreciably go up" a few months after Trump announced wide-ranging tariffs. Further reading: Americans Are the Ones Paying for Tariffs, Study Finds: Americans, not foreigners, are bearing almost the entire cost of U.S. tariffs, according to new research that contradicts a key claim by President Trump and suggests he might have a weaker hand in a reemerging trade war with Europe. [...] The new research, published Monday by the Kiel Institute for the World Economy, a well-regarded German think tank, suggests that the impact of tariffs is likely to show up over time in the form of higher U.S. consumer prices. [...] By analyzing $4 trillion of shipments between January 2024 and November 2025, the Kiel Institute researchers found that foreign exporters absorbed only about 4% of the burden of last year's U.S. tariff increases by lowering their prices, while American consumers and importers absorbed 96%.

Read more of this story at Slashdot.

Categories: Computer, News

Sony Is Ceding Control of TV Hardware Business To China's TCL

Slashdot - Tue, 2026-01-20 15:00
Sony plans to spin off its TV hardware business to a new joint venture controlled by Chinese electronics giant TCL, the two said Tuesday, a significant retreat for the Japanese giant whose Bravia line has long occupied the premium end of the television market. TCL would hold a 51% stake in the venture and Sony would retain 49% under a nonbinding agreement the two companies signed. They aim to finalize binding terms by the end of March and begin operations in April 2027, pending regulatory approvals. The new company would retain the Sony and Bravia branding for televisions and home audio equipment but use TCL's display technology. Japanese TV manufacturers have steadily lost ground to Chinese and Korean rivals over the years. Toshiba, Hitachi, Mitsubishi Electric and Pioneer exited the business entirely. Panasonic and Sharp de-emphasized televisions in their growth strategies. Sony's Bravia line survived by positioning itself at the premium tier where consumers pay more for high-end picture and sound quality.

Read more of this story at Slashdot.

Categories: Computer, News

'Just Because Linus Torvalds Vibe Codes Doesn't Mean It's a Good Idea'

Slashdot - Tue, 2026-01-20 14:00
In an opinion piece for The Register, Steven J. Vaughan-Nichols argues that while "vibe coding" can be fun and occasionally useful for small, throwaway projects, it produces brittle, low-quality code that doesn't scale and ultimately burdens real developers with cleanup and maintenance. An anonymous reader shares an excerpt: Vibe coding got a big boost when everyone's favorite open source programmer, Linux's Linus Torvalds, said he'd been using Google's Antigravity LLM on his toy program AudioNoise, which he uses to create "random digital audio effects" using his "random guitar pedal board design." This is not exactly Linux or even Git, his other famous project, in terms of the level of work. Still, many people reacted to Torvalds' vibe coding as "wow!" It's certainly noteworthy, but has the case for vibe coding really changed? [...] It's fun, and for small projects, it's productive. However, today's programs are complex and call upon numerous frameworks and resources. Even if your vibe code works, how do you maintain it? Do you know what's going on inside the code? Chances are you don't. Besides, the LLM you used two weeks ago has been replaced with a new version. The exact same prompts that worked then yield different results today. Come to think of it, it's an LLM. The same prompts and the same LLM will give you different results every time you run it. This is asking for disaster. Just ask Jason Lemkin. He was the guy who used the vibe coding platform Replit, which went "rogue during a code freeze, shut down, and deleted our entire database." Whoops! Yes, Replit and other dedicated vibe programming AIs, such as Cursor and Windsurf, are improving. I'm not at all sure, though, that they've been able to help with those fundamental problems of being fragile and still cannot scale successfully to the demands of production software. It's much worse than that. Just because a program runs doesn't mean it's good. As Ruth Suehle, President of the Apache Software Foundation, commented recently on LinkedIn, naive vibe coders "only know whether the output works or doesn't and don't have the skills to evaluate it past that. The potential results are horrifying." Why? In another LinkedIn post, Craig McLuckie, co-founder and CEO of Stacklok, wrote: "Today, when we file something as 'good first issue' and in less than 24 hours get absolutely inundated with low-quality vibe-coded slop that takes time away from doing real work. This pattern of 'turning slop into quality code' through the review process hurts productivity and hurts morale." McLuckie continued: "Code volume is going up, but tensions rise as engineers do the fun work with AI, then push responsibilities onto their team to turn slop into production code through structured review."

Read more of this story at Slashdot.

Categories: Computer, News

Ocean Damage Nearly Doubles the Cost of Climate Change

Slashdot - Tue, 2026-01-20 11:00
A new study from Scripps Institution of Oceanography finds that factoring ocean damage into climate economics nearly doubles the estimated global cost of climate change, adding close to $2 trillion per year from losses to fisheries, coral reefs, and coastal infrastructure. "It is the first time a social cost of carbon (SCC) assessment -- a key measure of economic harm caused by climate change -- has included damages to the ocean," reports Inside Climate News. From the report: "For decades, we've been estimating the economic cost of climate change while effectively assigning a value of zero to the ocean," said Bernardo Bastien-Olvera, who led the study during his postdoctoral fellowship at Scripps. "Ocean loss is not just an environmental issue, but a central part of the economic story of climate change." The social cost of carbon is an accounting method for working out the monetary cost of each ton of carbon dioxide released into the atmosphere. "[It] is one of the most efficient tools we have for internalizing climate damages into economic decision-making," said Amy Campbell, a United Nations climate advisor and former British government COP negotiator. Calculations have historically been used by international organizations and state departments like the U.S. Environmental Protection Agency to assess policy proposals -- though a 2025 White House memo from the Trump administration instructed federal agencies to ignore the data during cost-benefit analyses unless required by law. "It becomes politically contentious when deciding whose damages are counted, which sectors are included and most importantly how future and retrospective harms are valued," Campbell said. Excluding ocean harm, the social cost of carbon is $51 per ton of carbon dioxide emitted. This increases to $97.20 per ton when the ocean, which covers 70 percent of the planet, is included. In 2024, global CO2 emissions were estimated to be 41.6 billion tons, making the 91 percent cost increase significant. Using greenhouse gas emission predictions, the report estimates the annual damages to traditional markets alone will be $1.66 trillion by 2100.

Read more of this story at Slashdot.

Categories: Computer, News

Bank of England 'Must Plan For a Financial Crisis Triggered By Aliens'

Slashdot - Tue, 2026-01-20 08:00
A former Bank of England analyst has urged contingency planning for a potential financial shock if the U.S. government were to confirm the existence of extraterrestrial intelligence. The argument is that "ontological shock" alone could destabilize confidence and trigger crisis dynamics. The Independent reports: [Helen McCaw, who served as a senior analyst in financial security at the UK's central bank and worked for the Bank of England for 10 years until 2012] said politicians and bankers can no longer afford to dismiss talk of alien life, and warned a declaration of this nature could trigger bank collapses. She reportedly said: "The United States government appears to be partway through a multi-year process to declassify and disclose information on the existence of a technologically advanced non-human intelligence responsible for Unidentified Anomalous Phenomena (UAPs)." "If the UAP proves to be of non-human origin, we may have to acknowledge the existence of a power or intelligence greater than any government and with potentially unknown intentions." Her warning comes as senior American officials have recently indicated their belief in the possibility of alien life. [...] Ms McCaw said: "UAP disclosure is likely to induce ontological shock and provoke psychological responses with material consequences ... There might be extreme price volatility in financial markets due to catastrophising or euphoria, and a collapse in confidence if market participants feel uncertain on how to price assets using any of the familiar methods." The former Bank of England worker explained there might be a rush towards assets such as gold or other precious metals, and government bonds, which are perceived as "safe." Alternatively, she said precious metals might lose their status as perceived safe assets if people speculate that new space-faring technologies will soon increase the supply of precious metals. The article cites a recent UFO documentary, The Age of Disclosure, where 34 U.S. government insiders, including those from the military and intelligence community officials, share insights about the governments work with UAP. Per the film's description, the documentary "reveals an 80-year global cover-up of non-human intelligent life and a secret war among major nations to reverse-engineer advanced technology of non-human origin."

Read more of this story at Slashdot.

Categories: Computer, News

CodeSOD: Well Timed Double Checking

The Daily WTF - Tue, 2026-01-20 07:30

Last week's out of order logging reminded Adam R of a similar bug he encountered once.

The log files looked like this:

[2026-01-14 16:40:12.999802][process_name][42][DEBUG][somefilename:01234] A thing happened [2026-01-14 16:40:12.999997][process_name][42][DEBUG][somefilename:01235] Another thing happened [2026-01-14 16:40:12.000031][process_name][42][DEBUG][somefilename:01236] A third thing happened [2026-01-14 16:40:13.000385][process_name][42][DEBUG][somefilename:01237] A fourth thing happened

Note the timestamp on the third log line: it's out of order. But as you can get from Adam's highly anonymized messages, it's actually in the correct order- it's the third thing that happened, and it's the third log line. So clearly, something has gone off with calculating the timestamp.

Now, if you want to ask your OS for time with microsecond precision, you can call gettimeofday, which will populate a timeval struct. That gives you seconds/microseconds since the epoch. gmtime can then be used to convert the seconds portion into something more readable. This is pretty standard stuff- how could someone screw it up?

void Logger::log(const char* message, int level, const char* filename, int line) { time_t now = time(); struct tm* now_tm = gmtime(&now); struct timeval now_tv; gettimeofday(&now_tv, NULL); char buffer[1024]; // I've simplified this to a fixed-size buffer for expository purposes, but the code DID handle overflow and dynamically resizing the buffer correctly snprintf(buffer, sizeof(buffer), "[%04d-%02d-%02d %02d:%02d:%02d.%06d][%s][%s][%s][%32s:%05d] %s\n", now_tm->tm_year + 1900, now_tm->tm_mon + 1, now_tm->tm_mday, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec, now_tv->tv_usec, get_process_name(), get_thread_id(), log_level_string(level), filename, line, message); write_to_log_file(buffer); }

This C++ function is reconstructed as Adam remembers it. The first four lines highlight the problem: they check the time twice. The call to time() returns the number of seconds since the epoch, which they then convert into a readable time using gmtime. Then they use gettimeofday to get the seconds/microseconds since the epoch. When they print, they use the values from time for every field but microseconds, and then use the microseconds from gettimeofday.

They check the clock twice, and shockingly, get different values each time. And when the clock ticks are near a second boundary, the microseconds can roll back over to zero, creating a situation where log entries appear to go backwards in time.

The fix was simple: just check the time once.

Adam writes:

My suspicion is that this logging function started out printing only seconds, and then someone realized "Hey, wouldn't it be useful to add microseconds to here as well?" and threw in the extra call to gettimeofday() without thinking about it hard enough.

That's a pretty solid suspicion. Adam can't confirm it, because he doesn't work there anymore, and has no access to their source control, and even if he did, the project has been through multiple source control migrations which destroyed or otherwise mangled the history, leaving the root cause as always and forever a mystery.

[Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.
Categories: Computer

Pages