Per the IRS website Declaring Bankruptcy
Bankruptcy proceedings begin with the filing of a petition with the bankruptcy court. The filing of the petitions creates a bankruptcy estate, which generally consists of all the assets of the person filing the bankruptcy petition. A separate taxable entity is created if the bankruptcy petition is filed by an individual under chapter 7 or chapter 11 of the Bankruptcy Code.
The tax obligations of the person filing a bankruptcy petition (the debtor) vary depending on the bankruptcy chapter under which the petition was filed.
Generally, when a debt owed to another is canceled the amount canceled or forgiven is considered income that is taxed to the person owing the debt. If a debt is canceled under a bankruptcy proceeding, the amount canceled is not income. However, the canceled debt reduces the amount of other tax benefits the debtor would otherwise be entitled to.
This information is not intended to cover bankruptcy law in general, or to provide detailed discussions of the tax rules for the more complex corporate bankruptcy reorganizations or other highly technical transactions.
For additional tax information on bankruptcy, please refer to Publication 908 Bankruptcy Tax Guide