#54 wrong bash version not handled properly

closed-fixed
nobody
None
5
2002-05-05
2002-03-29
Anonymous
No

I started the op_start script (on my athlon) with the
following command line (as the docs say):

op_start --vmlinux=/usr/src/linux/vmlinux
--map-file=/usr/src/linux/System.map
--ctr0-event=RETIRED_INSNS --ctr0-count=300000

And I got the following output from it:

/usr/local/bin/op_start: 4: No such file or directory
/usr/local/bin/op_start: 0: command not found
/usr/local/bin/op_start: 0: No such file or directory
/usr/local/bin/op_start: CTR_EVENT[0]=RETIRED_INSNS: command
not found
/usr/local/bin/op_start: 0: command not found
/usr/local/bin/op_start: 0: No such file or directory
/usr/local/bin/op_start: CTR_COUNT[0]=300000: command not
found
/usr/local/bin/op_start: 4: No such file or directory
/usr/local/bin/op_start: [: ==: binary operator expected
/usr/local/bin/op_start: [: ==: binary operator expected
Parameters used:
/usr/local/bin/op_start: [: ==: binary operator expected
CPUTYPE 3
/usr/local/bin/op_start: [: ==: binary operator expected
HASH_SIZE default value
/usr/local/bin/op_start: [: ==: binary operator expected
BUF_SIZE default value
/usr/local/bin/op_start: [: ==: binary operator expected
NOTE_SIZE default value
/usr/local/bin/op_start: 4: No such file or directory
/usr/local/bin/op_start: [: ==: binary operator expected
IGNORE_MYSELF 0
/usr/local/bin/op_start: [: ==: binary operator expected
DIR /var/opd
/usr/local/bin/op_start: [: ==: binary operator expected
LOG_FILE /var/opd/oprofiled.log
/usr/local/bin/op_start: [: ==: binary operator expected
SAMPLES_DIR /var/opd/samples/
/usr/local/bin/op_start: [: ==: binary operator expected
SEPARATE_SAMPLES 0
/usr/local/bin/op_start: [: ==: binary operator expected
DEVICE_FILE /var/opd/opdev
/usr/local/bin/op_start: [: ==: binary operator expected
NOTE_DEVICE_FILE /var/opd/opnotedev
/usr/local/bin/op_start: [: ==: binary operator expected
HASH_MAP_DEVICE_FILE /var/opd/ophashmapdev
/usr/local/bin/op_start: [: ==: binary operator expected
MAP_FILE /usr/src/linux/System.map
/usr/local/bin/op_start: [: ==: binary operator expected
VMLINUX /usr/src/linux/vmlinux
/usr/local/bin/op_start: [: ==: binary operator expected
Removing /var/opd/opdev
/usr/local/bin/op_start: [: ==: binary operator expected
Removing /var/opd/opnotedev
/usr/local/bin/op_start: [: ==: binary operator expected
Removing /var/opd/ophashmapdev
/usr/local/bin/op_start: [: ==: binary operator expected
Doing mknod /var/opd/opdev
/usr/local/bin/op_start: [: ==: binary operator expected
Doing mknod /var/opd/opnotedev
/usr/local/bin/op_start: [: ==: binary operator expected
Doing mknod /var/opd/ophashmapdev
/usr/local/bin/op_start: 4: No such file or directory
/usr/local/bin/op_start: 4: No such file or directory
/usr/local/bin/op_start: [: ==: binary operator expected
cpu speed (estimation) : 1545.984
/usr/local/bin/op_start: [: ==: binary operator expected
executing oprofiled --ignore-myself=0
--log-file=/var/opd/oprofiled.log --base-dir=/var/opd
--samples-dir=/var/opd/samples/ --device-file=/var/opd/opdev
--note-device-file=/var/opd/opnotedev
--hash-map-device-file=/var/opd/ophashmapdev
--vmlinux=/usr/src/linux/vmlinux
--map-file=/usr/src/linux/System.map --separate-samples=0
--cpu-speed=1545.984
Failed to open device. Possibly you have passed incorrect
parameters. Check /var/log/messages.Couldn't start
oprofiled.
Check the log file "/var/opd/oprofiled.log" and
/var/log/messages

Discussion

  • Logged In: NO

    I had the same problem, and it turned out that my bash was too old and did not
    support c-syntax scripts. I replaced the #!/bin/bash at the head of the
    script with #!/bin/bash2 and the c-syntax parts of the scripts were happy.

     
  • John Levon
    John Levon
    2002-04-03

    Logged In: YES
    user_id=53034

    Thanks, 2nd reporter. Can both of you try the untested
    patch I'm about to attach ?

     
  • John Levon
    John Levon
    2002-04-03

    • summary: lots of errors in the op_start script --> wrong bash version not handled properly
     
  • John Levon
    John Levon
    2002-04-03

    Patch that might fix this bug

     
    Attachments
  • John Levon
    John Levon
    2002-04-06

    • status: open --> open-fixed
     
  • John Levon
    John Levon
    2002-04-06

    Logged In: YES
    user_id=53034

    There is now a proper fix + doc fix in CVS version.

     
  • John Levon
    John Levon
    2002-05-05

    • status: open-fixed --> closed-fixed