AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  Compiling a program using perfstat API.

    Posted Mon June 08, 2009 07:26 PM

    Originally posted by: SystemAdmin


    I have a C program that uses perfstat API. It is compiled on a PowerPC_POWER4 and runs on both POWER4 and POWER5 machines. Both on version 5.3. The POWER4 machine is dedicated capped partition. The POWER5 machine is uncapped shared SMT. The C compiler is only on the POWER4.

    I have compiled the program on the POWER4 and have run it on the POWER5 without issues in the past. I recently recompiled the program, but when it runs on the POWER5 the program dumps due to segmentation fault in malloc which is called from perfstat_partition_total. (It runs fine on the POWER4.) The source code has not changed so I'm suspecting the problem might be with perfstat API. I need help figuring out what the problem is and determining a solution. I'm only slightly familiar with AIX so I'm not sure what and where to look. TIA.


  • 2.  Re: Compiling a program using perfstat API.

    Posted Wed June 17, 2009 09:01 PM

    Originally posted by: pidad


    What does the failing stack look like?


  • 3.  Re: Compiling a program using perfstat API.

    Posted Mon June 22, 2009 05:05 PM

    Originally posted by: SystemAdmin


    Here's the stack.

    $dbx tdidcsvc core
    Type 'help' for help.
    using memory image in core
    reading symbolic information ...

    Segmentation fault in malloc_y at 0xd03b277c ($t1)
    0xd03b277c (malloc_y+0x4f4) 93a30000 stw r29,0x0(r3)
    (dbx) where
    malloc_y(0x10, 0x0, 0x200699e4, 0xf0b2, 0x0, 0x179f1, 0x0, 0x0) at 0xd03b277c
    malloc_common_80_63(??) at 0xd0343a0c
    perfstat_partition_total(??, ??, ??, ??) at 0xd061fb20
    WriteMachineInfo(Info1 = 0x200715c8, Info2 = 0x200716c8, Mode = 1), line 818 in "TDI_Support.c"
    WriteInitializationInfo(Info = 0x20070208, Initialization = 1), line 1047 in "TDI_Meters.c"
    TDI_DataCollector(argc = 0, argv = (nil)), line 157 in "TDI_DataCollector.c"
    StartDCRun(argc = 0, argv = (nil)), line 397 in "TDI_Service.c"
    StartDCService(), line 369 in "TDI_Service.c"
    main(argc = 2, argv = 0x2ff22850), line 130 in "TDI_main.c"


  • 4.  Re: Compiling a program using perfstat API.

    Posted Tue June 23, 2009 01:35 PM

    Originally posted by: SystemAdmin


    I found the problem in our code. Prior to calling perfstat_partition_total, a buffer overflow was occuring on a data structure that allocated with the wrong size.