The current decline in oil prices, which continues to show no signs of a long-term reversal, is having a great many unexpected and unwanted consequences, many of which may turn into long-lasting troubles for the oil and gas industry − and especially for its investors.

Investors who own shares in companies and partnerships that are suffering from the hard times in the oil patch will face an ever-bigger headache thanks to the tax consequences of the price drop. The problem – essentially a situation that requires investors to book income for tax purposes and to pay hefty federal taxes even though they don’t actually receive any cash – is a direct result of the ongoing restructuring of the industry and its debt, triggered by the crash in oil prices.

Here is some background. Many oil production ventures are structured as limited partnerships or are taxed the same way. When oil prices were high, that was a desirable arrangement, because it allowed income to flow directly to investors without the double taxation that would kick in if the ventures were organized as corporations.

Now that times are tough, however, the structure of these ventures is coming back to bite investors, who are now learning to their chagrin that they may owe significant taxes on the dollar amount of forgiveness of the partnerships’ debt that can accompany a bankruptcy or an out-of-court restructuring.

As these partnerships try to restructure their obligations in the face of the oil-price declines and reductions in cash flow, federal tax law requires that their owners pay income tax on their share of the partnership’s debt that was forgiven by creditors in the restructuring. This is true even though the investors may have received no actual cash income as a result of the restructuring transaction. And it’s true of all types of entities that are taxed as partnerships – including master limited partnerships and limited liability companies.

As the energy industries continue to work out debt relief packages, either through bankruptcy or out of court, tax considerations have necessarily emerged as a significant part of the discussion.

This is especially the case for the private equity sector, in which individual investors and company executives are trying to come up with deal structures that will reduce the taxes due.

Private equity is involved because, in the early part of this decade, a great many private equity firms and investment groups entered the upstream oil and gas market, pumping in billions of dollars in capital and leveraging their investments with bank financing or other loans.

The tax issue works this way. Suppose a private equity investor owned 20 percent of a venture that restructures its debt in the face of low oil prices. If the business writes down 50 percent of its $200 million outstanding debt, the total “forgiveness of indebtedness” would be $100 million. This private equity investor would be on the hook for 20 percent of that, or $20 million, which would be “credited” to the investor as income even though the investor didn’t actually receive the cash. At a tax rate of 40 percent, that would represent a liability of $8 million for that investor on the phantom income.

The financial stress, and the tax problems, have hit the entire sector, but experts say the companies in the oil exploration and production segments of the industry (the upstream sector) are the hardest hit and the most likely to pursue reorganization of their debt. Companies in the midstream sector, which engage in transportation, storage and waste disposal, are not yet in such dire straits at this time.

The amount of money at stake is potentially staggering. Fitch Ratings estimated at the end of 2015 that energy partnerships held a total of $258 billion in debt, up from $92 billion at the end of 2011. While not all of these partnerships will be forced to reorganize and restructure their debt, potentially causing tax liability, this may befall a significant percentage of them.

The problem is not going away quickly. Fitch estimates that by the end of 2016, as many as 11 percent of high-yield bonds in the energy industry may default.

A corporation can normally shield itself from tax liability for debt forgiveness by going into insolvency. But in the partnership context, the key legal status is the solvency of the individual partners, not of the partnership itself, so the situation cannot be resolved in this manner. The tax liability will continue to go up the chain to reach the ultimate owners.

However, the owners’ tax liability is not likely to be the partnership’s first priority. A struggling oil-patch company will first want to operate so as to maximize repayment to its creditors, then to consider the company’s own viability. Concerns about the investors’ tax liability will be tertiary concerns at best.

Partners may still have any number of options available to reduce the unwelcome tax burdens, and experienced tax and investment counsel can come up with creative options to ease the pain.

Theoretically, some partners may want to formally abandon their interests in a partnership if they think the business will not recover even in the long term as oil prices remain low. Although abandonment of an investment can carry tax consequences, they may not be as severe as those caused by the cancellation of debt.

Some have suggested that the tax liability can be avoided by changing a partnership to a C corporation before the cancellation of debt income is recognized. But this may not work, since through the process of incorporation, the partners may be required to recognize capital gains. This would result in a lower tax bill because of the lower rate applicable to capital gains but not in the avoidance of taxes entirely.

In addition, the Internal Revenue Service may wish to take a look at the reasons behind such a radical change in corporate structure so close to an event that will involve the cancellation of debt.

For a current example of the problem, look no further than Linn Energy LLC, a Houston-based oil and gas producer, which is taxed as a master limited partnership rather than as a corporation. In May 2016, Linn filed for Chapter 11 bankruptcy protection in the Southern District of Texas. On April 26, 2016, Linn had proposed an exchange in which its investors were to have the chance to exchange one unit of the LLC for a share of the company’s publicly traded corporate affiliate, LinnCo. That exchange offer ended May 23, 2016.

The purpose of the exchange, of course, was to protect Linn’s investors from taxation resulting from the cancellation of debt income in the bankruptcy, a step that was anticipated. It is not clear at this time how much cancellation of debt income will be recognized when the bankruptcy is resolved, but one commentator said it could be a “substantial” amount.

Linn’s proposed solution to this thorny tax problem is only one of many possibilities, and time will tell which solutions, if any, are likely to work, and what view the IRS will take of this particular solution. Meanwhile, investors in the oil and gas industries are well advised to consult counsel who are familiar with tax, corporate and energy issues.