Products Resources Support About Us

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.

Hi,

Which bash version do you use? (bash --version)

Should be the latest greatest

/V2R1/usr/lpp/ported/rocket/bash/bin []$ bash --version
GNU bash, version 4.3.46(6)-release (i370-ibm-openedition)

Here’s the message that comes out when I get the S0C4:

$ set
CEE3204S The system detected a protection exception (System Completion Code=0C4).
From entry point print_assignment at compile unit offset +000000E6 at entry offset +000000E6 at address
2483BF26.
Segmentation fault

And here is the traceback in the dump:

CEE3DMP V2 R1.0: Condition processing resulted in the unhandled condition.         04/10/17 10:15:20 AM                 Page:    1
ASID: 0168   PID: 33686759   Parent PID: 33686744   User name: DEVCGC

CEE3845I CEEDUMP Processing started.

Information for enclave main

  Information for thread 24F9620000000001

  Traceback:
    DSA   Entry       E  Offset  Statement   Load Mod             Program Unit                   Service  Status
    1     CEEHDSP     +00004A4C              CEEPLPKA             CEEHDSP                        UI90017  Call
    2     CEEHRNUH    +0000009A              CEEPLPKA             CEEHRNUH                       HLE7790  Call
    3     __printf_a  +0000303A              CELHV003                                            UI14148  Exception
    4     print_assignment
                      +000000E6              bash                                                         Call
    5     print_var_list
                      +0000002E              bash                                                         Call
    6     print_all_shell_variables
                      +0000002A              bash                                                         Call
    7     set_builtin +00000012              bash                                                         Call
    8     execute_builtin
                      +000003DE              bash                                                         Call
    9     execute_builtin_or_function
                      +0000015C              bash                                                         Call
    10    execute_simple_command
                      +00000A9A              bash                                                         Call
    11    execute_command_internal
                      +000008BC              bash                                                         Call
    12    execute_command
                      +00000092              bash                                                         Call
    13    reader_loop +0000029C              bash                                                         Call
    14    main        +00000C0A              bash                                                         Call
    15    CEEVROND    +00001258              CEEPLPKA                                                     Call
    16    EDCZHINV    +000000B4              CELHV003             EDCZHINV                       HLE7790  Call
    17    CEEBBEXT    +000001D2              CEEPLPKA             CEEBBEXT                       HLE7790  Call

For some reason my answer to this post was blocked. I’m waiting for them to release it. It has a lot of information about the issue that I don’t want to have to repeat.

GNU bash, version 4.3.46(6)-release (i370-ibm-openedition)

I had the traceback in my other post that got blocked. I’ll try posting things separately until I figure out why it was blocked.

Here is the actual abend.

$ set
CEE3204S The system detected a protection exception (System Completion Code=0C4).
From entry point print_assignment at compile unit offset +000000E6 at entry offset +000000E6 at address
2483BF26.
[1] + Done(139) ?
50463745 Segmentation violation /V2R1/usr/lpp/ported/rocket/bash/bin/bash

Does Rocket Software monitor this forum? I’m hoping to get some feedback on this issue. It would be real nice to be able to let my .bashrc script run at bash startup.

Hi,

Do you start bash manually? How (when and where) do you set these variables:
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _BPXK_AUTOCVT=ON
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt

We start bash at the end of our .profile script. I could not get it to display its startup messages correctly when set as my default shell.

The exports for the required environment variables are done in /etc/profile.

#Begin Rocket Software
#Ported Tools for z/OS
#PERL
export LIBPATH=$LIBPATH:/V2R1/usr/lpp/ported/rocket/perl/lib/perl5/5.24.0/os390/CORE
export PATH=$PATH:/V2R1/usr/lpp/ported/rocket/perl/bin
export MANPATH=$MANPATH:/V2R1/usr/lpp/ported/rocket/perl/share/man
export PERL5LIB=$PERL5LIB:/V2R1/usr/lpp/ported/rocket/perl/lib/perl5
#GIT
export GIT_SHELL=/usr/lpp/ported/rocket/bash/bin
export GIT_EXEC_PATH=/usr/lpp/ported/rocket/git/libexec/git-core
export GIT_TEMPLATE_DIR=/usr/lpp/ported/rocket/share/git-core/templates
export PATH=$PATH:/V2R1/usr/lpp/ported/rocket/git/bin
export MANPATH=$MANPATH:/V2R1/usr/lpp/ported/rocket/git/man
#MAKE
##We want rocket make ahead of IBM's make command
export PATH=/V2R1/usr/lpp/ported/rocket/make/bin:$PATH
#export MANPATH=$MANPATH:/V2R1/usr/lpp/ported/rocket/make/share/man
export MANPATH=/V2R1/usr/lpp/ported/rocket/make/share/man:$MANPATH
#BASH
export PATH=$PATH:/V2R1/usr/lpp/ported/rocket/bash/bin
export MANPATH=$MANPATH:/V2R1/usr/lpp/ported/rocket/bash/man
#GZIP
export PATH=$PATH:/V2R1/usr/lpp/ported/rocket/gzip/bin
export MANPATH=$MANPATH:/V2R1/usr/lpp/ported/rocket/gzip/man
#UNZIP
export PATH=$PATH:/V2R1/usr/lpp/ported/rocket/unzip/bin
export MANPATH=$MANPATH:/V2R1/usr/lpp/ported/rocket/unzip/man
#AUTOMAKE
export PATH=$PATH:/V2R1/usr/lpp/ported/rocket/automake/bin
export INFOPATH=$INFOPATH:/V2R1/usr/lpp/ported/rocket/automake/share/info
#ASCII environment variables
 export _BPXK_AUTOCVT=ON
 export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
 export _TAG_REDIR_ERR=txt
 export _TAG_REDIR_IN=txt
 export _TAG_REDIR_OUT=txt
#End Rocket Software

We did come across what may be a clue to isolating the issue. If my developer enters alias followed by the set command, he gets the S0C4 without executing .bashrc. These abends are pretty consistent so I’m hoping someone from Rocket will attempt to recreate this.

[]$ alias
[]$ set
CEE3204S The system detected a protection exception (System Completion Code=0C4).
         From entry point print_assignment at compile unit offset +000000E6 at entry offset +000000E6 at address
         2483BF26.
[1] + Done(139) ?
  16908440      Segmentation violation  /V2R1/usr/lpp/ported/rocket/bash/bin/bash

Hi,
I’m a Rocket engineer.
I’ve reproduced the case. And I didn’t get this exception. Also I have never got this error.
We’re going to update bash-4.3 soon (couple of weeks). Could you wait for update, please?

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.

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.

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?

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

Clay,

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

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

Tatyanahttps://forum.rocketsoftware.com/u/tatyana , I never got a response back on how to share these documents with you so I’m replying to the email in hopes that will somehow attach these to the issue on the forum. If you need them a different way, I need you to help me understand what I need to do to get them to you.