Opened 7 years ago

Closed 7 years ago

#8701 closed bug (invalid)

read command can die in some stream circumstances.

Reported by: kallisti5 Owned by: jackburton
Priority: low Milestone: Unscheduled
Component: Applications/Terminal Version: R1/Development
Keywords: shell Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This code of the git-dude command script seems to cause bash to crash with a signal 21:

      while read -r line; do
        case $line in
          *..*)
            commit_range=$(echo "$line" | awk '{ print $1 }')
            branch_name=$(echo "$line" | awk '{ print $2 }')
            commit_messages=$(git log $commit_range --pretty=format:'%s (%an)')
            notify $icon_path "New commits in $repo_name/$branch_name" "$commit_messages"
            ;;
          *new\ branch*)
            branch_name=$(echo "$line" | awk '{ print $3 }')
            notify $icon_path "New branch $repo_name/$branch_name" ""
            ;;
          *new\ tag*)
            tag_name=$(echo "$line" | awk '{ print $3 }')
            notify $icon_path "New tag $repo_name/$tag_name" ""
            ;;
        esac
      done <<< "$changes"

To reproduce:

  • install git
  • download git-dude
  • copy script into /bin/
  • run git dude /a/git/repo

/a/git/repo is a git repo that is remote, and has non-fetched changes (eg. you check something out, and there are updates you haven't pulled yet)

git-dude will crash and raise a backtrace with a very large number of bash calls... same behaviour isn't seen on Linux or other UNIX platforms.

Working on a backtrace now.

Attachments (1)

1.png (135.8 KB) - added by kallisti5 7 years ago.
crash

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by kallisti5

Attachment: 1.png added

crash

comment:2 Changed 7 years ago by kallisti5

Resolution: invalid
Status: newclosed

aaahh.... user error.

Haiku's notify command clashes with the 'notify' function in the script :D

Note: See TracTickets for help on using tickets.