for (length=0;g_value_get_int(&g_array_index(array,GValue,length)); length++); return length
会因为出界而失败.