AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  "Big" data text editor on AIX

    Posted Fri December 27, 2019 01:15 AM

    Originally posted by: Edward Davignon


    Is there an editor on AIX that can handle 10 GB text files?

    $ seq 1 1000000000 > x
    $ wc x
     1000000000 1000000000 9888888899 x
    $ /usr/bin/vi x
    [...]
    "x" Value too large to be stored in data type
    [...]
    :q
    $ /usr/bin/vim x
    Vim: Caught deadly signal SEGV
    Vim: Finished.
    
    Segmentation fault (core dumped)
    $ echo where | dbx /usr/bin/vim core
    Type 'help' for help.
    [using memory image in core]
    reading symbolic information ...warning: Unable to access the stab file. Some info may not be available
    
    
    Segmentation fault in . at 0x1016f440 ($t1)
    0x1016f440 (???) 80410014            lwz   r2,0x14(r1)
    may_core_dump() at 0x1016f440
    mch_exit(0x1) at 0x1016f658
    getout(0x1) at 0x10001900
    preserve_exit() at 0x10029e0c
    deathtrap(0xb) at 0x10175b64
    $ /usr/bin/ulimit -Sa
    time(seconds)        unlimited
    file(blocks)         unlimited
    data(kbytes)         unlimited
    stack(kbytes)        4194304
    memory(kbytes)       unlimited
    coredump(blocks)     unlimited
    nofiles(descriptors) 20000
    threads(per process) unlimited
    processes(per user)  unlimited
    e309860@epic-cvma-01$ MANPATH= man dump | /usr/linux/bin/grep -A2 -e '^ *-v *$'
           -v
                Dumps the information in symbolic representation rather than numeric. Any flag except the -o flag and -s flag can be used with the
                -v flag.
    $ dump -ov /usr/bin/vim
    
    /usr/bin/vim:
    
                            ***Object Module Header***
    # Sections      Symbol Ptr      # Symbols       Opt Hdr Len     Flags
             6      0x00000000              0                72     0x100f
    Flags=( RELFLG EXEC LNNO LSYMS DYNLOAD DEP_SYSTEM )
    Timestamp = "Nov 19 08:09:48 2019"
    Magic = 0x1df  (32-bit XCOFF)
    
                            ***Optional Header***
    Tsize       Dsize       Bsize       Tstart      Dstart
    0x003560f2  0x0002e92e  0x0000e5e0  0x10000178  0x2000026a
    
    SNloader    SNentry     SNtext      SNtoc       SNdata
    0x0004      0x0002      0x0001      0x0002      0x0002
    
    TXTalign    DATAalign   TOC         vstamp      entry
    0x0007      0x0003      0x2002d1c4  0x0001      0x20029cd0
    
    maxSTACK    maxDATA     SNbss       magic       modtype
    0x00000000  0x00000000  0x0003      0x010b        1L
    $ MANPATH= man dump | /usr/linux/bin/grep -A2 -e '^ *-v *$'
           -v
                Dumps the information in symbolic representation rather than numeric. Any flag except the -o flag and -s flag can be used with the
                -v flag.
    $ oslevel -s
    7200-03-03-1914
    $ rpm -qa | grep vim | sort
    vim-common-8.1.2130-1.ppc
    vim-enhanced-8.1.2130-1.ppc
    $ sudo emgr -l | grep -p LABEL
    ID  STATE LABEL      INSTALL TIME      UPDATED BY ABSTRACT
    === ===== ========== ================= ========== ======================================
    1    S    IJ17065m3a 08/29/19 09:48:18            IJ17065 is for AIX 7.2 TL03
    2    S    IJ16586s3a 10/16/19 11:00:20            Ifix for APAR IJ16586
    3    S    IJ19600s3a 10/16/19 11:10:35            ifix for apar IJ19600
    
    $ sudo yum makecache && sudo yum upgrade
    Loaded plugins: changelog, downloadonly, versionlock
    AIX_Toolbox                                                                                                               | 2.9 kB  00:00:00
    AIX_Toolbox_72                                                                                                            | 2.9 kB  00:00:00
    AIX_Toolbox_noarch                                                                                                        | 2.9 kB  00:00:00
    Metadata Cache Created
    Loaded plugins: changelog, downloadonly, versionlock
    Setting up Upgrade Process
    No Packages marked for Update
    $ sudo yum versionlock list
    Loaded plugins: changelog, downloadonly, versionlock
    versionlock list done
    $ date
    Fri Dec 27 01:00:19 EST 2019
    $
    
    


  • 2.  Re: "Big" data text editor on AIX

    Posted Mon January 06, 2020 09:12 AM

    Originally posted by: sanket


    I am not sure if there is such an editor right now.

    Is this your requirement to open in editor only or you just want to view (you can use more or less) ?

     



  • 3.  Re: "Big" data text editor on AIX

    Posted Mon January 06, 2020 09:44 AM

    Originally posted by: Edward Davignon


    I ended up using grep, sed, and less with a lot of temporary files. I had hoped to be able to use an interactive editor to remove lines from a file extracted from syslog files. As I identify and explain events, I like to be able to remove them from my view. This is not always simple and straightforward; sometimes it helps to rearrange log entries or group entries together to better understand them. I also like to use search & replace and an interactive editor gives much better control over which lines are changed and which ones are left intact.

     

    Perhaps I will try compiling vim with gcc in 64-bit mode, since 32-bit mode will not handle 10 GB in memory, even with MAXDATA and DSA set.  Many AIX servers have several gigabytes of memory that is usually just filled with rarely used cached files from last night's backups.  I was hoping the editor would either handle temporary files or at least use more of the available memory in the machine.  I was surprised that it crashed hard without giving an error message indicating out-of-memory or out-of-stack-space. It seems it is not validating the pointers returned by the system calls when allocating memory.



  • 4.  Re: "Big" data text editor on AIX

    Posted Wed March 04, 2020 08:30 AM

    Originally posted by: AyappanP


    Vim 64 bit is now available in AIX Toolbox. Version is " 8.1.2130-2 ".

     



  • 5.  Re: "Big" data text editor on AIX

    Posted Wed March 04, 2020 05:12 PM

    Originally posted by: Edward Davignon


    EXCELLENT!!! THANK YOU!!!

    It is even the default symlink link. :-)

    I did a few tests and everything seems fine :-) :-) :-)

    I did use the -n option to skip the swap file, since my vimrc was pointing to my home directory and my home directory was low on space (and on slow disk).

    vim -n x

    Thank You



  • 6.  Re: "Big" data text editor on AIX

    Posted Thu March 05, 2020 12:31 AM

    Originally posted by: Edward Davignon


    Word to the wise:
    Make sure you set your ulimits to something less than the amount of memory you have available before editing a large file on an important server.
    Don't trust unlimited ulimits.  Especially if you use commands like :sort
    Don't ask me how I know.

    # ;-) ;-) ;-) ;-) Ignore below ;-) ;-) ;-) ;-)


    # There's nothing to see down here

    # scroll no further.

    [...]
    $ ssh $server
    ssh_exchange_identification: Connection closed by remote host

    [...]
    vtmenu
    [...]
    Console login: [...]
    [...]

    /etc/profile[50]: cannot fork: no swap space

    .profile[88]: cannot fork: no swap space
    ksh: cannot fork: no swap space
    $ exec ps gvww
    ksh: cannot fork: no swap space
    $       PID    TTY STAT  TIME PGIN  SIZE   RSS   LIM  TSIZ   TRS %CPU %MEM COMMAND
    [...]
     21299470      - A    271:15 56662 11118744 230444    xx  3005  2036  2.6  1.0 vim -n y
     22610248      - A    270:06 32402 37268124 32220592    xx  3005  2036  2.6 78.0 vim -n x

     


    # Fortunately this was just a sandbox server

     

    # I wonder if that is why my PuTTY sessions suddenly disappeared, which means they exited gracefully from an SSH protocol stand-point.