p-Nitroaniline reaction with sulfuric acid
I think the abstract of the reference did not give away what's going on the reaction. However, I assume that the full paper should have described what's happening to at least certain extend. Since I don't have access to this paper at the moment, only I can do is speculate. Yet, I'd direct you to reliable source for certain information. Accordingly, when you heat the mixture of p-notroaniline and conc. sulfuric acid:

The only gaseous product you would obtain is $\ce{H2O}$ (with some nitroaniline subliming at higher mole ratios) up to the temperature of $\pu{230 ^\circ C}$. At $\pu{230 ^\circ C}$, it is called pre-expansion stage. Sulfur dioxide has been absent from gaseous products (confirmed by iodine test). It was noted that dehydration and sulfonation are the main chemical processes taken place at this stage.

There are two more stages to follow before you see the carbon snake, after stage of which called oxidative decomposition of the residue. This UCSB article also provides some other interesting excerpts from the original article (Ref.1), and listed below for readers' benefit:

The mole ratio of nitroaniline to sulfuric acid, however, is not critical; voluminous foams have been obtained from mixtures over a mole ratio range of 0.3 to 2.0 if a proper heating schedule is maintained. Sulfur dioxide and water are the principal gaseous products evolved during these expansions.


The foams were good thermal insulators inert to chemicals, e.g., concentrated mineral acids, alkalies, organic and inorganic solvents, and oxidants.


The exact structural nature of the insoluble residue constituting the foam is unknown. All the sulfur in the residue is present as sulfonic acid groups attached to the benzene nuclei. Secondary amino or azinium groups resulting from deammoniative coupling must be present in order to account for ammonium ions and Nitrogen content less than 2 per benzene nucleus. A high nitrogen-to-oxygen ratio indicates that few if any nitro groups remain. Thus, both nitro arid sulfonic acid groups are involved in oxidative processes.

Also, followings are three relevant demonstrations of the reaction: here, here, and here. Also, here is a demonstration of the dehydration reaction of sugar by concentrated sulfuric acid forming a column of graphite for comparison.

It is worth noting that the carbon form created by the p-nitroaniline reaction with sulfuric acid is found to be useful in $\ce{CO2}$ adsorption (Ref.2).

References:

A. C. Poshkus, J. A. Parker, &quot;Studies on nitroaniline–sulfuric acid compositions: Aphrogenic pyrostats,&quot; J. Appl. Polym. Sci. 1970, 14(8), 2049–2064 (doi: https://doi.org/10.1002/app.1970.070140813).
Enrico Andreoli, Andrew R. Barron, &quot;$\ce{CO2}$ Adsorption by para-Nitroaniline Sulfuric Acid-Derived Porous Carbon Foam,&quot; J. Carbon Res. 2016, 2(4), 25 (9 pages) (doi: https://doi.org/10.3390/c2040025).