[Mapserver-users] IMPORTANT geotiff/tiff bug mapserver

Sébastien DUBOIS sebastien.dubois at esm2.imt-mrs.fr
Wed May 26 04:26:04 EDT 2004


Frank,
well i hope you recognize me ;-)
lets see last post below.

you probably don't have the time to answer me the last time but it's not a
problem.

i've done a lot of experiments yet that would interest all the MAPSERVER LIST

i've write a script to see the calls of mapserver
(i've moved mapserv to mapserv.bin and then write my script mapserv to trace in
a .log all what happens)

my conclusions to sum up
there's a native bug (segmentation fault)
when mapserv start to read tiff or geotiff (i've got the two examples)
something i didn't know before is that mapserv search for .tfw or wld natively
it's cool.

---------------.log----------------------

open("/var/www/html/workshop/data/../last/gr_20k_montelimar_v1.tif", O_RDONLY)
=
3
fstat64(3, {st_mode=S_IFREG|0444, st_size=3520136, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40015000
read(3, "MM\0*\0005\254\250\302\232\3i\364i\250\201\232\370\232"..., 4096) =
4096
close(3)                                = 0
munmap(0x40015000, 4096)                = 0
stat64("/var/www/html/workshop/data/../last/gr_20k_montelimar_v1.tif",
{st_mode=S_IFREG|0444, st_size=3520136,
 ...}) = 0
open("/var/www/html/workshop/data/../last/gr_20k_montelimar_v1.tif", O_RDONLY)
=
3
fstat64(3, {st_mode=S_IFREG|0444, st_size=3520136, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x40015000
read(3, "MM\0*\0005\254\250\302\232\3i\364i\250\201\232\370\232"..., 4096) =
4096
_llseek(3, 0, [0], SEEK_SET)            = 0
open("/var/www/html/workshop/data/../last/gr_20k_montelimar_v1.tif", O_RDONLY)
=
4
read(4, "MM\0*\0005\254\250", 8)        = 8
lseek(4, 3517608, SEEK_SET)             = 3517608
read(4, "\0\24", 2)                     = 2
read(4, "\0\376\0\4\0\0\0\1\0\0\0\0\1\0\0\3\0\0\0\1\23K\0\0\1\1"..., 240) = 240
read(4, "\0\0\0\0", 4)                  = 4
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
[root at sx-dubois osdy8515]# grep tiff  /tmp/mapserv.log 
open("/usr/lib/libtiff.so.3", O_RDONLY) = 3


(with geotiff in this .log)




i used tiff2png ans with .png no segmentation fault yet.


-----------------.log--------------------
stat64("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png",
{st_mode=S_IFREG|0644, st_size=1906690, 
...}) = 0
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png", O_RDONLY) =
3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1906690, ...}) = 0
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png/hdr.adf",
O_RDONLY) = -1 ENOTDIR (Not a dire
ctory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png/HDR.ADF",
O_RDONLY) = -1 ENOTDIR (Not a dire
ctory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png", O_RDONLY) =
4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1906690, ...}) = 0
stat64("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png.ovr",
0xbfffae50) = -1 ENOENT (No such fil
e or directory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.wld", O_RDONLY) =
-1 ENOENT (No such file or dir
ectory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.WLD", O_RDONLY) =
-1 ENOENT (No such file or dir
ectory)

open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.tfw", O_RDONLY) =
4
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.tfw", O_RDONLY) =
4
fstat64(4, {st_mode=S_IFREG|0777, st_size=222, ...}) = 0
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.tifw", O_RDONLY)
=
-1 ENOENT (No such file or di
rectory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.TIFW", O_RDONLY)
=
-1 ENOENT (No such file or di
rectory)
open("26-20k/gr_20k_montelimar_v1.wld", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("26-20k/gr_20k_montelimar_v1.WLD", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.wld", O_RDONLY) =
-1 ENOENT (No such file or dir
ectory)
open("/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.WLD", O_RDONLY) =
-1 ENOENT (No such file or dir
ectory)
open("/var/www/html/workshop/data/Clients.shp", O_RDONLY) = 3
open("/var/www/html/workshop/data/Clients.shx", O_RDONLY) = 4
fstat64(3, {st_mode=S_IFREG|0777, st_size=2872, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0777, st_size=892, ...}) = 0
open("/var/www/html/workshop/data/Clients.dbf", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0777, st_size=74901, ...}) = 0
open("/var/www/html/tmp/MONTELIMAR10855035467647.png",
O_WRONLY|O_CREAT|O_TRUNC,
0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("/var/www/html/tmp/MONTELIMARleg10855035467647.png",
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("/var/www/html/tmp/MONTELIMARsb10855035467647.png",
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("/var/www/html/workshop/data/png/gr_20k_montelimar_v1.png", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0777, st_size=14325, ...}) = 0
open("/var/www/html/tmp/MONTELIMARref10855035467647.png",
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat64(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
open("/var/www/html/workshop/montelimar_basic.html", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0777, st_size=2992, ...}) = 0




but there's still no display in my web page :-(
(see http://www.esm2.imt-mrs.fr/~sdubois/sig/sig.html to see all my files)



with these new information i conclude that i'll remove the mapserv installed
with urmpi (mandrake package) and build it by hands ...

but there's really a problem with geotiff.tiff reading

on old post i could read to build --without tiff mapserv.
are you agree with this???


thanks in advance

-- 
Sébastien DUBOIS
Ecole Généraliste d'Ingénieurs de Marseille (ex ESM2)

1024D/A1140BCB 
Empreinte de la clé = 1BC8 7E21 4DA7 13D5 1B5F  876F F719 2B7A A114 0BCB
disponible sur www.keyserver.net

                       _____________
                       |LAST POSTS |:
                       |___________|

Thanks so much for your last answer.
It gives me energy to succeed ;-)

Well i've done all what you explain me.
In fact in my .map when i put as a layer a .tif there's an error
-----------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.

Please contact the server administrator, root at localhost and inform them of the
time the error occurred, and anything you might have done that may have caused
the error.

More information about this error may be available in the server error log.

Apache-AdvancedExtranetServer/1.3.28 Server at sx-dubois.rd.francetelecom.fr
Port 80
----------------
In command line in this case

[root at sx-dubois cgi-bin]# ./shp2img -m /var/www/html/workshop/montelimar.map -o
out.png
Segmentation fault

perhaps my .tif is too heavy ? (3 Mo ...)
Other reason tif and not tiff but but renaming my file in .tiff it's the same.


So with gimp a "save as" my .tif in .png (less heavy) but this raster is not
displayed too
(BUT no error anymore)

In command line
[root at sx-dubois cgi-bin]# ./shp2img -m /var/www/html/workshop/montelimar.map -o
out.png
GDAL: GDALOpen(/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png)
succeeds as PNG.

GDAL: GDALClose(/var/www/html/workshop/data/26-20k/gr_20k_montelimar_v1.png)

GDAL: GDALDeregister_GTiff() called.

I really don't understand why my .tif is not good.

As you asked me, you will be able to find all the useful files on my html page
http://www.esm2.imt-mrs.fr/~sdubois
under FILE SIG

or directly http://www.esm2.imt-mrs.fr/~sdubois/sig/sig.html

I will explain you more how is build my test.
in fact i've modify the tutorial itasca
so my mapfile is montelimar.map
my index still index.html
and my basic page montelimar_basic.html
in my mapfile there are two layers: the first must be my raster
(gr_20k_montelimar_v1.tif) and the second one is my shape file Clients .shp
(there's no problem for the shape file to be displayed.)
(i haven't put on the web site .dbf....)

i work under mandrake 9.2
and
MapServer version 4.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ
SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT
INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

I don't have "world file" but you will see and my html site a .text, .tab and
.tfw related with my .tif

What i've noted is that mapserv generate .jpeg ok (MONTELIMARxxxxxxxxxxxxx.jpg)
but this generated file from my .png are without the layer raster.

thanks in advance



Sébastien

ps: my cgi and mapser server is under a proxy and firewall so no access
possible
directly...

Sébastien DUBOIS wrote:
> First sorry to "spam" you
> I really need to debug my mapserver application but i haven't found any good
> help on forum or mailing list.
> My problem is on displaying a raster .tif as a "background" on my mapserver
> application. (shape points are displayed ok at this time)
> I've used as an example the very good tutorial itasca and your "how to
raster"
> without results.
>
> In fact my .shp (layer) is very well displayed and zoom , pan ... works on it
> My reference works too
> But my layer RASTER isn't displayed!!!
> I've test a lot of differents implementations without sucess....
> LAYER
>   NAME "montelimar"
>   DATA "data/gr_20k_montelimar_v1.png"
>   TYPE RASTER
>   STATUS ON
> END

Sébastien,

First, for testing leave the STATUS at DEFAULT.  I see you do in some of
your tests.

Second, you need to verify that the raster file is being correctly found.
I would suggest you use an absolute path for now so we can rule out path
issues.

Third, we need to verify that the georeferencing of the raster file is what
you expect.  I would normally use the "gdalinfo" utility to report on the
contents of the file.  Do you have that utility?  It is part of a full GDAL
install.  If not, perhaps you could make the file (in TIFF format) available
somewhere so I can download and inspect it.  Does it have a world file (.wld)?

If none of the above seem to help, the next thing to do is to start collecting
debugging information to find out what MapServer is doing.

  1) Set "DEFAULT ON" in the MAP object and the raster LAYER object.

  2) Review debug info in the Apache log file.

  3) Try running the mapfile from the commandline using "shp2img -m <mapfile>
-o
out.png".
     Sometimes it is easier to review debugging info this way.

  4) Set the CPL_DEBUG environment variable to "ON" before running shp2img to
     get some GDAL level debug info.

If the above steps don't seem to help, send a copy of your testing map file,
all the debug output from shp2img and all the details you can provide about the
raster file (gdalinfo output, world file, etc)to me and I'll see what I can
figure out.

By then I will have lost this most recent email of yours, so please include
all details you think I will need.  As you might imagine, I get a quite a few
requests similar to yours and it is hard to keep track of them.

Also, once you succeed consider improving the Wiki debugging topic a bit from
what you learn.

Best regards,
Frank Warmerdam


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the mapserver-users mailing list