The state Senate is having "active discussions" about a bill that would legalize medical aid in dying in Massachusetts, and the House of Representatives is "very divided" on the issue, legislative leaders said Monday.

Some version of legislation that would allow terminally ill patients to request and receive medication to end their lives has been filed every session since 2008. The topic has drawn heated, emotional testimony over the years but leaders in the House and Senate have not brought it to the floor for a vote. In 2012, frustrated supporters of the idea brought an aid in dying question to the ballot as an initiative petition. It garnered 48.9 percent support, but failed with 51.1 percent of voters opposed to the proposal.

With the two-year legislative session winding down, this year's bill (S 1384) is bottled up in the Health Care Financing Committee. Last week, the House agreed to let the committee hold onto the bill until July 31, the last day of formal lawmaking business for the term.

Last month, bill proponents touted support for the policy within the Legislature, with 85 House and Senate co-sponsors. An April Suffolk University/Boston Globe poll found 76.6 percent of Massachusetts residents support the idea of allowing terminally ill patients to request aid-in-dying medication from their doctors.

Asked Monday afternoon about the poll results and if lawmakers are interested in moving the measure forward, House Speaker Mariano said he was not familiar with the poll.

"I just know that from talking to the membership, we have a very divided House of Representatives," he told reporters. "There's not a 77 percent affirmative vote in the House right now. I'd be very surprised, so that has some work to be done on it."

Said Senate President Karen Spilka, "I am talking to some senators about the bill and trying to get a sense of where the body is, whether or not it moves forward, but we are having active discussions about the bill."