Web lists-archives.com

Bash seg faulting?

Here is some more information

The sequence:

Andy@Andy-Work ~
$ export OFFICE_BIN="C:\Program Files (x86)\Microsoft Office\root\Office16"
$ strace "$OFFICE_BIN"/Wordconv.exe -oice -nme "Post-Install.doc" "Post-Install.docx" >strace.out
Segmentation fault 
$ echo $?

Produces the attached strace.  Notice the last lines

--- Process 5628, exception c0000005 at 000000006fdca6fd
--- Process 5628 exited with status 0xc0000005  // This is windows code for access violation

So teh seg fault comes from the Wordconv.exe process when it is exiting,  but why?  This doesn't happen if I do this in

$ cmd
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\cygwin64\home\Andy\ConvWord>"%OFFICE_BIN%\Wordconv.exe" -oice -nme "Post-Install.doc" "Post-Install.docx"
"%OFFICE_BIN%\Wordconv.exe" -oice -nme "Post-Install.doc" "Post-Install.docx"

Somebody with deeper knowledge of cygwin internals will have to track this down.


Here is a strange one.   I have two scripts, conv.sh and conv.bat that do the same thing: scan the current directory for
.doc files and convert them to .docx files.  Here are the two scripts.

$ cat conv.sh

OFFICE_BIN="C:\Program Files (x86)\Microsoft Office\root\Office16"

for doc in *.doc; do
        echo "converting: $doc"
        "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"

$cat conv.bat
@echo off
set OFFICE_BIN=C:\Program Files (x86)\Microsoft Office\root\Office16

for %%a in ("*.doc") do (
        rem This is necessary because *.doc can match *.docx! Need to check the actual extension.
        if "%%~xa" == ".doc" (
                echo "converting: %%a"
                "%OFFICE_BIN%\Wordconv.exe" -oice -nme "%%a" "%%ax"a

When conv.sh is run on a directory containing three .doc files, the conversions work but I get three seg faults at three
different locations.  E.g.

$ conv.sh
converting: Post-Install.doc
./conv.sh: line 5:  6060 Segmentation fault      "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"
converting: Post-InstallB.doc
./conv.sh: line 5: 13264 Segmentation fault      "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"
converting: Post-InstallTest.doc
./conv.sh: line 5: 13260 Segmentation fault      "$OFFICE_BIN"/Wordconv.exe -oice -nme "$doc" "${doc}x"

When conv.bat is run in the same directory, the conversions work and I don't get any seg faults (or they are not being
reported!)  E.g. 
$ conv.bat
"converting: Post-Install.doc"
"converting: Post-InstallB.doc"
"converting: Post-InstallTest.doc"

Now Wordconf.exe is a 32-bit executable running on a Windows 10 Pro 64-bit installation.

My cygcheck.out is attached.  I guess I can get an strace if need.


Attachment: cygcheck.out
Description: Binary data

Attachment: strace.out
Description: Binary data

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple