In your case it could be some bug in the dev version, which may get sorted out, but if you need it now, try the latest stable version instead, or the newer one from 6.34 (08 now).
I can confirm that it is not crashing with v6.32.12, but as you can see in your image also bins are not drawn. When i fill one bin less i see following
It appears that there’s a bug somewhere in the ROOT code. A developer can confirm and check
If we draw the projected histogram with the option “colz”, we can see that the lowest bin content falls outside the colour scale, as the minimum is probably set to be exactly equal to the lowest value.
One workaround can be to set a minimum value to the projected histo (lower than the actual minimum of all the non-empty bin contents) to force the actual minimum to fall within the coloured bins. Based on your example:
If we include/exclude the SetMinimum() line (I used zero, but you can get the real minimum from the last printed output – see the difference between the two printouts here: ROOT: TH1 Class Reference ), we get:
Without SetMinimum, 7 falls under the lowest colour:
void m() {
Int_t point[3] = {1, 1, 1};
Int_t bins[3] = {1, 1, 3};
Double_t mins[3] = {0, 0, 0};
Double_t maxs[3] = {10, 10, 10};
THnSparse *s = new THnSparseC("s", "sss", 3, bins, mins, maxs);
s->SetBinContent(s->GetBin(point), 1);
point[0] = 1;
point[1] = 1;
point[2] = 2;
// comment this line and it will work ok.
s->SetBinContent(s->GetBin(point), 1);
point[2] = 3;
// comment this line and it will work ok.
s->SetBinContent(s->GetBin(point), 1);
// s->Projection(0, 1, 2)->Draw();
auto p = s->Projection(0, 1, 2);
p->SetMinimum(0); // comment or uncomment this line to see the difference!
p->Draw("colz");
}