The stability of a self-gravitating infinitesimally thin gaseous disk rotating around a central mass is studied. Our global linear analysis concerns marginal stability, i.e. it yields the critical temperature for the onset of instability for any given ratio of the disk mass to the central mass. Both axisymmetric and low-m nonaxisymmetric excitations are analysed. When the fractional disk mass increases, the symmetry character of the instability changes from rings (m = 0) to one-armed trailing spirals (m = 1). The distribution of the surface density along the spiral arms is not uniform, but describes a sequence of maxima that might be identified with forming planets. The number of the mass concentrations decreases with increasing fractional disk mass. We also obtain solutions in the form of global nonaxisymmetric vortices, which are, however, never excited.