BOSTON How could things at the Hinton State Laboratory have gone so wrong?

That was the question repeatedly asked during hours of testimony on the state drug lab scandal before the Legislature’s Public Safety Committee Wednesday. Many lawmakers say they still don’t have answers. But one thing is clear: It’s going to cost a lot to fix.

Attorney David Meier, a former prosecutor in Middlesex and Suffolk counties appointed by Gov. Deval Patrick to identify cases where chemist Annie Dookhan tested drug evidence, said as many as 10,000 people could be affected. He is doing a “file-by-file” review to make sure all cases Dookhan had a role in are identified. During her eight years working at the lab, Dookhan allegedly falsified drug tests, possibly affecting some 34,000 cases.

State Public Safety Secretary Mary Elizabeth Heffernan said that as of this month, close to 200 people have been released from incarceration because their cases were linked to evidence potentially tainted by Dookhan.

“You should not assume that these individuals have been exonerated. These individuals could be under alternative forms of supervision,” Heffernan said. “Regardless, the administration is committed to ensuring that each case is reviewed completely to ensure that justice has been administered properly.”

Heffernan also said the lab where Dookhan worked, which was overseen by the Department of Public Health before it was taken over by state police in July, now has a backlog of about 10,000 drug tests. She urged lawmakers to approve $3.4 million to address that.

Estimates of how much the scandal might cost the state in total vary widely — with some as high as hundreds of millions of dollars. Massachusetts District Attorneys Association President Michael O’Keefe says prosecutors will need close to $13 million.

“Adequate resources and good management are interdependent in preventing this kind of anomaly, if you will, from occurring.” O’Keefe said.

O’Keefe also defended the relationship between Dookhan and Norfolk County prosecutor George Papachristos, who resigned after news reports about his frequent emails and calls to Dookhan.

“The chemist at the lab, whether it’s the state police lab or any lab, is the commonwealth’s witness in a criminal case,” O’Keefe said. “The assistant DA has to speak to them. As it was bandied about in the Globe and other places that this was an inappropriate and terrible thing to do, is just nonsense.”

But appropriate procedures obviously weren’t followed. State Health and Human Services Secretary JudyAnn Bigby, who oversees the Department of Public Health, said she has discovered breaches in protocol which, she says, are being addressed.

“We asked the questions: How did this happen? And how was one chemist able to cause so much damage?” Bigby said. “My review found the lab maintained outdated operating procedures, lacked independent accreditation, and lab supervisors failed to monitor their direct reports.”

But Rep. Harold Naughton, D-Clinton, co-chair of the committee, said he still has those same questions.

“What happened? What was going on in there?” Naughton asked. “I still don’t know to my satisfaction, what was Annie Dookhan doing on a daily basis in that lab that people didn’t call attention to it long before June of 2011?”

Perhaps those will be answered when his committee holds another hearing on the drug lab scandal next month.