Shapelib 1.3

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Shapelib 1.3

Brian Peschel
Is the 1.3 still a beta release of shapelib?  I noticed it is available
at http://download.osgeo.org/shapelib/ but not at
http://dl.maptools.org/dl/shapelib/.

Either way, I needed to make a change to the 1.3.0b2 Makefile in the lib
section.  The file safileio.c was not being compiled in the library, so
I couldn't link the library.

I figured I would pass this on (I don't recall seeing an email about it,
but I couldn't recall if this was a beta either) in cause you want to
update the master :

lib:
         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
-DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
-I/usr/local/include    -g -O2 -c shpopen.c
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
shpopen.c -o .libs/shpopen.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shpopen.c -o
shpopen.o >/dev/null 2>&1
         mv -f .libs/shpopen.lo shpopen.lo
         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
-DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
-I/usr/local/include    -g -O2 -c shptree.c
         rm -f .libs/shptree.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
shptree.c -o .libs/shptree.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shptree.c -o
shptree.o >/dev/null 2>&1
         mv -f .libs/shptree.lo shptree.lo
         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
-DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
-I/usr/local/include    -g -O2 -c dbfopen.c
         rm -f .libs/dbfopen.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
dbfopen.c -o .libs/dbfopen.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c dbfopen.c -o
dbfopen.o >/dev/null 2>&1
         mv -f .libs/dbfopen.lo dbfopen.lo
         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
-DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
-I/usr/local/include    -g -O2 -c safileio.c
         rm -f .libs/safileio.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
safileio.c -o .libs/safileio.lo
         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
-DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c safileio.c -o
safileio.o >/dev/null 2>&1
         mv -f .libs/safileio.lo safileio.lo
         /bin/sh ./libtool --mode=link gcc  -g -O2  -o libshp.la -rpath
/usr/local/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo
safileio.lo
         rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
         rm -fr .libs/libshp.lax
         mkdir .libs/libshp.lax
         $(LD) -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION)  
shpopen.lo shptree.lo dbfopen.lo safileio.lo -lc
         (cd .libs && rm -f libshp.so.1 && ln -s
libshp.so.$(LIBSHP_VERSION) libshp.so.1)
         (cd .libs && rm -f libshp.so && ln -s
libshp.so.$(LIBSHP_VERSION) libshp.so)
         ar cru .libs/libshp.a  shpopen.o shptree.o dbfopen.o
         ranlib .libs/libshp.a
         rm -fr .libs/libshp.lax
         (cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la)

- B

--
Brian Peschel


_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Shapelib 1.3

Brian Peschel
  <bump>

On 06/21/2010 01:45 PM, Brian Peschel wrote:

> Is the 1.3 still a beta release of shapelib?  I noticed it is
> available at http://download.osgeo.org/shapelib/ but not at
> http://dl.maptools.org/dl/shapelib/.
>
> Either way, I needed to make a change to the 1.3.0b2 Makefile in the
> lib section.  The file safileio.c was not being compiled in the
> library, so I couldn't link the library.
>
> I figured I would pass this on (I don't recall seeing an email about
> it, but I couldn't recall if this was a beta either) in cause you want
> to update the master :
>
> lib:
>         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
> -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
> -I/usr/local/include    -g -O2 -c shpopen.c
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
> shpopen.c -o .libs/shpopen.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shpopen.c -o
> shpopen.o >/dev/null 2>&1
>         mv -f .libs/shpopen.lo shpopen.lo
>         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
> -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
> -I/usr/local/include    -g -O2 -c shptree.c
>         rm -f .libs/shptree.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
> shptree.c -o .libs/shptree.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c shptree.c -o
> shptree.o >/dev/null 2>&1
>         mv -f .libs/shptree.lo shptree.lo
>         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
> -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
> -I/usr/local/include    -g -O2 -c dbfopen.c
>         rm -f .libs/dbfopen.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
> dbfopen.c -o .libs/dbfopen.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c dbfopen.c -o
> dbfopen.o >/dev/null 2>&1
>         mv -f .libs/dbfopen.lo dbfopen.lo
>         /bin/sh ./libtool --mode=compile gcc -DPACKAGE=\"libshp\"
> -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1  -I. -I.
> -I/usr/local/include    -g -O2 -c safileio.c
>         rm -f .libs/safileio.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC
> safileio.c -o .libs/safileio.lo
>         gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\"
> -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c safileio.c -o
> safileio.o >/dev/null 2>&1
>         mv -f .libs/safileio.lo safileio.lo
>         /bin/sh ./libtool --mode=link gcc  -g -O2  -o libshp.la -rpath
> /usr/local/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo
> safileio.lo
>         rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
>         rm -fr .libs/libshp.lax
>         mkdir .libs/libshp.lax
>         $(LD) -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION)  
> shpopen.lo shptree.lo dbfopen.lo safileio.lo -lc
>         (cd .libs && rm -f libshp.so.1 && ln -s
> libshp.so.$(LIBSHP_VERSION) libshp.so.1)
>         (cd .libs && rm -f libshp.so && ln -s
> libshp.so.$(LIBSHP_VERSION) libshp.so)
>         ar cru .libs/libshp.a  shpopen.o shptree.o dbfopen.o
>         ranlib .libs/libshp.a
>         rm -fr .libs/libshp.lax
>         (cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la)
>
> - B
>

_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Memory issue reading string field?

Brian Peschel
I have a simple DBF file I am trying to read:

dBase Reader and Converter V. 0.8, (c) 2002 - 2003 by Bjoern Berg

-- File statistics
dBase version.........:          FoxBase+/dBASE III+ (without memo)
Date of last update...:          1995-07-26
Number of records.....:          1414347 (001594cbd)
Length of header......:          97 (0061d)
Record length.........:          81 (0051d)
Columns in file.......:          2
Rows in file..........:          1414347

+---------------+-------+---------------+---------------+---------------+
| field name    | type  | field adress  | length        | field dec.    |
+---------------+-------+---------------+---------------+---------------+
|           ID  |   N   |        0      |  10           |   0           |
|       String  |   C   |        0      |  70           |   0           |
+---------------+-------+---------------+---------------+---------------+


I am seeing memory corruption in my program after reading this combo from the DBF.
         ID:    1374067
     String: UNITED STATES DEPARTMENT OF THE INTERIOR PATUXENT WILDLIFE RESEARCH CE
What makes this interesting is the string is 70 characters long (which is the width of the field).

If I change the string in the DBF to:
         ID:    1374067
     String: US DEPT OF THE INTERIOR PATUXENT WILDLIFE RESEARCH CENTER
(which is 57 characters) I no longer have any memory corruption.

I tries this on both 1.2.10 and 1.3.0b2.  Any ideas?

- B

_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Memory issue reading string field?

Eduardo Jauch
I'm really "out", but if the "size" of the string can cause memory corruptions, so, maybe, the program have a "limit" to the size of the string, but is not checking if this limite is been observed...

If the code is in C or C++, probably you are writting after the size of the variable.

Like if I declare a variable as char name [5]

And then try to put "PESCHEL" in it.

If the program don't check this, you will write over memory that was not meant to.

Well.

Only an "educated guess" I think...

2010/8/19 Brian Peschel <[hidden email]>
I have a simple DBF file I am trying to read:

dBase Reader and Converter V. 0.8, (c) 2002 - 2003 by Bjoern Berg

-- File statistics
dBase version.........:          FoxBase+/dBASE III+ (without memo)
Date of last update...:          1995-07-26
Number of records.....:          1414347 (001594cbd)
Length of header......:          97 (0061d)
Record length.........:          81 (0051d)
Columns in file.......:          2
Rows in file..........:          1414347

+---------------+-------+---------------+---------------+---------------+
| field name    | type  | field adress  | length        | field dec.    |
+---------------+-------+---------------+---------------+---------------+
|           ID  |   N   |        0      |  10           |   0           |
|       String  |   C   |        0      |  70           |   0           |
+---------------+-------+---------------+---------------+---------------+


I am seeing memory corruption in my program after reading this combo from the DBF.
         ID:    1374067
     String: UNITED STATES DEPARTMENT OF THE INTERIOR PATUXENT WILDLIFE RESEARCH CE
What makes this interesting is the string is 70 characters long (which is the width of the field).

If I change the string in the DBF to:
         ID:    1374067
     String: US DEPT OF THE INTERIOR PATUXENT WILDLIFE RESEARCH CENTER
(which is 57 characters) I no longer have any memory corruption.

I tries this on both 1.2.10 and 1.3.0b2.  Any ideas?

- B

_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib



_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Memory issue reading string field?

Brian Peschel
In reply to this post by Brian Peschel
  I think I just found it.  I was loading the value into an std::string,
so the length shouldn't matter, but then loading it back to to char*
with a newline and didn't account for the newline. <sigh>

> I'm really "out", but if the "size" of the string can cause memory
> corruptions, so, maybe, the program have a "limit" to the size of the
> string, but is not checking if this limite is been observed...
>
> If the code is in C or C++, probably you are writting after the size of the
> variable.
>
> Like if I declare a variable as char name [5]
>
> And then try to put "PESCHEL" in it.
>
> If the program don't check this, you will write over memory that was not
> meant to.
>
> Well.
>
> Only an "educated guess" I think...
>
> 2010/8/19 Brian Peschel<[hidden email]>
>
>>   I have a simple DBF file I am trying to read:
>>
>> dBase Reader and Converter V. 0.8, (c) 2002 - 2003 by Bjoern Berg
>>
>> -- File statistics
>> dBase version.........:          FoxBase+/dBASE III+ (without memo)
>> Date of last update...:          1995-07-26
>> Number of records.....:          1414347 (001594cbd)
>> Length of header......:          97 (0061d)
>> Record length.........:          81 (0051d)
>> Columns in file.......:          2
>> Rows in file..........:          1414347
>>
>> +---------------+-------+---------------+---------------+---------------+
>> | field name    | type  | field adress  | length        | field dec.    |
>> +---------------+-------+---------------+---------------+---------------+
>> |           ID  |   N   |        0      |  10           |   0           |
>> |       String  |   C   |        0      |  70           |   0           |
>> +---------------+-------+---------------+---------------+---------------+
>>
>> I am seeing memory corruption in my program after reading this combo from
>> the DBF.
>>           ID:    1374067
>>       String: UNITED STATES DEPARTMENT OF THE INTERIOR PATUXENT WILDLIFE
>> RESEARCH CE
>> What makes this interesting is the string is 70 characters long (which is
>> the width of the field).
>>
>> If I change the string in the DBF to:
>>           ID:    1374067
>>       String: US DEPT OF THE INTERIOR PATUXENT WILDLIFE RESEARCH CENTER
>> (which is 57 characters) I no longer have any memory corruption.
>>
>> I tries this on both 1.2.10 and 1.3.0b2.  Any ideas?
>>
>> - B

_______________________________________________
Shapelib mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/shapelib
Loading...