Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1356

tbloader2 crashes on OSX with "value too great for base" error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.3.0
    • Jena 3.4.0
    • Cmd line tools
    • Mac OSX 10.12.5

    Description

      tbloader2 crashes during the sort phase because when checking for free memory because top reports memory measured in gigabytes ("10G") rather than megabytes and the script (getFreeMem in tbloader2common) is hard coded to expect the memory to be expressed in megabytes ("10M").

      The bug can be fixed by checking which unit is used:

      case "$OSTYPE" in
          darwin*)
            # Have to get this from top
            FREE_MEM=$(top -l 1 | grep PhysMem | awk '{print $6}')
            MEM_LEN=${#FREE_MEM}
            MEM_UNIT=${FREE_MEM:MEM_LEN-1:1}
            if [ $MEM_UNIT == 'M' ]; then
              FREE_MEM=${FREE_MEM:0:MEM_LEN-1}
              FREE_MEM=$(($FREE_MEM * 1024 *1024))
            fi
            if [ $MEM_UNIT == 'G' ]; then
              FREE_MEM=${FREE_MEM:0:MEM_LEN-1}
              FREE_MEM=$(($FREE_MEM * 1024 *1024 * 1024))
            fi
            ;;
      

      Attachments

        Activity

          People

            rvesse Rob Vesse
            josh@stain.org joshua portway
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: