Bug 1409 - [MS4W-PHP]Application error php.exe
: [MS4W-PHP]Application error php.exe
Status: RESOLVED FIXED
: MS4W
PHP
: unspecified
: PC Windows XP
: P1 critical
: ---
Assigned To:
:
:
:
:
: 1412
  Show dependency treegraph
 
Reported: 2006-04-05 15:45 by
Modified: 2006-09-01 08:29 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-04-05 15:45:11
I work with the sample_enhanced application.  I want to add a map note with the
MapNotes widget.  I click on the MapNotes tool, then I click on the map.  The
MapNotes window opens and I click the add button.  I got the following message
that pops up:

Instruction at "0x77f41f2c" uses memory address "0x01bf06a0".  Memory could not
be written.
------- Comment #1 From 2006-04-05 16:11:28 -------
i am not familiar with maptips (?).

What ms4w version are u testing with?

What chameleon version are u testing with?

Have you tried other ms4w and/or chameleon versions?

Does anyone know if this widget requires any special library?
------- Comment #2 From 2006-04-05 16:16:49 -------
i had no idea that is a "mapnotes" and a "maptips" widget.
------- Comment #3 From 2006-04-05 16:40:38 -------
Sorry I missed a lot of information.  Chameleon 2.4 beta2 and ms4w 1.5 (by the
way it not possible to select the ms4w version in bugzilla).

Have you tried other ms4w and/or chameleon versions?
I didn't try with any other combination.  I'll try.

You can reproduce the problem by the following way other than using the MapNotes
widget.

1) Select Print tools
2) click on "Printer friendly map"

------- Comment #4 From 2006-04-05 16:58:52 -------
here is what i found while testing the MapNotes widget:

ms4w 1.4.1:
  - works with ms4.6
  - with ms4.8.1 this was in the ms_errorfile:
      
      Wed Apr 05 16:50:12 2006 - msSHPOpenFile(): Unable to access file. No
(NULL) filename provided.
Wed Apr 05 16:50:12 2006 - msBuildPath: Unable to access file. 
Wed Apr 05 16:50:12 2006 - msSHPOpenFile(): Unable to access file. No (NULL)
filename provided.

ms4w 1.5.0:
   - with ms4.8.3 crashes php.exe, but same message as above in ms_errorfile

Any ideas from the Chameleon developers?

------- Comment #5 From 2006-04-05 17:08:20 -------
my testing was with Chameleon 2.2.1 and beta2
------- Comment #6 From 2006-04-07 12:01:08 -------
a mapserver bug has been filed that could be related to this:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1745
------- Comment #7 From 2006-04-13 10:44:54 -------
Based on the Julien's recommendations I installed ms4w 1.5 and Chameleon beta 2
rel. 2.4 on another Windows machine.  I got no more error.  I don't understand
why I'm getting this error on my machine???
------- Comment #8 From 2006-04-13 11:54:38 -------
Finally I got the error on the new machine that appears in the description by
playing with ExpressionBuilder widget.  I have no scenario yet to reproduce it.
 This is a problem with php.exe.

Tested with Chameleon beta 2 rel. 2-4, ms4w 1.5.1.
------- Comment #9 From 2006-04-13 14:52:23 -------
again i ask that you test with other mapserver/ms4w/chameleon versions.  From my
testing (comment#4) I found that this was introduced in MapServer 4.8.1.  

As soon as i have time i will also test without ms4w, on windows.  (unless
someone else has the time now...)
------- Comment #10 From 2006-04-20 14:55:31 -------
this is a critical bug.  can i work with a chameleon developer to find out what
is causing the problem?
------- Comment #11 From 2006-04-20 16:28:52 -------
Jeff, were ou able to reproduce it? It's the same problem as the mapserver bug:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1745

Do you use the a mapserver with the patch from 1745?
If so, we will try to reproduce with Chameleon 2.4rc1 and ms4w 1.5.1.
------- Comment #12 From 2006-04-20 19:14:17 -------
I have also run into this with MS4W 1.5.1. I received a similar error in MS4W
1.4 (on all but 1 pc), but now it ONLY occurs on the first load of the page
(subsequent zoomins or submits cause no error in Chameleon, unlike before).

As before when I had this, it happens when an ECW layer exists in the mapfile.
Take out the ECW layer and it doesn't happen anymore (ecw-file is healthy).
Strangely enough, the error is also fixed by assigning a GROUP name to the ECW
layer; without group name, the error occurs.
------- Comment #13 From 2006-04-20 19:22:45 -------
Actually, it also occurs without the ECW layer, just not on first load (only
with print production widget in Chameleon). Sounds very random....
------- Comment #14 From 2006-04-21 15:14:49 -------
re: comment #11:

yes MS4W 1.5.1 includes the patch from mapserver bug 1745, and as Jacob
mentioned the problem still exists.

------- Comment #15 From 2006-04-24 10:42:13 -------
Seems that is a php bug;
http://bugs.php.net/bug.php?id=28915
------- Comment #16 From 2006-04-24 16:40:10 -------
I made some tests again today with Chameleon 2.4 rc1 and ms4w 1.5.1 (mapscript
4.8).  I reproduced the problem with the sample_enhanced application and the
PrintProduction widget by following these steps:

1) Select Print tools
2) click on "Printer friendly map"

The PHP error occurs when the renderImage() function is reached in the
preview.php file (around line 213).  This error did not show with the same
configuration but on another Windows machine.

I then tested as suggested by  Jeff with another configuration.  I used ms4w
1.4.1 with mapscript 4.6 and 4.8 with Chameleon 2.4 rc1.  The error did not pop
up with neither of the mapscript version by following the previous steps.  All
this test were executed on my Dell machine.
------- Comment #17 From 2006-04-24 16:44:20 -------
i was testing the "Map notes" widget, as this bug was filed for that widget. 
Can you please also report on that?  (see my comment #4 for my results)
------- Comment #18 From 2006-04-24 17:07:44 -------
skynewbie: that bug does not list any reasons for the crash, and it was
"suspended" by the PHP team.  Can you provide any more details?
------- Comment #20 From 2006-04-26 10:48:13 -------
re: comment #17

The php error did not show up with MapNotes since I fixed the problem in bug
1406 (add trim() function when extracting font name) .  The php error pops up
with the PrintProduction widget on my computer.
------- Comment #21 From 2006-04-26 10:52:10 -------
I'm working to build a minimal test case with the PrintProduction widget to
reproduce the problem on Windows. 
------- Comment #22 From 2006-04-26 10:56:37 -------
confusing.  even though this bug is about mapnotes, another mapnotes bug was
filed, fixed, and now this bug remains open and is actually regarding print
production? 
------- Comment #23 From 2006-04-26 17:07:04 -------
Re:  comment 22:

I understand that it is a bit confusing but at the beginning I was able to
reproduce the problem with the MapNotes widget then with the PrintProduction
widget.  So I thought it was a more general problem.  This bug becomes the
document to record all cases where the php.exe error occurs.

When I applied a fix to bug 1406 at the same time the php.exe error disappeared.
 I think the description in the summary was misleading so I modified it to
remove the reference to the MapNotes widget.

I hope I clarify a bit the situation if not don't hesitate to contact me.
------- Comment #24 From 2006-04-26 17:20:56 -------
I was able to make the php.exe error pops up with a small script and a specific
map file.  I joined the map file and the script I used below.  I suggest that
the persons who find a similar problem try the script and reports back if the
error shows up.

----------------------
Map file:
#
# Start of map file
#
# Sample map file for a chameleon app.
#
FONTSET ../etc/fonts.txt

END # Map File
--------------------------------
PHP script:

<?php

dl("php_mapscript_48");



$o_map = ms_newMapObj("E:/ms4w/apps/chameleon/samples/map/chameleon.map");


$o_anno_layer = ms_newLayerObj($o_map);


$o_anno_layer->set("name", "DMSG_annotation_layer");




?>
------- Comment #25 From 2006-04-26 17:40:53 -------
About comment #24:

I tested with ms4w 1.5.1, Windows XP service pack 1 version 2002.
------- Comment #26 From 2006-04-26 18:46:01 -------
thanks for your hard work Norm.

I have been testing lots of different configurations and cannot find the exact
source of the error.  (i cannot throw the error with your test however)

But it must be something to do with how I build php_mapscript with the buildkit.
 I'm sorry to cause everyone this much grief.

I'll continue tomorrow.
------- Comment #27 From 2006-04-27 10:18:31 -------
I tested the script in comment #24 on my machine and had no errors.
I am running windows server 2003 service pack 1
with MS4W 1.5.0, chameleon 2.4 beta 2 with mapserver 4.8.3.
I get the error in question in my print production widget.
------- Comment #28 From 2006-04-28 18:07:53 -------
ok some news on this.  With Assefa's help we think we have this php.exe crash
narrowed down a bit.  I'll try to explain, as I see it.

Chameleon, MapLab, ka-Map all use php_gd2.dll, and this is conflicting with
php_mapscript's dynamic gd, which is causing a crash (printproduction in
chameleon calls php_gd for example).  Building gd statically seems to fix this,
on my machine, but we need more people to test.

The following patch should be used with caution.  It should not be distributed,
or used in any production environments.  It will upgrade your php_mapscript to
4.9, and includes several dependencies.  Only use this in a test ms4w 1.5.1
environment - you will no longer be able to use php_mapscript_48.dll for
example.  So please download and extract the patch, test, and report back (and
then go back to using your stable ms4w 1.5.1).  Here are the steps:

- make a copy of your existing ms4w

- download http://www2.dmsolutions.ca/netbin/ms4w_1.5.2-dev_patch.zip

- extract that to the same ms4w 1.5.1 root (and overwrite the files)

- modify your chameleon (or maplab, ka-map) config to use php_mapscript_49.dll

- restart apache

- test your application (i test with the printproduction widget in chameleon,
for example)

- revert back to your old ms4w


We'll also test more, and hopefully have a solution early next week.
------- Comment #29 From 2006-04-29 07:20:23 -------
Hi Jeff,

I tested, first with my current MS4W, crash appears. Then with the patch and the
crash has disappeared. Well done.

One concern, is this gonna be backported to Howard's buildkit so that people who
make their own binaries won't run into it?

Bart
------- Comment #30 From 2006-04-29 07:54:32 -------
Hi bart,

Glad to hear it also worked for you.  Assefa and I talked to Howard yesterday,
and yes this will be ported to the buildkit.  He said that he might wait for the
gdal release for this next buldkit version (but that is supposed to be any day).
 We are waiting on the results of this testing of course.

jeff
------- Comment #31 From 2006-05-01 09:16:53 -------
I tested on my machine and I got a PHP script interpreter error (see below).  I
installed ms4w 1.5.1 then I extracted ms4w 1.5.2.  Finally I unzipped Chameleon
rc 1.

As soon as I start the sample_enhanced application I got this error.  I will
test on the other Windows box.

-------------------------
PHP error:

AppName: php.exe AppVer: 4.4.3.3 ModName:  php4ts.dll ModVer:  4.4.3.3
------- Comment #32 From 2006-05-01 09:23:32 -------
Please ignore comment #31.  It was my mistake I missed a step.  I forgot to
change the mapscript version in Chameleon configuration file.

I tested the PrintProduction widget and the error didn't appear.  I think you
found the problem.  Congratulations.
------- Comment #33 From 2006-05-01 15:13:48 -------
I've followed the instructions of Jeff McKenna  then
I've tested the PrintProduction widget and the error is disappeared.

Thank you 
skynewbie
------- Comment #34 From 2006-05-04 19:51:09 -------
a new ms4w is now available (downloadable 1 hour from now), version 1.5.2, which
contains this gd-static fix. 
------- Comment #35 From 2006-08-25 06:56:42 -------
I am getting this same crash now using MS4W 1.5.5 ...... using the MapNotes
widget in Chameleon.
------- Comment #36 From 2006-08-29 16:58:25 -------
I just tested with a fresh ms4w 1.5.5 (php_mapscript 4.8.4) and chameleon 2.4
and had no problem adding a map note.

Is it possible you are using php_mapscript 4.9 ?
------- Comment #37 From 2006-08-30 01:50:02 -------
Hey Jeff,

no I use MS4W 1.5.5 out of the box, no Mapscript 4.9.

Bill had the same error on his machine.

Bart
------- Comment #38 From 2006-08-30 13:56:18 -------
I have tracked down the error coming from symbol.php, which uses interaction
between Mapscript and GD.

This call causes the error on my pc:

http://localhost/chameleon//common/picker/symbol.php?sid=44f5c7560188b&width=30&height=20&nSymbolName=circle
------- Comment #39 From 2006-08-30 14:02:58 -------
The call in symbol.php which causes the php.exe error is:

    //create the preview image
    $oImage = $oMap->prepareimage();
------- Comment #40 From 2006-08-30 14:22:22 -------
Jeff, I retested again with your old patch (ms4w_1.5.2-dev_patch.zip), and it
solves the problem.

So there must a problem with GD linking again I guess ....
------- Comment #41 From 2006-08-31 22:46:06 -------
ok here is a patch to test with ms4w 1.5.5.  This will upgrade your mapserver to
4.10.0-beta2 as well.  I've tested it successfully with Chameleon's MapNotes and
PrintProduction widgets.  Please let me know as soon as possible the results for
your testing:

(you might want to backup your existing ms4w beforehand)

- download http://www2.dmsolutions.ca/netbin/ms4w_1.5.5-upgrade.zip

- extract that to the same ms4w 1.5.5 root (and overwrite the files)

- modify your chameleon (or maplab, ka-map) config to use php_mapscript_4.10.0.dll

- restart apache

- test your application (MapNotes, PrintProduction, ...) and report back here



If successful we can release this as an ms4w addon package to upgrade to
4.10.0-beta2.
------- Comment #42 From 2006-09-01 03:03:12 -------
Jeff,

it solves the issue.

Btw, please note you are using a new convention for the Mapscript dll's.

php_mapscript_4.10.0.dll

versus

php_mapscript_48.dll

Thanks!

Bart
------- Comment #43 From 2006-09-01 08:29:31 -------
Great thanks Bart (and thanks to Assefa for helping me fix this).

Yes the naming convention will be changing with this release. (note again that
for now it will be a 1.5.5 addon package)