|
From: Benjamin L. <lin...@gm...> - 2009-02-22 14:36:18
|
Hello,
I tried to build a debug version of the current development sources
using mingw32.
The compiled version segfaults reproducably in mouse.c. Looking at the
code I see that the FPRINTF macro is missing stderr as target stream
diff -r cbcfbb8c12b7 src/mouse.c
--- a/src/mouse.c Sat Feb 21 18:22:30 2009 +0100
+++ b/src/mouse.c Sun Feb 22 15:28:11 2009 +0100
@@ -299,7 +299,7 @@
MousePosToGraphPosReal(int xx, int yy, double *x, double *y, double
*x2, double *y2)
{
if (!is_3d_plot) {
- FPRINTF(("POS: plot_bounds.xleft=%i, plot_bounds.xright=%i,
plot_bounds.ybot=%i, plot_bounds.ytop=%i\n",
+ FPRINTF((stderr, "POS: plot_bounds.xleft=%i, plot_bounds.xright=%i,
plot_bounds.ybot=%i, plot_bounds.ytop=%i\n",
plot_bounds.xleft, plot_bounds.xright, plot_bounds.ybot,
plot_bounds.ytop));
if (plot_bounds.xright == plot_bounds.xleft)
@@ -314,7 +314,7 @@
*y = AXIS_MAPBACK(FIRST_Y_AXIS, yy);
*y2 = AXIS_MAPBACK(SECOND_Y_AXIS, yy);
}
- FPRINTF(("POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
+ FPRINTF((stderr, "POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
} else {
/* for 3D plots, we treat the mouse position as if it is
I also would suggest to add -DDEBUG to CFLAGS in makegile.mgw for a
debug-enabled build. Then one can issue simply
make -f config/makefile.mgw DEBUG=1
to generate a version with debugging enabled
diff -r cbcfbb8c12b7 config/makefile.mgw
--- a/config/makefile.mgw Sat Feb 21 18:22:30 2009 +0100
+++ b/config/makefile.mgw Sun Feb 22 15:28:11 2009 +0100
@@ -170,7 +170,7 @@
CP = cp -p
ifdef DEBUG
- CFLAGS += -g
+ CFLAGS += -g -DDEBUG
LDFLAGS += -g
else
CFLAGS += -O2
benjamin
|
|
From: Ethan A M. <merritt@u.washington.edu> - 2009-02-22 19:01:30
|
On Sunday 22 February 2009, Benjamin Lindner wrote:
> The compiled version segfaults reproducably in mouse.c. Looking at the
> code I see that the FPRINTF macro is missing stderr as target stream
Thank you. Fixed in CVS.
> diff -r cbcfbb8c12b7 src/mouse.c
> --- a/src/mouse.c Sat Feb 21 18:22:30 2009 +0100
> +++ b/src/mouse.c Sun Feb 22 15:28:11 2009 +0100
> @@ -299,7 +299,7 @@
> MousePosToGraphPosReal(int xx, int yy, double *x, double *y, double
> *x2, double *y2)
> {
> if (!is_3d_plot) {
> - FPRINTF(("POS: plot_bounds.xleft=%i, plot_bounds.xright=%i,
> plot_bounds.ybot=%i, plot_bounds.ytop=%i\n",
> + FPRINTF((stderr, "POS: plot_bounds.xleft=%i, plot_bounds.xright=%i,
> plot_bounds.ybot=%i, plot_bounds.ytop=%i\n",
> plot_bounds.xleft, plot_bounds.xright, plot_bounds.ybot,
> plot_bounds.ytop));
>
> if (plot_bounds.xright == plot_bounds.xleft)
> @@ -314,7 +314,7 @@
> *y = AXIS_MAPBACK(FIRST_Y_AXIS, yy);
> *y2 = AXIS_MAPBACK(SECOND_Y_AXIS, yy);
> }
> - FPRINTF(("POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
> + FPRINTF((stderr, "POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
>
> } else {
> /* for 3D plots, we treat the mouse position as if it is
>
>
> I also would suggest to add -DDEBUG to CFLAGS in makegile.mgw for a
> debug-enabled build. Then one can issue simply
> make -f config/makefile.mgw DEBUG=1
> to generate a version with debugging enabled
> diff -r cbcfbb8c12b7 config/makefile.mgw
> --- a/config/makefile.mgw Sat Feb 21 18:22:30 2009 +0100
> +++ b/config/makefile.mgw Sun Feb 22 15:28:11 2009 +0100
> @@ -170,7 +170,7 @@
> CP = cp -p
>
> ifdef DEBUG
> - CFLAGS += -g
> + CFLAGS += -g -DDEBUG
> LDFLAGS += -g
> else
> CFLAGS += -O2
>
>
> benjamin
--
Ethan A Merritt
|
|
From: Benjamin L. <lin...@gm...> - 2009-02-27 18:05:24
|
Ethan A Merritt wrote:
> On Sunday 22 February 2009, Benjamin Lindner wrote:
>
>> The compiled version segfaults reproducably in mouse.c. Looking at the
>> code I see that the FPRINTF macro is missing stderr as target stream
>
> Thank you. Fixed in CVS.
>
Thanks, but in the second hunk there is I guess a typo in CVS, 'stderr'
should not be part of the string, but be the first argument.
benjamin
diff -r 78ae0c4f5e82 src/mouse.c
--- a/src/mouse.c Fri Feb 27 10:45:13 2009 +0100
+++ b/src/mouse.c Fri Feb 27 10:53:28 2009 +0100
@@ -314,7 +314,7 @@
*y = AXIS_MAPBACK(FIRST_Y_AXIS, yy);
*y2 = AXIS_MAPBACK(SECOND_Y_AXIS, yy);
}
- FPRINTF(("stderr, POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
+ FPRINTF((stderr, "POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
} else {
/* for 3D plots, we treat the mouse position as if it is
|
|
From: Ethan M. <merritt@u.washington.edu> - 2009-02-27 19:09:28
|
On Friday 27 February 2009 10:06:56 Benjamin Lindner wrote:
> Ethan A Merritt wrote:
> > On Sunday 22 February 2009, Benjamin Lindner wrote:
> >
> >> The compiled version segfaults reproducably in mouse.c. Looking at the
> >> code I see that the FPRINTF macro is missing stderr as target stream
> >
> > Thank you. Fixed in CVS.
> >
>
> Thanks, but in the second hunk there is I guess a typo in CVS, 'stderr'
> should not be part of the string, but be the first argument.
Proving once again that no fix is too simple to mess up when
applied by hand :-\
> benjamin
>
> diff -r 78ae0c4f5e82 src/mouse.c
> --- a/src/mouse.c Fri Feb 27 10:45:13 2009 +0100
> +++ b/src/mouse.c Fri Feb 27 10:53:28 2009 +0100
> @@ -314,7 +314,7 @@
> *y = AXIS_MAPBACK(FIRST_Y_AXIS, yy);
> *y2 = AXIS_MAPBACK(SECOND_Y_AXIS, yy);
> }
> - FPRINTF(("stderr, POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
> + FPRINTF((stderr, "POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
>
> } else {
> /* for 3D plots, we treat the mouse position as if it is
--
Ethan A Merritt
|