AIX

AIX

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

 View Only
  • 1.  fopen() error

    Posted Thu August 10, 2006 07:08 AM

    Originally posted by: SystemAdmin


    Hi All, require help in understanding the problem. I have a multithreaded program that uses fopen() quite frequently and at some point a thread calling fopen() hangs.
    Stack trace of a thread that hangs is as follows

    ptrgl._ptrgl() at 0xd0215a70
    _rec_mutex_lock(??) at 0xd022eff0
    _rec_mutex_lock(??) at 0xd022eff0
    _endopen(??, ??, ??, ??) at 0xd0230304
    fopen64(??, ??) at 0xd0230808
    inv_internal_flush(), line 435 in "inven_disk.c"
    inv_disk_commit(), line 529 in "inven_disk.c"

    Machine Configuration: AIX 5.3.0, POWERPC, IBM,7044-170, Single CPU, User and Kernel both running in 32 - bit.

    Questions:
    1 ) Is it some kind of deadlock inside kernel?
    2 ) If my program as well as kernel are running in 32-bit, then why is dbx where command showing fopen64()?
    3 ) Can anybody point out in what scenairo such problem can arise?

    Regards,
    Amit Dang


  • 2.  Re: fopen() error

    Posted Thu December 27, 2007 10:52 AM

    Originally posted by: dickdunbar


    Wow. No responses.

    fopen64() is the function which handles LARGE_FILES in a 32-bit pgm.
    The problem with open is it had only a signed integer for the seek address, which means 2**31 or 2GB filesize limit.

    A compiler macro definition causes fopen() in your source to be converted to fopen64(). Manipulation of the 64-bit seek value is handled by the compiler using 32-bit instructions to perform arithmetic on the 64-bit field.

    Why is it hanging? Perhaps the way you've opened the file for exclusive use? You didn't show the code.