2009-06-06

cygwin+imagemagick+emacsW32 causes Vista to report error

got a very odd problem that's driving me nuts.

in cygwin prompt, i can call one of imagemagick's command and get result.

However, while in emacsw32 shell, identical call results Windows Vista poppig up a window telling me some app crashed.

Anyone got some idea what's wrong?

-----------------------------------
here's more precise detail.

Here's how i call a program in cygwin terminal:

xah@xah-PC ~/web/dinju/i
$ convert Bazaar_zanjan.jpg Bazaar_zanjan.png

the above converts a jpg image to png, successfully.

Here's how i call it in emacsW32. In dired, cd to the dir, then Alt+x shell, then “convert Bazaar_zanjan.jpg Bazaar_zanjan.png”.
Then, Windows pops up dialog about “convert.exe has stopped working” with the following error:

Problem signature:
Problem Event Name: APPCRASH
Application Name: convert.exe
Application Version: 0.0.0.0
Application Timestamp: 4807a468
Fault Module Name: cygX11-6.dll
Fault Module Version: 6.0.6001.18000
Fault Module Timestamp: 4791a783
Exception Code: c0000135
Exception Offset: 0006ecfb
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 1033
Additional Information 1: 9d13
Additional Information 2: 1abee00edb3fc1158f9ad6f44f0f6be8
Additional Information 3: 9d13
Additional Information 4: 1abee00edb3fc1158f9ad6f44f0f6be8

this popup repeats 6 times.

Same thing happens if you simply call “identify” without running any arguments, with about the exact same error message. e.g.

Problem signature:
Problem Event Name: APPCRASH
Application Name: identify.exe
Application Version: 0.0.0.0
Application Timestamp: 4807a46a
Fault Module Name: cygX11-6.dll
Fault Module Version: 6.0.6001.18000
Fault Module Timestamp: 4791a783
Exception Code: c0000135
Exception Offset: 0006ecfb
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 1033
Additional Information 1: 9d13
Additional Information 2: 1abee00edb3fc1158f9ad6f44f0f6be8
Additional Information 3: 9d13
Additional Information 4: 1abee00edb3fc1158f9ad6f44f0f6be8

“identify” is another command in imagemagick, it works fine if called in cygwin terminal. Here's the log:

xah@xah-PC ~/web/dinju/i
$ identify Bazaar_zanjan.jpg
Bazaar_zanjan.jpg JPEG 450x445 450x445+0+0 DirectClass 8-bit 65.793kb

------------

Cygwin has been re-installed many times in the past 2 weeks. I was able to run imagemagick commands within emacsW32 before without a problem. The problem happened with my last reinstall of cygwin.

the odd thing is that it runs fine within cygwin terminal. I thought maybe i'm missing some component in cygwin, but don't know which X11 related package corresponds to cygX11-6.dll. I thought maybe i had some bad path setup in emacsW32, but went thru all my emacs init files couldn't identify it. Same problem happens if i run emacs with -q, then manually set-variable w32shell-cygwin-bin to “"C:\\cygwin\\bin"” and w32shell-shell to “cygwin”, then run my command.

any suggestions?

Thanks.

Xah
∑ http://xahlee.org/



---------------------------------

On Jun 7, 2:13 am, Lennart Borgman wrote:
> On Sun, Jun 7, 2009 at 2:21 AM, Xah Lee wrote:
> > got a very odd problem that's driving me nuts.
>
> > in cygwin prompt, i can call one of imagemagick's command and get
> > result.
>
> > However, while in emacsw32 shell, identical call results Windows Vista
> > poppig up a window telling me some app crashed.
>
> > Anyone got some idea what's wrong?
>
> Different paths. At the cygwin prompt you have imagemagick's
> convert.exe first in path.
>
> At a cmd prompt you by default have windows convert.exe in the path.
> (There is a which utility you can get from gnuwin32.)
>
> So I do not think this is related to EmacsW32. If it is then please
> give me more information.

Hi Len,

Thanks! You solved my problem.

I'm aware of Window's convert.exe ... my path problem is a bit subtle... but from youp reply, i compared my $PATH in cygwin terminal and $PATH in emacsW32's cygwin-shell, seeing that they are different, then i set emacsW32's cygwin-shell's $PATH to the same as the $PATH shown in cygwin terminal, then the problem is solved.

For the record, here's the value of $PATH in cygwin terminal (reformatted for readibility):

/usr/local/bin
/usr/bin
/bin
/usr/X11R6/bin
/cygdrive/c/Windows/system32
/cygdrive/c/Windows
/cygdrive/c/Windows/System32/Wbem
/cygdrive/c/hp/bin/Python
/cygdrive/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static
/cygdrive/c/Program Files (x86)/QuickTime/QTSystem/

Here's the value of $PATH in emacsW32 cygwin-shell:

/usr/bin
/cygdrive/c/Program Files (x86)/Emacs/emacs/bin/
/cygdrive/c/Program Files/Microsoft IntelliType Pro/
/cygdrive/c/Windows/system32
/cygdrive/c/Windows
/cygdrive/c/Windows/System32/Wbem
/cygdrive/c/hp/bin/Python
/cygdrive/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static
/cygdrive/c/Program Files (x86)/QuickTime/QTSystem/

The interesting thing is that imagemagick's convert is in /usr/bin, so, while in emacsW32's cygwin-shell, i can do “which convert” and it reports the right program. So, apparantly, subsequent paths much have fucked things up. This probably also mean that /usr/bin/convert relies on other pieces to work. (same goes for imagemagick's “identify” command.)

Thanks again Lennart. I owe you one.

Xah
∑ http://xahlee.org/

No comments:

Post a Comment