[DebianGIS-dev] Bug#336498: grass: broken macro LOC_CHECK_VERSION (also FTBFS on GNU/FreeBSD)

Petr Salinger Petr.Salinger at t-systems.cz
Sun Oct 30 19:14:39 UTC 2005


Package: grass
Severity: important

Please split macro LOC_CHECK_VERSION from aclocal
into LOC_CHECK_VERSION_STRING and LOC_CHECK_VERSION_NUMBER
and use them appropriate in configure.in.

Current version check is unreliable.

Generated snippet, i.e.:

#include "confdefs.h"

#include <stdio.h> 
#include <proj_api.h>
int main(void) {
 FILE *fp = fopen("conftestdata","w");
 char *p;
 p = PJ_VERSION;
 fputs(p, fp);
 return 0;
}

is compiled OK, only with "warning: assignment makes pointer from integer 
without a cast".

When the created binary is executed, random (given by arbitrary version 
integer) memory is accessed and result might be either segfault or garbage from memory.

It currently segfault on GNU/Linux => package can be compiled
and returns garbage on GNU/FreeBSD => it FTBFS there.

It would be nice if you could get fixed it into upstream.

Temporarily the attached patch can be also used.

Thanks in advance,

        Petr


--- grass-6.0.1.orig/configure
+++ grass-6.0.1/configure
@@ -6421,31 +6421,6 @@
     echo "$ac_t""unknown (cross-compiling)" 1>&6 
 else
   cat > conftest.$ac_ext <<EOF
-#line 6425 "configure"
-#include "confdefs.h"
-
-#include <stdio.h> 
-#include <proj_api.h>
-int main(void) {
- FILE *fp = fopen("conftestdata","w");
- fputs(PJ_VERSION, fp);
- return 0;
-}
-
-EOF
-if { (eval echo configure:6437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-     proj_ver=`cat conftestdata`
-    echo "$ac_t""$proj_ver" 1>&6
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-     if test "$cross_compiling" = yes; then
-     proj_ver=UNKNOWN
-        echo "$ac_t""unknown (cross-compiling)" 1>&6 
-else
-  cat > conftest.$ac_ext <<EOF
 #line 6450 "configure"
 #include "confdefs.h"
 
@@ -6471,11 +6446,6 @@
 rm -fr conftest*
 fi
 
-
-fi
-rm -fr conftest*
-fi
-
 CPPFLAGS=$ac_save_cppflags
 









More information about the Pkg-grass-devel mailing list