Skip to main content
Apr 7, 2017 4:04 PM UTC

Bash gets S0C4 when executing a 'set' command when .bashrc is present

I’m getting a S0C4 when I invoke the ‘set’ command after invoking ‘bash’ with a .bashrc file present. The .bashrc file creates 4 aliases and sets and exports the PS1 environment variable.

If I remove the file, the S0C4 does not occur.
If I comment out (#) all the lines in .bashrc, the S0C4 does not occur.
If I uncomment any one line, doesn’t seem to matter which, the S0C4 occurs.

If I rename the .bashrc file to .bashrcx then invoke bash and enter ‘. ./.bashrcx’, all of the aliases and the PS1 variable get set. Then when I issue the ‘set’ command, I do not get a S0C4.

There clearly seems to be an issue with using a .bashrc file at the invocation of bash.

The .bashrc file is encoded IBM-1047. I’m trying to create an ISO-8859-1 version of the file to see if the issue still exists.

Any thoughts appreciated.

    22 replies

    Tatiana Balaburkina
    Rocketeer
    May 2, 2017 8:39 AM UTC

    I’m getting a S0C4 when I invoke the ‘set’ command after invoking ‘bash’ with a .bashrc file present. The .bashrc file creates 4 aliases and sets and exports the PS1 environment variable.

    If I remove the file, the S0C4 does not occur.
    If I comment out (#) all the lines in .bashrc, the S0C4 does not occur.
    If I uncomment any one line, doesn’t seem to matter which, the S0C4 occurs.

    If I rename the .bashrc file to .bashrcx then invoke bash and enter ‘. ./.bashrcx’, all of the aliases and the PS1 variable get set. Then when I issue the ‘set’ command, I do not get a S0C4.

    There clearly seems to be an issue with using a .bashrc file at the invocation of bash.

    The .bashrc file is encoded IBM-1047. I’m trying to create an ISO-8859-1 version of the file to see if the issue still exists.

    Any thoughts appreciated.

    Hi Clay,

    New bash is available (bash-4.3_b017.170426.tar.gz). Could you try it?

    May 11, 2017 10:15 AM UTC

    Hi Clay,

    New bash is available (bash-4.3_b017.170426.tar.gz). Could you try it?

    Thanks. I’ll have them download and install the new version and let you know if it resolves the issue.

    May 11, 2017 3:37 PM UTC

    Thanks. I’ll have them download and install the new version and let you know if it resolves the issue.

    No change in the results.   As you can see, I have a .bashrc script that basically sets aliases. The 'ls' command works fine but the 'set' command abends.
    
    $ ls
        total 264
        drwxr-xr-x               8 DEVCGC   DEV         8192 May 11 15:28 ./
        dr-xr-xr-x             143 LSCSTC   DAEQ           0 May 11 15:26 ../
        -rw-------  --s- ----    1 DEVCGC   DEV         7817 May 11 15:28 .bash_history
        -rwxr--r--  --s- ----    1 DEVCGC   DEV          144 May 11 15:27 .bashrc*
        -rw-rw-r--  --s- nl      1 DEVCGC   DEV          124 Apr  7 14:46 .bashrc_ebc
        -rwxr--r--  --s- nl      1 DEVCGC   DEV          144 Apr 21 07:20 .bashrcx*
        -rw-rw-r--  --s- ----    1 DEVCGC   DEV           83 Feb 13 16:48 .gitconfig
        -rw-rw-r--  --s- nl      1 DEVCGC   DEV         1125 Apr  7 14:43 .profile
        -rw-------  --s- ----    1 DEVCGC   DEV         1893 May 11 15:28 .sh_history
        drwx------               2 DEVCGC   DEV         8192 Feb 22 11:15 .ssh/
        drwxrwxr-x               2 DEVCGC   DEV         8192 Apr 17 15:41 bin/
        drwxrwxr-x               6 DEVCGC   DEV         8192 Apr 11 16:54 repos/
        drwxr-x---               8 DEVCGC   DEV         8192 Apr 19  2016 rocket/
        drwxrwxr-x               3 DEVCGC   DEV        16384 Apr  3 16:59 target/
        drwxrwxr-x               2 DEVCGC   DEV         8192 Feb 21 12:04 temp/
        -rwx------  --s- nl      1 DEVCGC   DEV           56 Feb  8 16:33 test_rexx*
        $ set
        CEE3204S The system detected a protection exception (System Completion Code=0C4).
                 From entry point print_assignment at compile unit offset +000000EC at entry offset +000000EC at address
                 2483C9BC.
        [1] + Done(139) ?
          50463820      Segmentation violation  /V2R1/usr/lpp/ported/rocket/bash-4.3_b017.170426/bin/bash
    $ bash -version
        bash -version
        GNU bash, version 4.3.46(51)-release (i370-ibm-openedition)
        Copyright (C) 2013 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    
        This is free software; you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.
    Tatiana Balaburkina
    Rocketeer
    May 16, 2017 10:37 AM UTC

    I’m getting a S0C4 when I invoke the ‘set’ command after invoking ‘bash’ with a .bashrc file present. The .bashrc file creates 4 aliases and sets and exports the PS1 environment variable.

    If I remove the file, the S0C4 does not occur.
    If I comment out (#) all the lines in .bashrc, the S0C4 does not occur.
    If I uncomment any one line, doesn’t seem to matter which, the S0C4 occurs.

    If I rename the .bashrc file to .bashrcx then invoke bash and enter ‘. ./.bashrcx’, all of the aliases and the PS1 variable get set. Then when I issue the ‘set’ command, I do not get a S0C4.

    There clearly seems to be an issue with using a .bashrc file at the invocation of bash.

    The .bashrc file is encoded IBM-1047. I’m trying to create an ISO-8859-1 version of the file to see if the issue still exists.

    Any thoughts appreciated.

    Hi Clay,
    Could you provide full dump, please?
    Which protocol do you use for access?
    You use /etc/profile for export environments, ~/.profile for starting bash and try to use .bashrc for aliases, sets and exports, don’t you?

    I could not get it to display its startup messages correctly when set as my default shell.
    What do you mean? How did you set default shell?

    May 16, 2017 2:51 PM UTC

    Hi Clay,
    Could you provide full dump, please?
    Which protocol do you use for access?
    You use /etc/profile for export environments, ~/.profile for starting bash and try to use .bashrc for aliases, sets and exports, don’t you?

    I could not get it to display its startup messages correctly when set as my default shell.
    What do you mean? How did you set default shell?

    I use the telnet app that comes with Windows. We use /etc/profile, ~/.profile to start bash at the end and .bashrc to attempt to set aliases.

    Here are the contents of my .bashrc:

    alias ls="ls -alFEH"
    alias lsd="ls -D"
    alias dir="ls -D"
    alias md="mkdir"
    alias gb="git branch -v"
    export PS1='$PWD [$(git_branch_current)]\\$ '
    

    How do you want me to get the dump to you?

    Tatiana Balaburkina
    Rocketeer
    May 17, 2017 5:13 AM UTC

    I use the telnet app that comes with Windows. We use /etc/profile, ~/.profile to start bash at the end and .bashrc to attempt to set aliases.

    Here are the contents of my .bashrc:

    alias ls="ls -alFEH"
    alias lsd="ls -D"
    alias dir="ls -D"
    alias md="mkdir"
    alias gb="git branch -v"
    export PS1='$PWD [$(git_branch_current)]\\$ '
    

    How do you want me to get the dump to you?

    Clay,

    When is crashes, a dump file (CEED.xx) is created automatically. Could you share it?

    Also could you make this command: tsocmd listuser your_user omvs | grep PROGRAM

    –
    Thanks,
    Tatyana

    Tatiana Balaburkina
    Rocketeer
    May 17, 2017 6:10 AM UTC

    I’m getting a S0C4 when I invoke the ‘set’ command after invoking ‘bash’ with a .bashrc file present. The .bashrc file creates 4 aliases and sets and exports the PS1 environment variable.

    If I remove the file, the S0C4 does not occur.
    If I comment out (#) all the lines in .bashrc, the S0C4 does not occur.
    If I uncomment any one line, doesn’t seem to matter which, the S0C4 occurs.

    If I rename the .bashrc file to .bashrcx then invoke bash and enter ‘. ./.bashrcx’, all of the aliases and the PS1 variable get set. Then when I issue the ‘set’ command, I do not get a S0C4.

    There clearly seems to be an issue with using a .bashrc file at the invocation of bash.

    The .bashrc file is encoded IBM-1047. I’m trying to create an ISO-8859-1 version of the file to see if the issue still exists.

    Any thoughts appreciated.

    Clay,

    Also programmers ask to give /etc/profile, ~/.profile and output of “env | sort”. Could you do that?

    May 17, 2017 9:37 AM UTC

    Clay,

    When is crashes, a dump file (CEED.xx) is created automatically. Could you share it?

    Also could you make this command: tsocmd listuser your_user omvs | grep PROGRAM

    –
    Thanks,
    Tatyana

    How do you want me to share the dump with you?

    May 19, 2017 5:26 PM UTC

    I’m getting a S0C4 when I invoke the ‘set’ command after invoking ‘bash’ with a .bashrc file present. The .bashrc file creates 4 aliases and sets and exports the PS1 environment variable.

    If I remove the file, the S0C4 does not occur.
    If I comment out (#) all the lines in .bashrc, the S0C4 does not occur.
    If I uncomment any one line, doesn’t seem to matter which, the S0C4 occurs.

    If I rename the .bashrc file to .bashrcx then invoke bash and enter ‘. ./.bashrcx’, all of the aliases and the PS1 variable get set. Then when I issue the ‘set’ command, I do not get a S0C4.

    There clearly seems to be an issue with using a .bashrc file at the invocation of bash.

    The .bashrc file is encoded IBM-1047. I’m trying to create an ISO-8859-1 version of the file to see if the issue still exists.

    Any thoughts appreciated.

    Here are the attached files as requested. The actual file is a zip file, not a tar file. Not sure if that makes a difference. I could only attach it if it had a tar extension. These are all ASCII downloads to my PC using FTP.

    sorted_env.zip.tar (23.7 KB)

    May 19, 2017 5:27 PM UTC

    I’m getting a S0C4 when I invoke the ‘set’ command after invoking ‘bash’ with a .bashrc file present. The .bashrc file creates 4 aliases and sets and exports the PS1 environment variable.

    If I remove the file, the S0C4 does not occur.
    If I comment out (#) all the lines in .bashrc, the S0C4 does not occur.
    If I uncomment any one line, doesn’t seem to matter which, the S0C4 occurs.

    If I rename the .bashrc file to .bashrcx then invoke bash and enter ‘. ./.bashrcx’, all of the aliases and the PS1 variable get set. Then when I issue the ‘set’ command, I do not get a S0C4.

    There clearly seems to be an issue with using a .bashrc file at the invocation of bash.

    The .bashrc file is encoded IBM-1047. I’m trying to create an ISO-8859-1 version of the file to see if the issue still exists.

    Any thoughts appreciated.

    I would be happy to do an interactive session with you if needed.