[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnubg] Assertion fail with progress bar
From: |
保坂範行 |
Subject: |
[Bug-gnubg] Assertion fail with progress bar |
Date: |
Fri, 9 Apr 2010 14:46:51 +0900 |
Hi.
I see assertion fail when analysis of game/match done.
Such as
(gnubg:30806): Gtk-CRITICAL **: gtk_progress_set_percentage: assertion
`percentage >= 0 && percentage <= 1.0' failed
To find out, I inserted old printf as follow:
gtkgame.c
extern void GTKProgressValue ( int iValue, int iMax )
{
gchar *gsz;
gdouble frac = 1.0 * iValue / (1.0 * iMax );
gsz = g_strdup_printf("%d/%d (%.0f%%)", iValue, iMax, 100 * frac);
gtk_progress_bar_set_text( GTK_PROGRESS_BAR( pwProgress ), gsz);
printf("%d, %d, %f\n", iValue, iMax, frac);
gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( pwProgress ), frac);
g_free(gsz);
ProcessEvents();
}
And got:
(Game over) analyse match
1, 61, 0.016393
3, 61, 0.049180
6, 61, 0.098361
9, 61, 0.147541
12, 61, 0.196721
15, 61, 0.245902
19, 61, 0.311475
28, 61, 0.459016
43, 61, 0.704918
47, 61, 0.770492
49, 61, 0.803279
51, 61, 0.836066
53, 61, 0.868852
55, 61, 0.901639
57, 61, 0.934426
60, 0, inf
(gnubg:30806): Gtk-CRITICAL **: gtk_progress_set_percentage: assertion
`percentage >= 0 && percentage <= 1.0' failed
This means GTKProgressValue got iMax =0.
By using ddd/gdb, I found that it happend via
static gboolean UpdateProgressBar(gpointer unused)
{
ProgressValue(MT_GetDoneTasks());
return TRUE;
}
Some how iMax in ProgressValue has changed to 0.
Nori
- [Bug-gnubg] Assertion fail with progress bar,
保坂範行 <=