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
Expand all | Collapse all

Process is shown as running in ps -ef output but not in topas

  • 1.  Process is shown as running in ps -ef output but not in topas

    Posted Sat April 12, 2025 08:26 AM

    My C++ application is shown as running in the output of ps -ef command but it does not show up in topas. This application has been compiled on AIX 7.1 power6 and is running on AIX 7.2 power9. It runs for few hours or sometimes days and then gets stuck. There are no logs being printed. On further analysis i do see that all the threads that are supposed to be active are in blocked in user state and waiting state in Kernel in the malloc_y call. 

     thread  state-k     wchan            state-u    k-tid mode held scope function
    >$t9     wait      0x00000001100a4718 blocked  57606507   k   no   sys  malloc_y          
    malloc_y(0x110226e80, 0x0, 0x9001000a05b4530, 0x110144948, 0xc, 0x136f016b, 0x1, 0x110144950) at 0x9000000002ed6e8
    malloc_common@AF119_102(??) at 0x90000000024bed4
    _ZN5boost3log12v2s_mt_posix19attribute_value_setC2ERKNS1_13attribute_setES5_S5_m(??, ??, ??, ??, ??) at 0x1000a5c8c
    _ZN5boost3log12v2s_mt_posix4core11open_recordERKNS1_13attribute_setE(??, ??) at 0x10001c358
    _ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresIJNS2_8severityIS6_EEEEEE11open_recordINS_9parameter3aux15tagged_argument(??, ??) at 0x10009c988
    _ZN7logging21AgentLogUploadManager17_ClearOldLogFilesEv(??) at 0x100026980
    _ZNSt17_Function_handlerIFvvESt5_BindIFMN7logging21AgentLogUploadManagerEFvvEPS3_EEE9_M_invokeERKSt9_Any_data(??) at 0x10002c688
    _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN4util13CallbackTimer5StartEjSt8functionIFvvEEEUlvE_EEEEE6_M_runEv(??) at 0x1004019b0
    execute_native_thread_routine(__p = 0x0000000110100750), line 80 in "thread.cc"
    Please let me know if more information is required and thanks in advance for any pointers. 
    ajit



    ------------------------------
    Ajit Krishnan Ranganathan
    ------------------------------


  • 2.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Fri April 18, 2025 05:37 AM

    You do not state the details of your topas command.

    topas and topas in nmon mode have a threshold so they do not report processes using zero CPU time (actually under the threshold of a tiny fraction of a CPU),
    as saving millions of zeros is rather pointless in CPU cycles and file system space.

    I suggest you raise an AIX PMR (now called a Support Case) and prepare a snap so AIX support can check your AIX version levels to see if your AIX are missing fixed in this area. You should be running the latest technology level and service pack. Running an older AIX version means you are running AIX with problems that have already been fixed, possibly years ago.

    Then they may ask for a perfpmr for normal running and the stuck time.

    Of course, malloc is the process requesting more virtual memory.

    Does your AIX system run out of real memory and virtual memory (paging space) over time?

    Check your AIX logs: errpt -l

    Can you add more memory? This might stop the problem or postpone it for a longer time.

    Hopefully, you are not running AIX with less than 16 GB? You might be able to boot AIX in 4GB of RAM, but it is not sensible.

    Can you restart the program every hour to avoid the problem?

    Do you have the application source code?

    • At the end of the day AIX Support are not there to rewrite duff code.

    Hopefully, something here might help you.



    ------------------------------
    Nigel Griffiths - IBM retired
    London, UK
    @mr_nmon
    ------------------------------



  • 3.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Sun April 20, 2025 10:22 AM

    Thank you very very much for the response first and it is also a very insightful one. 

    Can you please let me know how i can find the threshold for topas and topas nmon mode. I just ran the command "topas" and i also thought since our application is not using much CPU it is not showing up. Then i did see some other application with a very low value of CPU but as you have mentioned our application might be consuming very low CPU as it was blocked. 

    Can you please let me know how to take a snap? 

    thanks,

    ajit



    ------------------------------
    Ajit Krishnan Ranganathan
    ------------------------------



  • 4.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Mon April 21, 2025 02:23 AM

    Yes, i have access to the application code. 

    The issue with restarting the application every hour is we dont know when the application is going to get stuck - so it could get stuck in the time gap between two restarts. One idea is to have a watch dog type thread that should keep checking for the process in topas and if this process is not in topas, do a restart. Please let me know what you think about this - may be a script can do this? This is not the ideal solution though. 



    ------------------------------
    Ajit Krishnan Ranganathan
    ------------------------------



  • 5.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Mon April 21, 2025 03:26 PM

    It is unclear what "not in topas" really means.

    As explained nmon might not include your application when it is not consuming CPU time.

    Are you absolututely sure the application will always be consuming CPU. 

    Perhaps, there are periods when it does not need to do anything.

    You would have to kill off the old application or you could end up with dozens of stuck processes taking up memory.

    I would use ps and the TIME column - capture the ps output for just your application using the -p options.

    Then say on a one minute basis: check the TIME column - if it does not change then it is not using CPU time (but that might be normal).

    I do not have a script that does this as most watch dof timers just need to determine if the application process crashed - i.e. no longer exists.

    Good luck, 



    ------------------------------
    Nigel Griffiths - IBM retired
    London, UK
    @mr_nmon
    ------------------------------



  • 6.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Tue April 22, 2025 03:22 PM

    AIX Command Documentation https://www.ibm.com/docs/en/aix/7.3?topic=n-nmon-command

    The -I option allows you to change the threshold and documents the default.

    -I

    Specifies the percentage of process threshold at which the command ignores the TOP processes statistics.

    The default percentage is 0.1. [[note: of one CPU core]]

    The command does not save the TOP processes statistics if the process is using less processor power than the specified percentage.

    snap commanddocumentation is here https://www.ibm.com/docs/en/aix/7.3?topic=s-snap-command

    snap -a

    snap -c

    It can take time. Be patient.

    The pax file (which IBM AIX Support will want) ends up here /tmp/ibmsupt 

    Make sure it has enough space in this file system.

    At least a couple of GB. 

    Then check the file system to see if it run out of space. 

    If it has: double the size and redo.



    ------------------------------
    Nigel Griffiths - IBM retired
    London, UK
    @mr_nmon
    ------------------------------



  • 7.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Wed April 23, 2025 12:26 AM

    Thank you. Will check on these. Once again, thank you for your time and very helpful suggestions. 

    ajit



    ------------------------------
    Ajit Krishnan Ranganathan
    ------------------------------



  • 8.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Fri April 25, 2025 03:49 AM

    One observation while debugging - the process started running and generating logs when we ran a command like ps - mo THREAD <pid> and/or a script to dump the thread stack trace. This did not happen always but it happened couple of times. 

    Does the topas command agregrate the cpu utilization of all cores on the system?

    thanks,

    ajit



    ------------------------------
    Ajit Krishnan Ranganathan
    ------------------------------



  • 9.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Fri April 25, 2025 04:43 AM

    Sorry, but I can't read your mind nor determine vague terms.

    Exactly, what topas command and options are you running and what columns are you referring too?

    Better yet, send a sample.



    ------------------------------
    Nigel Griffiths - IBM retired
    London, UK
    @mr_nmon
    ------------------------------



  • 10.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Mon April 21, 2025 04:40 AM

    Nigel,

    BTW, what are pitfalls of running AIX on less than 16 GB RAM?



    ------------------------------
    Sincerely,
    Dennis
    ------------------------------



  • 11.  RE: Process is shown as running in ps -ef output but not in topas

    Posted Mon April 21, 2025 03:16 PM

    Hi,

    All the classic low memory problems that you get with UNIX.

    Actually, AIX does very well trying to cope with these problems but it is easy to swamp the system.

    1. High memory paging grinding a large app to a stop while taking high CPU cycles.
    2. Memory failures that might end up crashing programs not built to handle this.
    3. Application hanging, waiting for memory to get freed up
    4. Low AIX buffer cache forcing I/O for high-use blocks from the filesystem - like file system directory structures.
    5. Searching for particular files takes forever.
    6. Starting new applications (fork & exec) takes minutes to start an application.

    Hope this helps,



    ------------------------------
    Nigel Griffiths - IBM retired
    London, UK
    @mr_nmon
    ------------------------------