Bash seg faulting?

Andy Hall fixpertise-consulting@comcast.net
Fri Jun 2 21:57:00 GMT 2017


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 $?
139

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.

$ 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.

Andy


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
#!/bin/bash

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"
done

$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.


Andy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 22508 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170602/f5b4a527/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strace.out
Type: application/octet-stream
Size: 9557 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170602/f5b4a527/attachment-0001.obj>
-------------- next part --------------

--
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


More information about the Cygwin mailing list