Safety is of great concern to athletes and tourists. They are right to worry. According to local news reports, drug traffickers are involved in territorial disputes in at least 20 Rio neighborhoods.

Eight years ago, the government established the Pacifying Police Units, a heavily armed force that tries to reclaim favelas from the gangs. But these units seem to have worsened the drug war rather than ended it. This year, 43 police officers have been killed in the state, and at least 238 civilians have been killed by the police. The United Nations has said it’s concerned about violence by the military police and the officers in the favelas, notably against children living on the streets. Everybody fears an increase in police violence during the Games. The country will deploy 85,000 soldiers and police officers, about twice the number used in the London 2012 Olympics.

Frequent shootouts near the Olympic arenas and on routes to them are also a concern: 76 people have been hit by stray bullets in Rio so far this year; 21 of them have died. On June 19, more than 20 men carrying assault rifles and hand grenades stormed the city’s largest public hospital to free an alleged drug kingpin in police custody, leaving one person dead and two hurt.

And the 500,000 people expected to visit for the Games should be worried about how easily they could wander into dangerous areas: There’s a dearth of signs and tourist information on the streets and on public transportation. A native Brazilian, I spent half an hour at the central train station just trying to figure out where to catch a bus to the Olympic Park — and I’d looked it up beforehand. The information booth inside the station was empty. Outside, few of the bus stops displayed information about which lines went where. I resorted to asking popcorn vendors and passers-by for directions. I’m glad I speak Portuguese.

HOW did everything get so messed up? Money is one problem. “The state is bankrupt,” Francisco Dornelles, the interim Rio governor, admitted in an interview with a magazine two weeks ago.

The incumbent governor, who has lymphoma, is on sick leave. Just before Christmas, he declared a “health system emergency” as hospitals closed units and money ran out for equipment, supplies and salaries. Months later, the state started delaying civil servants’ salaries and pension checks. Teachers have gone on strike and students have occupied dozens of schools in protest. The state already owes $21 billion to Brazil’s federal government and $10 billion to public banks and international lenders. A budget shortfall of $5.5 billion is projected for this year. An $860 million loan has already been granted to help cover the cost of security at the Games.

The fiscal disaster could be attributed to many factors, including a national economic crisis — but the huge expansion of the government payroll and reckless spending for the Olympics are likely causes.