Web lists-archives.com

Bash seg faulting?




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

Attachment: cygcheck.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