I hit this while using qgis, when I tried to classify attributes from a newly created vector layer with unsaved features and therefore empty attribute table in the file. This backtrace is from gdal 1.3.1, but I could reproduce it with 1.5.0 as well.
#0 0xb7ba67c4 in swq_select_finish_summarize (select_info=0x96b47d0) at swq.c:2233
#1 0xb7b37ecb in OGRGenSQLResultsLayer::PrepareSummary (this=0x96d74c0) at ogr_gensql.cpp:507
#2 0xb7b38b1c in OGRGenSQLResultsLayer::GetFeature (this=0x96d74c0, nFID=0) at ogr_gensql.cpp:725
#3 0xb7b38bcc in OGRGenSQLResultsLayer::GetNextFeature (this=0x96d74c0) at ogr_gensql.cpp:682
#4 0xb7b45273 in OGR_L_GetNextFeature (hLayer=0x96d74c0) at ogrlayer.cpp:446
#5 0xb5d2f873 in QgsOgrProvider::getUniqueValues (this=0x9693ea0, index=0, uniqueValues=@0xbfed1810)
at /var/tmp/portage/sci-geosciences/qgis-0.10.0/work/qgis_0.10.0/src/providers/ogr/qgsogrprovider.cpp:1284
Reason seems to be that select_info->column_summary == NULL in swq_select_finish_summarize because column_summary gets allocated in swq_select_summarize when the first row of the result is processed, but OGRGenSQLResultsLayer::PrepareSummary never calls that function if there are no data rows.
I'm not sure what correct behaviour should be, probably an empty result set. Definitely not a crash.