+ Reply
Results 1 to 15 of 15

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: lsof problem

is a discussion within the

Native iPhone / iPod Touch App Discussion

forums, a part of the

3rd Party Apps For iPhone | iPod Touch

section;
I'm sorry if I put this in the wrong thread. I am trying to use lsof on my ipad and ipod touch however I get the following error every time
...
  1. #1
    What's Jailbreak?
    Join Date
    Jul 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default lsof problem
    I'm sorry if I put this in the wrong thread. I am trying to use lsof on my ipad and ipod touch however I get the following error every time I try to run it.
    Code:
    lsof: PID 3206 information error: Cannot allocate memory
    lsof: PID 3203 information error: Cannot allocate memory
    lsof: PID 3202 information error: Cannot allocate memory
    lsof: PID 3201 information error: Cannot allocate memory
    lsof: PID 3200 information error: Cannot allocate memory
    lsof: PID 3199 information error: Cannot allocate memory
    lsof: PID 2319 information error: Cannot allocate memory
    lsof: PID 2259 information error: Cannot allocate memory
    lsof: PID 454 information error: Cannot allocate memory
    lsof: PID 100 information error: Cannot allocate memory
    lsof: PID 85 information error: Cannot allocate memory
    lsof: PID 39 information error: Cannot allocate memory
    lsof: PID 37 information error: Cannot allocate memory
    lsof: PID 36 information error: Cannot allocate memory
    lsof: PID 32 information error: Cannot allocate memory
    lsof: PID 29 information error: Cannot allocate memory
    lsof: PID 26 information error: Cannot allocate memory
    lsof: PID 25 information error: Cannot allocate memory
    lsof: PID 21 information error: Cannot allocate memory
    lsof: PID 19 information error: Cannot allocate memory
    lsof: PID 17 information error: Cannot allocate memory
    lsof: PID 15 information error: Cannot allocate memory
    lsof: PID 14 information error: Cannot allocate memory
    lsof: PID 13 information error: Cannot allocate memory
    lsof: PID 12 information error: Cannot allocate memory
    lsof: PID 1 information error: Cannot allocate memory
    can anyone tell me how to make lsof work? thanks in advance
    Last edited by linuxmac09; 07-29-2010 at 06:41 PM.

  2. #2
    What's Jailbreak?
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Same Problem w/ lsof
    I'm getting exactly the same problem.

    I tried restarting the device to attempt to free as much memory as possible for the lsof command, but no luck. I'm issuing the command via SSH from my laptop over wifi. This is on an old iPhone 3G running iOS 4.0.1

    I tired it again on my iPhone 4 running iOS 4.0.1 with 300 MB free memory directly from MobileTerminal (426). Same deal.

    Anyone have any idea what lsof is complaining about? I'm using lsof to try to figure out where the "No Service" icon is stored in the file structure so that I can change it -- this 3G will just be an iPod Touch for my brother from now on.

    Thanks.

  3. #3
    What's Jailbreak?
    Join Date
    Jul 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bump

  4. #4
    What's Jailbreak?
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I'm trying to run lsof too and having the exact same problem.

  5. #5
    What's Jailbreak?
    Join Date
    Jun 2008
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    I am using iOS 4.2.1 on an iPhone 4.

    I am getting the same error:
    Code:
    lsof: PID 39 information error: Cannot allocate memory
    lsof: PID 35 information error: Cannot allocate memory
    lsof: PID 31 information error: Cannot allocate memory
    lsof: PID 28 information error: Cannot allocate memory
    lsof: PID 19 information error: Cannot allocate memory
    lsof: PID 17 information error: Cannot allocate memory
    lsof: PID 15 information error: Cannot allocate memory
    lsof: PID 14 information error: Cannot allocate memory
    lsof: PID 13 information error: Cannot allocate memory
    lsof: PID 12 information error: Cannot allocate memory
    lsof: PID 1 information error: Cannot allocate memory

  6. #6
    What's Jailbreak?
    Join Date
    Jun 2008
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Anyone know where I can get more assistance in getting this command to work? I have tried compiling it myself without much luck.

  7. #7
    MMI's Official Devil Dog santacruzlocal's Avatar
    Join Date
    Mar 2009
    Location
    SC California
    Posts
    620
    Thanks
    5
    Thanked 45 Times in 37 Posts

    lsof should be located in /usr/sbin Try navigating to that directory and see what the permissions are set to.

    Good Luck !!!

  8. #8
    What's Jailbreak?
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 5 Times in 2 Posts

    You can try this new lsof build for iphone 4 & iOS 4.2.1

    http://pupil.io8.org/pub/iphone/misc...of-arm7-iOS4.2



    Quote Originally Posted by santacruzlocal View Post
    lsof should be located in /usr/sbin Try navigating to that directory and see what the permissions are set to.

    Good Luck !!!

  9. The Following 3 Users Say Thank You to scaner For This Useful Post:

    egregious (06-22-2012), firewire888 (06-17-2013), Oen386 (02-21-2011)

  10. #9
    What's Jailbreak?
    Join Date
    Jun 2008
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    (Removed) Guy knows what he is talking about.
    Last edited by Oen386; 02-24-2011 at 05:15 PM.

  11. #10
    What's Jailbreak?
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 5 Times in 2 Posts

    It's built by myself.

    You can download iOS SDK from apple, and download
    lastest lsof source code, build it by yourself.

    There is a small trick, you need copy some include file
    from iOS simulator SDK to iPhoneOS SDK.



    Quote Originally Posted by Oen386 View Post
    What is that file? I don't think I should trust it from a user with 1 post.

  12. The Following 2 Users Say Thank You to scaner For This Useful Post:

    egregious (06-21-2012), Oen386 (02-21-2011)

  13. #11
    What's Jailbreak?
    Join Date
    Jun 2008
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    ROFL, sorry won't lie thought it was a trick.

    Thanks for the response!

    I will see if I can get it to work. Do you remember what files exactly?

  14. #12
    What's Jailbreak?
    Join Date
    May 2012
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by scaner View Post
    It's built by myself.

    You can download iOS SDK from apple, and download
    lastest lsof source code, build it by yourself.

    There is a small trick, you need copy some include file
    from iOS simulator SDK to iPhoneOS SDK.
    I've been trying this. Can you elaborate on the 'trick'? I've compiled okay (with warnings), but when linking, I get:

    Code:
    Undefined symbols for architecture armv7:
      "_process_dev_stat", referenced from:
          _ck_file_arg in arg.o
          _enter_dir in arg.o
      "_write$UNIX2003", referenced from:
          _doinchild in misc.o
      "_stat$INODE64", referenced from:
          _main in main.o
          _dostat in misc.o
          _printuid in print.o
      "_Pof_tab", referenced from:
          _print_fflags in proc.o
       
     [... etc]
    
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    I got this from elsewhere, so there is extra crap contained, but this is my link command:
    Code:
    clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -L lib -L /usr/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/lib -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\)/Symbols/usr/lib -filelist linklist -dead_strip -miphoneos-version-min=5.1 -framework SystemConfiguration -framework UIKit -framework Foundation -framework CoreGraphics -o mylsofx
    Also... When I try your compiled binary on my iPhone4 running 5.1.1, I only get:

    Code:
    Killed: 9
    Update: This is related to code signing. I used ldid and the binary works great!


    Any pointers on compiling would be appreciated, thanks...
    Last edited by egregious; 06-21-2012 at 09:35 PM.

  15. #13
    What's Jailbreak?
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by egregious View Post
    I've been trying this. Can you elaborate on the 'trick'? I've compiled okay (with warnings), but when linking, I get:

    Code:
    Undefined symbols for architecture armv7:
      "_process_dev_stat", referenced from:
          _ck_file_arg in arg.o
          _enter_dir in arg.o
      "_write$UNIX2003", referenced from:
          _doinchild in misc.o
      "_stat$INODE64", referenced from:
          _main in main.o
          _dostat in misc.o
          _printuid in print.o
      "_Pof_tab", referenced from:
          _print_fflags in proc.o
       
     [... etc]
    
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    I got this from elsewhere, so there is extra crap contained, but this is my link command:
    Code:
    clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -L lib -L /usr/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/lib -L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\)/Symbols/usr/lib -filelist linklist -dead_strip -miphoneos-version-min=5.1 -framework SystemConfiguration -framework UIKit -framework Foundation -framework CoreGraphics -o mylsofx
    Also... When I try your compiled binary on my iPhone4 running 5.1.1, I only get:

    Code:
    Killed: 9
    Update: This is related to code signing. I used ldid and the binary works great!


    Any pointers on compiling would be appreciated, thanks...
    How were you able to ldid that binary? When I downloaded it and put it in /usr/sbin and updated permissions I got util/ldid.cpp(660): _assert(78:signature != NULL)

    You used the binary from here right? http://pupil.io8.org/pub/iphone/misc...of-arm7-iOS4.2
    I'm also on iOS 5.1.1

  16. #14
    What's Jailbreak?
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Does anyone have an update on this? The binary above gives me a Killed: 9 error and I have been unable to compile from source successfully. Any help would be much appreciated.

  17. #15
    What's Jailbreak?
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Here's how i got this to work but need mac osx.

    1. On mac osx download ldid for macosx. https://networkpx.googlecode.com/files/ldid
    2. On mac osx download scaner's version of lsof in this thread. Thanks again!
    3. On mac osx run ldid -S lsof
    4. scp or whatever means get lsof to /usr/sbin/lsof on iPhone ( has to be in /usr/sbin otherwise get error can't fork )

    Finally figured out what process is opening a port. Shame netstat doesn't work like linux -p option

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts