I was trying to print all the memory regions of a process using the mach_vm_region and it seemed to work fine but when I compared it to the vmmap command vmmap -v -interleaved <PID>, I realized that I was still missing many memory regions.
For instance, after my program and vmmap were giving the same memory regions for about 50 regions straight, , in a certain region my program got this:
180000000 to 1f8000000
1f8000000 to 1f869c000
1f869c000 to 1f86bc000
1f86bc000 to 1f86c0000
1f86c0000 to 1fa000000
1fa000000 to 1faeac000
1faeac000 to 1fc5a0000
1fc5a0000 to 1ff928000
1ff928000 to 200000000
while in the same space, vmmap got this:
Submap 180000000-1f8000000 [ 1.9G 0K 0K 0K] r--/r-- SM=SHM machine-wide VM submap
unused shlib __TEXT 1a2174000-1a21c5000 [ 324K 324K 0K 0K] r-x/r-x SM=COW system shared lib __TEXT not used by this process
__TEXT 1a21c5000-1a21c7000 [ 8K 8K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_blocks.dylib
__TEXT 1a21c7000-1a2209000 [ 264K 264K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libxpc.dylib
__TEXT 1a2209000-1a2223000 [ 104K 104K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_trace.dylib
__TEXT 1a2223000-1a22ad000 [ 552K 536K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libcorecrypto.dylib
__TEXT 1a22ad000-1a22d8000 [ 172K 172K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_malloc.dylib
__TEXT 1a22d8000-1a231f000 [ 284K 284K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libdispatch.dylib
__TEXT 1a231f000-1a235d000 [ 248K 248K 0K 0K] r-x/r-x SM=COW /usr/lib/libobjc.A.dylib
__TEXT 1a235d000-1a2360000 [ 12K 12K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_featureflags.dylib
__TEXT 1a2360000-1a23e2000 [ 520K 488K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_c.dylib
__TEXT 1a23e2000-1a2449000 [ 412K 396K 0K 0K] r-x/r-x SM=COW /usr/lib/libc++.1.dylib
__TEXT 1a2449000-1a2461000 [ 96K 96K 0K 0K] r-x/r-x SM=COW /usr/lib/libc++abi.dylib
__TEXT 1a2461000-1a2499000 [ 224K 224K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_kernel.dylib
__TEXT 1a2499000-1a24a6000 [ 52K 52K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_pthread.dylib
__TEXT 1a24a6000-1a24b3000 [ 52K 52K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libdyld.dylib
__TEXT 1a24b3000-1a24bb000 [ 32K 32K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_platform.dylib
__TEXT 1a24bb000-1a24e8000 [ 180K 164K 0K 0K] r-x/r-x SM=COW /usr/lib/system/libsystem_info.dylib
__TEXT 1a24e8000-1a2a2f000 [ 5404K 4092K 0K 0K] r-x/r-x SM=COW /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
unused shlib __TEXT 1a2a2f000-1a4921000 [ 30.9M 17.4M 0K 0K] r-x/r-x SM=COW system shared lib __TEXT not used by this process
__TEXT 1a4921000-1a4bd7000 [ 2776K 2568K 0K 0K] r-x/r-x SM=COW /usr/lib/libicucore.A.dylib
...
__DATA_DIRTY 1fb3fe3e8-1fb3fe3f0 [ 8 8 8 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_notify.dylib
__DATA_DIRTY 1fb3fe3f0-1fb3fe404 [ 20 20 20 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_platform.dylib
unused shlib __DATA 1fb3fe404-1fb400000 [ 7K 7K 7K 0K] rw-/rw- SM=COW unused system shared lib __DATA, on dirty page
__DATA_DIRTY 1fb400000-1fb405838 [ 22K 22K 22K 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_pthread.dylib
__DATA_DIRTY 1fb405838-1fb405848 [ 16 16 16 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_symptoms.dylib
__DATA_DIRTY 1fb405848-1fb405cb8 [ 1136 1136 1136 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_trace.dylib
__DATA_DIRTY 1fb405cb8-1fb406708 [ 2640 2640 2640 0K] rw-/rw- SM=COW /usr/lib/system/libxpc.dylib
unused shlib __DATA 1fb406708-1fb408000 [ 6K 6K 6K 0K] rw-/rw- SM=COW unused system shared lib __DATA, on dirty page
__AUTH 1fb408000-1fb4081b8 [ 440 440 0K 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_trace.dylib
__AUTH 1fb4081b8-1fb408218 [ 96 96 0K 0K] rw-/rw- SM=COW /usr/lib/system/libcorecrypto.dylib
unused shlib __DATA 1fb408218-1fb40c000 [ 15K 15K 0K 0K] rw-/rw- SM=COW system shared lib __DATA not used by this process
__AUTH 1fb40c000-1fb414000 [ 32K 32K 0K 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_malloc.dylib
__DATA 1fb414000-1fb415400 [ 5K 5K 0K 0K] rw-/rw- SM=COW /usr/lib/system/libdispatch.dylib
__AUTH 1fb415400-1fb415478 [ 120 120 0K 0K] rw-/rw- SM=COW /usr/lib/libobjc.A.dylib
__AUTH 1fb415478-1fb416190 [ 3352 3352 0K 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_c.dylib
__AUTH 1fb416190-1fb418628 [ 9K 9K 1576 0K] rw-/rw- SM=COW /usr/lib/libc++.1.dylib
__AUTH 1fb418628-1fb418670 [ 72 72 72 0K] rw-/rw- SM=COW /usr/lib/libc++abi.dylib
__AUTH 1fb418670-1fb4186b0 [ 64 64 64 0K] rw-/rw- SM=COW /usr/lib/system/libdyld.dylib
__AUTH 1fb4186b0-1fb418880 [ 464 464 464 0K] rw-/rw- SM=COW /usr/lib/system/libsystem_info.dylib
__AUTH 1fb418880-1fb41a740 [ 8K 8K 8K 0K] rw-/rw- SM=COW /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
unused shlib __DATA 1fb41a740-1fb41c000 [ 6K 6K 6K 0K] rw-/rw- SM=COW unused system shared lib __DATA, on dirty page
unused shlib __DATA 1fb41c000-1fb4a2640 [ 538K 506K 0K 0K] rw-/rw- SM=COW system shared lib __DATA not used by this process
__AUTH 1fb4a2640-1fb4a2660 [ 32 32 0K 0K] rw-/rw- SM=COW /usr/lib/system/libcommonCrypto.dylib
__AUTH 1fb4a2660-1fb4a2668 [ 8 8 0K 0K] rw-/rw- SM=COW /usr/lib/libSystem.B.dylib
unused shlib __DATA 1fb4a2668-1fbb2c000 [ 6694K 982K 0K 0K] rw-/rw- SM=COW system shared lib __DATA not used by this process
__AUTH_CONST 1fbb2c000-1fbc08e80 [ 884K 884K 0K 0K] rw-/rw- SM=COW /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
__OBJC_CONST 1fbc08e80-1fbc0f9f0 [ 27K 27K 0K 0K] rw-/rw- SM=COW /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
unused shlib __DATA 1fbc0f9f0-1fc288000 [ 6626K 1250K 0K 0K] rw-/rw- SM=COW system shared lib __DATA not used by this process
__OBJC_RW 1fc288000-1fc5a0000 [ 3168K 1616K 16K 0K] rw-/rw- SM=COW /usr/lib/libobjc.A.dylib
__AUTH_CONST 1fc5a0000-1fc5a0030 [ 48 48 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_blocks.dylib
__OBJC_CONST 1fc5a0030-1fc5a0390 [ 864 864 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_blocks.dylib
__DATA_CONST 1fc5a0390-1fc5a4e20 [ 19K 19K 0K 0K] r--/rw- SM=COW /usr/lib/system/libxpc.dylib
__OBJC_CONST 1fc5a4e20-1fc5a5f90 [ 4K 4K 0K 0K] r--/rw- SM=COW /usr/lib/system/libxpc.dylib
__AUTH_CONST 1fc5a5f90-1fc5a6c90 [ 3328 3328 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_trace.dylib
__OBJC_CONST 1fc5a6c90-1fc5a6e40 [ 432 432 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_trace.dylib
__AUTH_CONST 1fc5a6e40-1fc5a7f10 [ 4K 4K 0K 0K] r--/rw- SM=COW /usr/lib/system/libcorecrypto.dylib
__AUTH_CONST 1fc5a7f10-1fc5a84e8 [ 1496 1496 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_malloc.dylib
unused shlib __TEXT 1fc5a84e8-1fc5a8500 [ 24 24 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__DATA_CONST 1fc5a8500-1fc5bb8e8 [ 77K 29K 0K 0K] r--/rw- SM=COW /usr/lib/system/libdispatch.dylib
__OBJC_CONST 1fc5bb8e8-1fc5bc938 [ 4K 4K 0K 0K] r--/rw- SM=COW /usr/lib/system/libdispatch.dylib
unused shlib __TEXT 1fc5bc938-1fc5bc940 [ 8 8 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fc5bc940-1fc5bd3c8 [ 2696 2696 0K 0K] r--/rw- SM=COW /usr/lib/libobjc.A.dylib
__OBJC_CONST 1fc5bd3c8-1fc5bd698 [ 720 720 0K 0K] r--/rw- SM=COW /usr/lib/libobjc.A.dylib
__AUTH_CONST 1fc5bd698-1fc5bd808 [ 368 368 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_featureflags.dylib
__AUTH_CONST 1fc5bd808-1fc5be168 [ 2400 2400 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_c.dylib
__AUTH_CONST 1fc5be168-1fc5c02a8 [ 8K 8K 0K 0K] r--/rw- SM=COW /usr/lib/libc++.1.dylib
__AUTH_CONST 1fc5c02a8-1fc5c34b8 [ 13K 13K 0K 0K] r--/rw- SM=COW /usr/lib/libc++abi.dylib
__AUTH_CONST 1fc5c34b8-1fc5c35e0 [ 296 296 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_kernel.dylib
__AUTH_CONST 1fc5c35e0-1fc5c3810 [ 560 560 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_pthread.dylib
__AUTH_CONST 1fc5c3810-1fc5c3fc8 [ 1976 1976 0K 0K] r--/rw- SM=COW /usr/lib/system/libdyld.dylib
__AUTH_CONST 1fc5c3fc8-1fc5c4250 [ 648 648 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_platform.dylib
__AUTH_CONST 1fc5c4250-1fc5c53f0 [ 4K 4K 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_info.dylib
unused shlib __TEXT 1fc5c53f0-1fc6e1e10 [ 1139K 947K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fc6e1e10-1fc6f3d48 [ 72K 72K 0K 0K] r--/rw- SM=COW /usr/lib/libicucore.A.dylib
__AUTH_CONST 1fc6f3d48-1fc6f41c8 [ 1152 1152 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_darwin.dylib
unused shlib __TEXT 1fc6f41c8-1fc70fa80 [ 110K 110K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fc70fa80-1fc70fe00 [ 896 896 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_notify.dylib
unused shlib __TEXT 1fc70fe00-1fc896a40 [ 1563K 1451K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fc896a40-1fc897608 [ 3016 3016 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_networkextension.dylib
unused shlib __TEXT 1fc897608-1fc8e5718 [ 312K 136K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fc8e5718-1fc8e6160 [ 2632 2632 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_asl.dylib
unused shlib __TEXT 1fc8e6160-1fc9af288 [ 804K 724K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fc9af288-1fc9af560 [ 728 728 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_symptoms.dylib
unused shlib __TEXT 1fc9af560-1fcae6480 [ 1244K 892K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fcae6480-1fcae78c0 [ 5K 5K 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_containermanager.dylib
unused shlib __TEXT 1fcae78c0-1fcbf6250 [ 1082K 842K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fcbf6250-1fcbf6560 [ 784 784 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_configuration.dylib
__AUTH_CONST 1fcbf6560-1fcbf6768 [ 520 520 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_sandbox.dylib
unused shlib __TEXT 1fcbf6768-1fcc3f8b8 [ 292K 212K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fcc3f8b8-1fcc3f9c0 [ 264 264 0K 0K] r--/rw- SM=COW /usr/lib/system/libquarantine.dylib
unused shlib __TEXT 1fcc3f9c0-1fccc6ac0 [ 540K 268K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fccc6ac0-1fccc6d50 [ 656 656 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_coreservices.dylib
unused shlib __TEXT 1fccc6d50-1fccf2d88 [ 176K 144K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fccf2d88-1fccf2da8 [ 32 32 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_m.dylib
unused shlib __TEXT 1fccf2da8-1fccf2e28 [ 128 128 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fccf2e28-1fccf2e98 [ 112 112 0K 0K] r--/rw- SM=COW /usr/lib/system/libmacho.dylib
unused shlib __TEXT 1fccf2e98-1fccf2fb0 [ 280 280 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
__AUTH_CONST 1fccf2fb0-1fccf3d80 [ 3536 3536 0K 0K] r--/rw- SM=COW /usr/lib/system/libcommonCrypto.dylib
__AUTH_CONST 1fccf3d80-1fccf3e98 [ 280 280 0K 0K] r--/rw- SM=COW /usr/lib/system/libunwind.dylib
__AUTH_CONST 1fccf3e98-1fccf4168 [ 720 720 0K 0K] r--/rw- SM=COW /usr/lib/liboah.dylib
__AUTH_CONST 1fccf4168-1fccf45a0 [ 1080 1080 0K 0K] r--/rw- SM=COW /usr/lib/system/libcopyfile.dylib
__AUTH_CONST 1fccf45a0-1fccf4600 [ 96 96 0K 0K] r--/rw- SM=COW /usr/lib/system/libcompiler_rt.dylib
__AUTH_CONST 1fccf4600-1fccf4750 [ 336 336 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_collections.dylib
__AUTH_CONST 1fccf4750-1fccf4a18 [ 712 712 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_secinit.dylib
__AUTH_CONST 1fccf4a18-1fccf4b78 [ 352 352 0K 0K] r--/rw- SM=COW /usr/lib/system/libremovefile.dylib
__AUTH_CONST 1fccf4b78-1fccf4bf8 [ 128 128 0K 0K] r--/rw- SM=COW /usr/lib/system/libkeymgr.dylib
__AUTH_CONST 1fccf4bf8-1fccf4db0 [ 440 440 0K 0K] r--/rw- SM=COW /usr/lib/system/libsystem_dnssd.dylib
__AUTH_CONST 1fccf4db0-1fccf4e70 [ 192 192 0K 0K] r--/rw- SM=COW /usr/lib/system/libcache.dylib
__AUTH_CONST 1fccf4e70-1fccf5120 [ 688 688 0K 0K] r--/rw- SM=COW /usr/lib/libSystem.B.dylib
__AUTH_CONST 1fccf5120-1fccf5208 [ 232 232 0K 0K] r--/rw- SM=COW /usr/lib/libfakelink.dylib
__AUTH_CONST 1fccf5208-1fccf5260 [ 88 88 0K 0K] r--/rw- SM=COW /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking
unused shlib __TEXT 1fccf5260-1ff928000 [ 44.2M 6603K 0K 0K] r--/rw- SM=COW system shared lib __TEXT not used by this process
Submap 1ff928000-200000000 [ 7008K 0K 0K 0K] r--/r-- SM=PRV process-only VM submap
Now I understand submaps and that all of these mini regions only happened after vmmap specified that the REGION TYPE (first column) was of type Submap and I did try along using mach_vm_region_recurse with depth greater than 0 however that only gave this:
1a2174000 to 1f1b30000
1f3b30000 to 1f669c000
1f869c000 to 1f86bc000
that was extra information - nothing even close to vmmap. I did try looking around and the closest thing I could try to find to fix this problem was the segment_command_64 struct defined as :
struct segment_command_64 { /* for 64-bit architectures */
uint32_t cmd; /* LC_SEGMENT_64 */
uint32_t cmdsize; /* includes sizeof section_64 structs */
char segname[16]; /* segment name */
uint64_t vmaddr; /* memory address of this segment */
uint64_t vmsize; /* memory size of this segment */
uint64_t fileoff; /* file offset of this segment */
uint64_t filesize; /* amount to map from the file */
vm_prot_t maxprot; /* maximum VM protection */
vm_prot_t initprot; /* initial VM protection */
uint32_t nsects; /* number of sections in segment */
uint32_t flags; /* flags */
};
along side the getsectbynamefromheader_64 function but I really couldn't figure anything out as there is 0 documentation for anything.
For parsing Mach-O segments, there is a fair bit of information out on the web about the Mach-O executable file format, which is what you're dealing with here, it's just mapped directly into memory.
Essentially though, each Mach-O segment (segment_command_64) will contain some number of sections (section_64). The sections are described in an array of section_64 structs immediately following the segment_command_64 struct. There will be nsects array entries. You can skip from segment to segment by moving cmdsize bytes ahead in memory. (The number of load commands you will encounter is specified in the ncmds field of the mach_header_64 file header. They won't all be segments (cmd == LC_SEGMENT_64) but share the load_command struct prefix.
The other thing to bear in mind about vmmap is that it has a whole bunch of special security entitlements which allow it more access to kernel APIs and data structures than most processes:
$ codesign -d --entitlements - /usr/bin/vmmap
Executable=/usr/bin/vmmap
??qq?<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.private.iosurfaceinfo</key>
<true/>
<key>com.apple.private.security.storage.AppDataContainers</key>
<true/>
<key>com.apple.security.iokit-user-client-class</key>
<array>
<string>IOSurfaceRootUserClient</string>
</array>
<key>com.apple.system-task-ports</key>
<true/>
<key>com.apple.system-task-ports.read</key>
<true/>
<key>com.apple.system-task-ports.read.safe</key>
<true/>
<key>com.apple.system-task-ports.safe</key>
<true/>
<key>task_for_pid-allow</key>
<true/>
</dict>
</plist>
However most of that is for allowing inspection of other processes - I'm not sure if those entitlements enable it to view more information than a regular process can get about itself.
Related
I am trying to build an embedded Linux to be run on PocketBeagle using Buildroot; and following the instructions in (source1). The resulting images are copied then to the uSD-card.
When inserting the uSD-card in the Pocketbeagle and monitor the booting process via a serial connection; I got the following error:
No filesystem could mount root, tried:
ext4
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1).
The used resources are:
Buildroot: 2018.02
File system: ext4
Bootloader: U-Boot (custom version 2018.01)
Kernel version: 4.14.24
Applying all the patches stated in source above and can be found in (source2):
- 0001-Stripped-back-pocketbeagle-devicetree.patch
- 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
- 0002-U-Boot-BeagleBone-Cape-Manager.patch
- 0003-pocketbeagle-tweaks.patch
Runing the build results in the following files and images:
MLO: First stage bootloader
U-boot.img: Second stage bootloader
uEnv.txt: U-boot environmnt
zImage: Linux kernel image
am335x-pocketbeagle.dtb: Linux kernel Device Tree Blob
rootfs.ext4: Root filesystem image
The uEnv.txt is as follows:
fdtfile=am335x-pocketbeagle.dtb
bootpart=0:1
bootdir=
bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait
uenvcmd=run loadimage;run loadfdt;printenv bootargs;bootz ${loadaddr} - ${fdtaddr};
Then by using genimage in buildroot (and rebuilding) to generate the uSd-image that contains two partitions:
1. FAT partition containing the bootloader images, the kernel image and Device Tree
2. Rootfs partition containing the root filesystem ext4
The resulting image is called sdcard.img is copies to the uSD-card by using program etcher (etcher-electron-1.4.3-x86_64.AppImage) or by (sudo dd if=output/images/sdcard.img of=/dev/mmcblk0 bs=1M)
I have used two different uSD-cards to test the build, but the result was the same:
1. Kingstone 32 GB (SDHC 10)
2. Sandisk 16GB (SDHC 10)
It's worth to say that I have used the same uSD-cards to load the original image of the PocketBeagle from the official site and boot from them, the cards boots without problem.
Any idea to help is highly appreciated.
ADDENDUM
Another error that is shown in the log file occurs in the beginning of the boot:
U-Boot SPL 2018.01 (Mar 24 2018 - 21:13:25)
Trying to boot from MMC1
*** Warning - bad CRC, using default environment
reading u-boot.img
reading u-boot.img
U-Boot 2018.01 (Mar 24 2018 - 21:13:25 +0100)
CPU : AM335X-GP rev 2.1 I2C: ready DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment
The full log is as follows:
U-Boot SPL 2018.01 (Mar 24 2018 - 21:13:25)
Trying to boot from MMC1
*** Warning - bad CRC, using default environment
reading u-boot.img
reading u-boot.img
U-Boot 2018.01 (Mar 24 2018 - 21:13:25 +0100)
CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment
Model: BeagleBoard.org PocketBeagle
<ethaddr> not set. Validating first E-fuse MAC
Net: No ethernet found.
Press SPACE to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
reading uEnv.txt
218 bytes read in 4 ms (52.7 KiB/s)
gpio: pin 55 (gpio 55) value is 1
Loaded environment from /uEnv.txt
Importing environment from mmc ...
Checking if uenvcmd is set ...
gpio: pin 56 (gpio 56) value is 1
Running uenvcmd ...
reading /zImage
5540120 bytes read in 351 ms (15.1 MiB/s)
loading /am335x-pocketbeagle.dtb ...
reading /am335x-pocketbeagle.dtb
33516 bytes read in 9 ms (3.6 MiB/s)
bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff4000, end 8ffff2eb ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.24 (ammar#ammar-System-Product-Name) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 SMP Sat Mar 24 21:23:50 CET 2018
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM335x PocketBeagle
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 16 MiB at 0x9e800000
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon)
[ 0.000000] random: fast init done
[ 0.000000] percpu: Embedded 17 pages/cpu #df93f000 s40872 r8192 d20568 u69632
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 129412
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 479900K/522240K available (8192K kernel code, 810K rwdata, 2412K rodata, 1024K init, 7547K bss, 25956K reserved, 16384K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xe0000000 - 0xff800000 ( 504 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xdfe00000 ( 510 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0900000 (9184 kB)
[ 0.000000] .init : 0xc0c00000 - 0xc0d00000 (1024 kB)
[ 0.000000] .data : 0xc0d00000 - 0xc0dca9b8 ( 811 kB)
[ 0.000000] .bss : 0xc0dcc000 - 0xc152af94 (7548 kB)
[ 0.000000] Running RCU self tests
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU event tracing is enabled.
[ 0.000000] RCU lockdep checking is enabled.
[ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[ 0.000017] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000044] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000097] OMAP clocksource: timer1 at 24000000 Hz
[ 0.000569] timer_probe: no matching timers found
[ 0.001470] Console: colour dummy device 80x30
[ 0.001516] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[ 0.001530] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.001542] ... MAX_LOCK_DEPTH: 48
[ 0.001554] ... MAX_LOCKDEP_KEYS: 8191
[ 0.001566] ... CLASSHASH_SIZE: 4096
[ 0.001578] ... MAX_LOCKDEP_ENTRIES: 32768
[ 0.001589] ... MAX_LOCKDEP_CHAINS: 65536
[ 0.001601] ... CHAINHASH_SIZE: 32768
[ 0.001613] memory used by lock dependency info: 4655 kB
[ 0.001626] per task-struct memory footprint: 1536 bytes
[ 0.001663] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[ 0.078740] pid_max: default: 32768 minimum: 301
[ 0.079147] Security Framework initialized
[ 0.079285] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.079306] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.082392] CPU: Testing write buffer coherency: ok
[ 0.083889] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[ 0.085406] Setting up static identity map for 0x80100000 - 0x80100078
[ 0.085975] Hierarchical SRCU implementation.
[ 0.087625] smp: Bringing up secondary CPUs ...
[ 0.087648] smp: Brought up 1 node, 1 CPU
[ 0.087665] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[ 0.087679] CPU: All CPU(s) started in SVC mode.
[ 0.091643] devtmpfs: initialized
[ 0.116033] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.116853] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.116916] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.118550] pinctrl core: initialized pinctrl subsystem
[ 0.123225] NET: Registered protocol family 16
[ 0.130326] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.171692] omap_hwmod: debugss: _wait_target_disable failed
[ 0.226390] cpuidle: using governor menu
[ 0.237629] OMAP GPIO hardware version 0.1
[ 0.262333] No ATAGs?
[ 0.262360] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.262655] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[ 0.262675] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[ 0.298256] edma 49000000.edma: TI EDMA DMA engine driver
[ 0.303666] SCSI subsystem initialized
[ 0.305374] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup#44c00000/scm#210000/pinmux#800/pinmux_i2c0_pins, deferring probe
[ 0.307447] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
[ 0.307764] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup#44c00000/scm#210000/pinmux#800/mma8452_pins_default, deferring probe
[ 0.308058] pps_core: LinuxPPS API ver. 1 registered
[ 0.308076] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti#linux.it>
[ 0.308128] PTP clock support registered
[ 0.312478] clocksource: Switched to clocksource timer1
[ 0.448001] VFS: Disk quotas dquot_6.6.0
[ 0.448193] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.473020] NET: Registered protocol family 2
[ 0.474843] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.474948] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
[ 0.476120] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.476506] UDP hash table entries: 256 (order: 2, 20480 bytes)
[ 0.476689] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[ 0.477446] NET: Registered protocol family 1
[ 0.479566] RPC: Registered named UNIX socket transport module.
[ 0.479614] RPC: Registered udp transport module.
[ 0.479629] RPC: Registered tcp transport module.
[ 0.479643] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.482107] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[ 0.483357] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[ 0.487455] audit: initializing netlink subsys (disabled)
[ 0.490304] audit: type=2000 audit(0.480:1): state=initialized audit_enabled=0 res=1
[ 0.490640] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[ 0.493682] NFS: Registering the id_resolver key type
[ 0.494058] Key type id_resolver registered
[ 0.494099] Key type id_legacy registered
[ 0.494253] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.500669] io scheduler noop registered
[ 0.500700] io scheduler deadline registered
[ 0.500822] io scheduler cfq registered (default)
[ 0.500841] io scheduler mq-deadline registered
[ 0.500856] io scheduler kyber registered
[ 0.503256] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
[ 0.510527] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
[ 0.516492] omap_uart 44e09000.serial: no wakeirq for uart0
[ 0.516942] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a OMAP UART0
[ 1.250345] console [ttyO0] enabled
[ 1.255586] omap_uart 48022000.serial: no wakeirq for uart1
[ 1.261829] 48022000.serial: ttyO1 at MMIO 0x48022000 (irq = 31, base_baud = 3000000) is a OMAP UART1
[ 1.272744] omap_uart 48024000.serial: no wakeirq for uart2
[ 1.278844] 48024000.serial: ttyO2 at MMIO 0x48024000 (irq = 32, base_baud = 3000000) is a OMAP UART2
[ 1.289570] omap_uart 481a8000.serial: no wakeirq for uart4
[ 1.295781] 481a8000.serial: ttyO4 at MMIO 0x481a8000 (irq = 33, base_baud = 3000000) is a OMAP UART4
[ 1.334046] brd: module loaded
[ 1.362138] loop: module loaded
[ 1.368162] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.383297] libphy: Fixed MDIO Bus: probed
[ 1.390588] i2c /dev entries driver
[ 1.398755] omap_hsmmc 48060000.mmc: Got CD GPIO
[ 1.465093] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.472542] oprofile: using arm/armv7
[ 1.477095] Initializing XFRM netlink socket
[ 1.481985] NET: Registered protocol family 10
[ 1.493215] Segment Routing with IPv6
[ 1.497190] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.505262] NET: Registered protocol family 17
[ 1.509973] NET: Registered protocol family 15
[ 1.515090] Key type dns_resolver registered
[ 1.519724] omap_voltage_late_init: Voltage driver support not added
[ 1.526481] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
[ 1.535007] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
[ 1.543566] ThumbEE CPU extension supported.
[ 1.548049] Registering SWP/SWPB emulation handler
[ 1.553116] SmartReflex Class3 initialized
[ 1.623490] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.635560] mmc0: new high speed SDHC card at address 0007
[ 1.644119] mmcblk0: mmc0:0007 SD32G 28.8 GiB
[ 1.655081] mmcblk0: p1 p2
[ 1.671199] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[ 1.677649] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[ 1.686633] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz
[ 1.694194] hctosys: unable to open rtc device (rtc0)
[ 1.699490] sr_init: No PMIC hook to init smartreflex
[ 1.705144] sr_init: platform driver register failed for SR
[ 1.720670] List of all partitions:
[ 1.724586] 0100 16384 ram0
[ 1.724597] (driver?)
[ 1.730999] 0101 16384 ram1
[ 1.731008] (driver?)
[ 1.737842] 0102 16384 ram2
[ 1.737854] (driver?)
[ 1.744389] 0103 16384 ram3
[ 1.744400] (driver?)
[ 1.750791] 0104 16384 ram4
[ 1.750800] (driver?)
[ 1.757269] 0105 16384 ram5
[ 1.757278] (driver?)
[ 1.763737] 0106 16384 ram6
[ 1.763746] (driver?)
[ 1.770139] 0107 16384 ram7
[ 1.770148] (driver?)
[ 1.776597] 0108 16384 ram8
[ 1.776607] (driver?)
[ 1.783061] 0109 16384 ram9
[ 1.783071] (driver?)
[ 1.789456] 010a 16384 ram10
[ 1.789465] (driver?)
[ 1.795999] 010b 16384 ram11
[ 1.796008] (driver?)
[ 1.802540] 010c 16384 ram12
[ 1.802549] (driver?)
[ 1.809029] 010d 16384 ram13
[ 1.809038] (driver?)
[ 1.815571] 010e 16384 ram14
[ 1.815580] (driver?)
[ 1.822056] 010f 16384 ram15
[ 1.822065] (driver?)
[ 1.828679] b300 30228480 mmcblk0
[ 1.828690] driver: mmcblk
[ 1.835867] b301 16384 mmcblk0p1 00000000-01
[ 1.835877]
[ 1.843044] b302 524288 mmcblk0p2 00000000-02
[ 1.843053]
[ 1.850164] No filesystem could mount root, tried:
[ 1.850173] ext4
[ 1.855340]
[ 1.858913] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1)
[ 1.867873] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,1)
The failure to mount the rootfs is occurring because the correct partition of the SDcard has not been specified.
In the kernel command line, the kernel is (incorrectly) instructed to find the rootfs in the partition corresponding to /dev/mmcblk0p1.
bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait
and
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait
However the mmc subsystem reports that there are two partitions on your SDcard, and the boot log reports the device names of these partitions for you twice.
First:
[ 1.635560] mmc0: new high speed SDHC card at address 0007
[ 1.644119] mmcblk0: mmc0:0007 SD32G 28.8 GiB
[ 1.655081] mmcblk0: p1 p2
And then:
[ 1.720670] List of all partitions:
...
[ 1.828679] b300 30228480 mmcblk0
[ 1.828690] driver: mmcblk
[ 1.835867] b301 16384 mmcblk0p1 00000000-01
[ 1.835877]
[ 1.843044] b302 524288 mmcblk0p2 00000000-02
So the kernel command line (through bootargs) should specify the second partition, /dev/mmcblk0p2, rather than the first partition for the rootfs.
Since the storage area for your U-Boot environment has not been properly initialized (i.e. the "Warning - bad CRC, using default environment" messages) (or your uEnv.txt file is missing or corrupt), U-Boot is booting the Linux kernel with a hardcoded bootargs value that is defined in your board's configuration file.
You could either edit that file and re-build U-Boot, or abort the autoboot and use
setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait and saveenv commands to correct this mis-specification.
I have a simple program:
#include <iostream>
int main() {
std::cout << "Starting" << std::endl;
while (1) {
}
return 0;
}
I compile and run it:
clang -o test test.cpp
bash$ ./test
Starting
In another terminal, I examine it and kill it:
bash$ top
Processes: 284 total, 3 running, 9 stuck, 272 sleeping, 1505 threads 14:45:49
Load Avg: 1.86, 1.81, 2.06 CPU usage: 13.57% user, 0.96% sys, 85.45% idle
SharedLibs: 21M resident, 12M data, 0B linkedit.
MemRegions: 87372 total, 4974M resident, 86M private, 1203M shared.
PhysMem: 15G used (1887M wired), 1450M unused.
VM: 729G vsize, 1064M framework vsize, 3299196(0) swapins, 3711511(0) swapouts.
Networks: packets: 2686338/648M in, 2068186/355M out.
Disks: 1141818/44G read, 1926370/100G written.
PID COMMAND %CPU TIME #TH #WQ #PORT MEM PURG CMPRS PGRP PPID STATE
30161 test 100.3 02:12.71 1/1 0 9 312K 0B 0B 29470 28181 running
66064 Terminal 2.7 01:29.69 9 3 257 53M 0B 4580K 66064 1 sleeping
bash$ ls -al /cores/
total 917024
drwxrwxr-t# 3 root admin 102 May 1 14:54 .
drwxr-xr-x 33 root wheel 1190 Apr 14 09:13 ..
bash$ killall -SIGSEGV test
bash$ ls -al /cores/
total 1818048
drwxrwxr-t# 4 root admin 136 May 1 14:55 .
drwxr-xr-x 33 root wheel 1190 Apr 14 09:13 ..
-r-------- 1 stebro admin 469516288 May 1 14:54 core.30161
vmmap says:
==== Summary for process 50745
ReadOnly portion of Libraries: Total=316K resident=280K(89%) swapped_out_or_unallocated=36K(11%)
Writable regions: Total=40.3M written=16K(0%) resident=12.1M(30%) swapped_out=14.4M(36%) unallocated=28.3M(70%)
REGION TYPE VIRTUAL
=========== =======
Kernel Alloc Once 4K
MALLOC 9388K see MALLOC ZONE table below
MALLOC (admin) 24K
STACK GUARD 56.0M
Stack 8192K
VM_ALLOCATE 4K
__DATA 680K
__LINKEDIT 70.9M
__TEXT 5960K
shared memory 4K
=========== =======
TOTAL 150.6M
VIRTUAL ALLOCATION BYTES
MALLOC ZONE SIZE COUNT ALLOCATED % FULL
=========== ======= ========= ========= ======
DefaultMallocZone_0x104a0e000 9216K 357 27K 0%
Why is my core file 469 MB?
Your core dump includes the complete state of memory as well as symbol information for the frameworks and libraries that your application was running with at the time. That's a lot of data. For more information you might check out the core dumps section of technical note 2124
Can anyone please help me fixing my xcode?
Whenever i try to start xcode it crashes see report:
Process: Xcode [705]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 7.3.1 (10188.1)
Build Info: IDEFrameworks-10188001000000000~3
App Item ID: 497799835
App External ID: 817226719
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [705]
User ID: 501
Date/Time: 2016-05-25 16:53:24.034 +0200
OS Version: Mac OS X 10.11.4 (15E65)
Report Version: 11
Anonymous UUID: D02DE49B-6ABC-FC9A-09FD-60215D357133
Time Awake Since Boot: 67 seconds
System Integrity Protection: enabled
Crashed Thread: 1 Dispatch queue: DVTFilePathEventWatcher - event queue
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0:
-->
__TEXT 0000000101e33000-0000000101e37000 [ 16K] r-x/rwx SM=COW /Applications/Xcode.app/Contents/MacOS/Xcode
Application Specific Information:
ProductBuildVersion: 7D1014
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff97d09fba lstat$INODE64 + 10
1 com.apple.Foundation 0x00007fff96f1ba37 _NSFileExistsAtPath + 200
2 com.apple.Foundation 0x00007fff96f1b871 -[NSFileManager fileExistsAtPath:] + 127
3 com.apple.dt.DVTFoundation 0x0000000101f65841 +[DVTPlatform _propertyDictionaryForPlatformAtPath:] + 136
4 com.apple.dt.DVTFoundation 0x0000000101f656c1 -[DVTPlatform initWithPath:] + 427
5 com.apple.dt.DVTFoundation 0x0000000101f65a6e +[DVTPlatform _loadPlatformAtPath:] + 65
6 com.apple.dt.DVTFoundation 0x0000000101f6615a __46+[DVTPlatform loadAllPlatformsReturningError:]_block_invoke + 1221
7 libdispatch.dylib 0x00007fff9154240b _dispatch_client_callout + 8
8 libdispatch.dylib 0x00007fff91542303 dispatch_once_f + 67
9 com.apple.dt.DVTFoundation 0x0000000101f65c8c +[DVTPlatform loadAllPlatformsReturningError:] + 283
10 com.apple.dt.IDEFoundation 0x0000000102b3fc8a IDEInitialize + 372
11 com.apple.dt.IDEKit 0x0000000103457336 -[IDEApplicationController _applicationWillFinishLaunching:] + 702
12 com.apple.dt.IDEKit 0x0000000103456e22 -[IDEApplicationController applicationWillFinishLaunching:] + 141
13 com.apple.CoreFoundation 0x00007fff9ba9dbbc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
14 com.apple.CoreFoundation 0x00007fff9ba9db4f ___CFXRegistrationPost_block_invoke + 63
15 com.apple.CoreFoundation 0x00007fff9ba9dac7 _CFXRegistrationPost + 407
16 com.apple.CoreFoundation 0x00007fff9ba9d832 ___CFXNotificationPost_block_invoke + 50
17 com.apple.CoreFoundation 0x00007fff9ba5a5e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
18 com.apple.CoreFoundation 0x00007fff9ba59835 _CFXNotificationPost + 693
19 com.apple.Foundation 0x00007fff96f1cfda -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
20 com.apple.dt.DVTFoundation 0x000000010202cadf -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] + 831
21 com.apple.AppKit 0x00007fff908e917e -[NSApplication finishLaunching] + 354
22 com.apple.dt.DVTKit 0x000000010259b1d4 -[DVTApplication finishLaunching] + 296
23 com.apple.AppKit 0x00007fff908e8cc1 -[NSApplication run] + 231
24 com.apple.AppKit 0x00007fff908b246c NSApplicationMain + 1176
25 com.apple.dt.Xcode 0x0000000101e3439b 0x101e33000 + 5019
26 libdyld.dylib 0x00007fff916b15ad start + 1
Thread 1 Crashed:: Dispatch queue: DVTFilePathEventWatcher - event queue
0 com.apple.CoreFoundation 0x00007fff9ba281e9 CFArrayGetCount + 25
1 com.apple.dt.DVTFoundation 0x0000000101f24e3b -[DVTFilePathEventWatcher _setupStream] + 667
2 com.apple.dt.DVTFoundation 0x0000000101f25369 -[DVTFilePathEventWatcher _resetStream] + 116
3 com.apple.dt.DVTFoundation 0x0000000101f24a07 __41-[DVTFilePathEventWatcher watchFilePath:]_block_invoke + 1111
4 com.apple.dt.DVTFoundation 0x00000001020b5667 __DVTDispatchAsync_block_invoke + 293
5 libdispatch.dylib 0x00007fff9154d93d _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x00007fff9154240b _dispatch_client_callout + 8
7 libdispatch.dylib 0x00007fff9154703b _dispatch_queue_drain + 754
8 libdispatch.dylib 0x00007fff9154d707 _dispatch_queue_invoke + 549
9 libdispatch.dylib 0x00007fff9154240b _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff9154629b _dispatch_root_queue_drain + 1890
11 libdispatch.dylib 0x00007fff91545b00 _dispatch_worker_thread3 + 91
12 libsystem_pthread.dylib 0x00007fff948f64de _pthread_wqthread + 1129
13 libsystem_pthread.dylib 0x00007fff948f4341 start_wqthread + 13
Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff97d09efa kevent_qos + 10
1 libdispatch.dylib 0x00007fff91548165 _dispatch_mgr_invoke + 216
2 libdispatch.dylib 0x00007fff91547dcd _dispatch_mgr_thread + 52
Thread 3:
0 libsystem_kernel.dylib 0x00007fff97d095e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff948f6578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff948f4341 start_wqthread + 13
Thread 4:
0 libsystem_kernel.dylib 0x00007fff97d095e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff948f6578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff948f4341 start_wqthread + 13
Thread 5:
0 libsystem_kernel.dylib 0x00007fff97d095e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff948f6578 _pthread_wqthread + 1283
2 libsystem_pthread.dylib 0x00007fff948f4341 start_wqthread + 13
Thread 1 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000001 rbx: 0x0000000000000000 rcx: 0x0000000000000030 rdx: 0x0000060000000600
rdi: 0x0000000000000000 rsi: 0x00007fff9be5da60 rbp: 0x0000700000080940 rsp: 0x0000700000080930
r8: 0x0000000000000040 r9: 0x00007fff79e331e0 r10: 0x00007fff9e609901 r11: 0x00007fff9ba281d0
r12: 0x00007fff924934c0 r13: 0x0000000000000002 r14: 0x00007fff924934c0 r15: 0x0000000000000000
rip: 0x00007fff9ba281e9 rfl: 0x0000000000010246 cr2: 0x0000000102120177
Logical CPU: 0
Error Code: 0x02000154
Trap Number: 133
Binary Images:( I SKIPPED THE BINARY IMAGES )
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 1
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 6066
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=373.9M resident=0K(0%) swapped_out_or_unallocated=373.9M(100%)
Writable regions: Total=61.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=61.1M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 2048K 2
CG shared images 144K 5
CoreUI image file 128K 2
Dispatch continuations 8192K 2
Foundation 4K 2
Kernel Alloc Once 8K 3
MALLOC 38.4M 19
MALLOC guard page 32K 7
Process Corpse Info 2048K 2
STACK GUARD 56.0M 7
Stack 10.1M 7
VM_ALLOCATE 40K 6
__DATA 36.2M 311
__IMAGE 528K 2
__LINKEDIT 106.6M 30
__TEXT 267.4M 302
__UNICODE 552K 2
mapped file 32.0M 5
shared memory 324K 8
=========== ======= =======
TOTAL 560.4M 705
Model: MacBookPro12,1, BootROM MBP121.0167.B16, 2 processors, Intel Core i5, 2,7 GHz, 8 GB, SMC 2.28f7
Graphics: Intel Iris Graphics 6100, Intel Iris Graphics 6100, Built-In
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1867 MHz, 0x80AD, 0x483943434E4E4E424C54414C41522D4E5544
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1867 MHz, 0x80AD, 0x483943434E4E4E424C54414C41522D4E5544
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.21.95.175.1a6)
Bluetooth: Version 4.4.4f4 17685, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0256G, 251 GB
USB Device: USB 3.0 Bus
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1
I tried reinstalling xcode and rebooting etc.
Anyway i think it has something to do with xcode pointing to a wrong memory location..
I use encfs to encode the personal documents that I keep on cloud drives. I have written a script that mounts the encoded folders at startup on MacOS, and it works flawlessly on two of my Macs. The third Mac (iMac 2008), though, fails to run encfs command, crashes with the error "illegal hardware instruction" that I have never encountered before. I wonder what is preventing encfs from running correctly.
I have installed "OSXFuse" using "Homebrew" along with some other fuse-based file systems such as sshfs and bindfs that I use regularly on the same iMac with no issue. I have the same version of Mavericks installed on all my computers (10.9.5).
Here is my brew config:
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: a0d9ecf1ce73acee32de0eca937d25dfa80b0cd5
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.9.5-x86_64
Xcode: 6.0.1
CLT: 6.0.0.0.1.1410400753
Clang: 6.0 build 600
X11: 2.7.5 => /opt/X11
System Ruby: 2.0.0-481
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/mah/.rvm/rubies/ruby-2.1.1/bin/ruby
Here is the crash log from the last crash:
Process: encfs [869]
Path: /usr/local/Cellar/encfs/1.7.5_1/bin/encfs
Identifier: encfs
Version: 0
Code Type: X86-64 (Native)
Parent Process: zsh [625]
Responsible: iTerm [616]
User ID: 501
Date/Time: 2014-09-29 15:41:15.243 -0400
OS Version: Mac OS X 10.9.5 (13F34)
Report Version: 11
Anonymous UUID: 74ECAA66-AC67-A002-50AB-F34FFEFA7DC2
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Application Specific Information:
/usr/local/lib/librlog.5.dylib
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 librlog.5.dylib 0x000000010df749b7 _GLOBAL__I_a + 7
1 dyld 0x00007fff6a5f0c2e ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 268
2 dyld 0x00007fff6a5f0dba ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
3 dyld 0x00007fff6a5eda62 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 308
4 dyld 0x00007fff6a5ed9eb ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189
5 dyld 0x00007fff6a5ed9eb ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189
6 dyld 0x00007fff6a5ed8f6 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
7 dyld 0x00007fff6a5e11da dyld::initializeMainExecutable() + 189
8 dyld 0x00007fff6a5e4560 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2419
9 dyld 0x00007fff6a5e027b dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 477
10 dyld 0x00007fff6a5e005e _dyld_start + 54
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000001 rbx: 0x000000010df749b0 rcx: 0x00007fff51d288c0 rdx: 0x00007fff51d28760
rdi: 0x0000000000000001 rsi: 0x00007fff51d28750 rbp: 0x00007fff51d276a0 rsp: 0x00007fff51d27690
r8: 0x00007fff6a613178 r9: 0x00007fff51d27600 r10: 0x00007fff964500e1 r11: 0x00007fff9598e6c6
r12: 0x0000000000000001 r13: 0x00007fff6a6130b0 r14: 0x00007fff6a61b4c0 r15: 0x000000010df7a378
rip: 0x000000010df749b7 rfl: 0x0000000000010246 cr2: 0x000000010df749b0
Logical CPU: 1
Error Code: 0x00000000
Trap Number: 6
Binary Images:
0x10ded7000 - 0x10dee9fff +encfs (0) <0CDF19BF-6E75-3CC4-BBCA-E8552FC2BE0F> /usr/local/bin/encfs
0x10defd000 - 0x10df33fff +libencfs.6.dylib (0) <30EA3D2B-3481-3CB5-9808-77A4E0C372EF> /usr/local/Cellar/encfs/1.7.5_1/lib/libencfs.6.dylib
0x10df72000 - 0x10df79ff7 +librlog.5.dylib (0) <B4C44B6B-BF72-3B1B-97F2-9BBC7EA64AA7> /usr/local/lib/librlog.5.dylib
0x10df89000 - 0x10dfc2ff7 +libssl.1.0.0.dylib (0) <C70E951B-86CD-3F4C-A1DC-6AB02B838B0F> /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
0x10dfde000 - 0x10e0effef +libcrypto.1.0.0.dylib (0) <B3590A5D-883A-337D-84F8-8217F641E340> /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
0x10e165000 - 0x10e189ff7 +libboost_serialization-mt.dylib (0) <EC54345E-8170-3663-82E7-0308E1BCCDCB> /usr/local/lib/libboost_serialization-mt.dylib
0x10e201000 - 0x10e20eff7 +libboost_filesystem-mt.dylib (0) <8A57889F-24FE-3923-87B1-9BE986A3A07E> /usr/local/lib/libboost_filesystem-mt.dylib
0x10e221000 - 0x10e223ff3 +libboost_system-mt.dylib (0) <28E41007-7056-3375-A009-BB8E0FC78AF1> /usr/local/lib/libboost_system-mt.dylib
0x10e22a000 - 0x10e233fff +libintl.8.dylib (0) <4E31E35C-6964-39DE-86EC-7CD308FBC206> /usr/local/opt/gettext/lib/libintl.8.dylib
0x10e23d000 - 0x10e257fff +libosxfuse_i64.2.dylib (0) <C638BF8A-4AF0-3F4E-9AF7-09CC5130F911> /usr/local/lib/libosxfuse_i64.2.dylib
0x7fff6a5df000 - 0x7fff6a612817 dyld (239.4) <7AD43B9B-5CEA-3C7E-9836-A06909F9CA56> /usr/lib/dyld
0x7fff884db000 - 0x7fff884f5fff libdispatch.dylib (339.92.1) <C4E4A18D-3C3B-3C9C-8709-A4270D998DE7> /usr/lib/system/libdispatch.dylib
0x7fff88939000 - 0x7fff8895dfff libxpc.dylib (300.90.2) <AB40CD57-F454-3FD4-B415-63B3C0D5C624> /usr/lib/system/libxpc.dylib
0x7fff8899e000 - 0x7fff8899eff7 libkeymgr.dylib (28) <3AA8D85D-CF00-3BD3-A5A0-E28E1A32A6D8> /usr/lib/system/libkeymgr.dylib
0x7fff88e26000 - 0x7fff88e27ff7 libsystem_blocks.dylib (63) <FB856CD1-2AEA-3907-8E9B-1E54B6827F82> /usr/lib/system/libsystem_blocks.dylib
0x7fff894b7000 - 0x7fff894bdff7 libsystem_platform.dylib (24.90.1) <3C3D3DA8-32B9-3243-98EC-D89B9A1670B3> /usr/lib/system/libsystem_platform.dylib
0x7fff8995d000 - 0x7fff8995eff7 libDiagnosticMessagesClient.dylib (100) <4CDB0F7B-C0AF-3424-BC39-495696F0DB1E> /usr/lib/libDiagnosticMessagesClient.dylib
0x7fff89e49000 - 0x7fff89e8bff7 libauto.dylib (185.5) <F45C36E8-B606-3886-B5B1-B6745E757CA8> /usr/lib/libauto.dylib
0x7fff89e8c000 - 0x7fff89eb5ff7 libc++abi.dylib (49.1) <21A807D3-6732-3455-B77F-743E9F916DF0> /usr/lib/libc++abi.dylib
0x7fff8bfb4000 - 0x7fff8bfb7ff7 libdyld.dylib (239.4) <7C9EC3B7-DDE3-33FF-953F-4067C743951D> /usr/lib/system/libdyld.dylib
0x7fff8cd6f000 - 0x7fff8cd71ff3 libsystem_configuration.dylib (596.15) <4998CB6A-9D54-390A-9F57-5D1AC53C135C> /usr/lib/system/libsystem_configuration.dylib
0x7fff8cdd8000 - 0x7fff8cf90ffb libicucore.A.dylib (511.35) <6F097DA7-147C-32A1-93D2-728A64CF0DC2> /usr/lib/libicucore.A.dylib
0x7fff8d0c7000 - 0x7fff8d0c8fff libunc.dylib (28) <62682455-1862-36FE-8A04-7A6B91256438> /usr/lib/system/libunc.dylib
0x7fff8d1bc000 - 0x7fff8d1c6fff libcommonCrypto.dylib (60049) <8C4F0CA0-389C-3EDC-B155-E62DD2187E1D> /usr/lib/system/libcommonCrypto.dylib
0x7fff8d1c7000 - 0x7fff8d1ceffb libcopyfile.dylib (103.92.1) <CF29DFF6-0589-3590-834C-82E2316612E8> /usr/lib/system/libcopyfile.dylib
0x7fff8db04000 - 0x7fff8dbf5ff9 libiconv.2.dylib (41) <BB44B115-AC32-3877-A0ED-AEC6232A4563> /usr/lib/libiconv.2.dylib
0x7fff8e3bf000 - 0x7fff8e3e6ffb libsystem_info.dylib (449.1.3) <7D41A156-D285-3849-A2C3-C04ADE797D98> /usr/lib/system/libsystem_info.dylib
0x7fff8f358000 - 0x7fff8f360fff libsystem_dnssd.dylib (522.92.1) <17B03FFD-92C5-3282-9981-EBB28B456207> /usr/lib/system/libsystem_dnssd.dylib
0x7fff900c9000 - 0x7fff900cafff libsystem_sandbox.dylib (278.11.1) <0D0B13EA-6B7A-3AC8-BE60-B548543BEB77> /usr/lib/system/libsystem_sandbox.dylib
0x7fff900cb000 - 0x7fff900f2ff7 libsystem_network.dylib (241.3) <8B1E1F1D-A5CC-3BAE-8B1E-ABC84337A364> /usr/lib/system/libsystem_network.dylib
0x7fff9057f000 - 0x7fff90586ff7 libsystem_pthread.dylib (53.1.4) <AB498556-B555-310E-9041-F67EC9E00E2C> /usr/lib/system/libsystem_pthread.dylib
0x7fff908f2000 - 0x7fff908f9ff8 liblaunch.dylib (842.92.1) <A40A0C7B-3216-39B4-8AE0-B5D3BAF1DA8A> /usr/lib/system/liblaunch.dylib
0x7fff908fa000 - 0x7fff90903ffb libsystem_notify.dylib (121.20.1) <9B34B4FE-F5AD-3F09-A5F0-46AFF3571323> /usr/lib/system/libsystem_notify.dylib
0x7fff91d1c000 - 0x7fff91d1eff7 libquarantine.dylib (71) <7A1A2BCB-C03D-3A25-BFA4-3E569B2D2C38> /usr/lib/system/libquarantine.dylib
0x7fff91d36000 - 0x7fff91d84fff libcorecrypto.dylib (161.1) <F3973C28-14B6-3006-BB2B-00DD7F09ABC7> /usr/lib/system/libcorecrypto.dylib
0x7fff922bc000 - 0x7fff922c0ff7 libcache.dylib (62) <BDC1E65B-72A1-3DA3-A57C-B23159CAAD0B> /usr/lib/system/libcache.dylib
0x7fff922c1000 - 0x7fff922c8fff libcompiler_rt.dylib (35) <4CD916B2-1B17-362A-B403-EF24A1DAC141> /usr/lib/system/libcompiler_rt.dylib
0x7fff92de2000 - 0x7fff92df3ff7 libsystem_asl.dylib (217.1.4) <655FB343-52CF-3E2F-B14D-BEBF5AAEF94D> /usr/lib/system/libsystem_asl.dylib
0x7fff939cc000 - 0x7fff939fbfd2 libsystem_m.dylib (3047.16) <B7F0E2E4-2777-33FC-A787-D6430B630D54> /usr/lib/system/libsystem_m.dylib
0x7fff93c9e000 - 0x7fff93ca3ff7 libunwind.dylib (35.3) <78DCC358-2FC1-302E-B395-0155B47CB547> /usr/lib/system/libunwind.dylib
0x7fff94330000 - 0x7fff94341ff7 libz.1.dylib (53) <42E0C8C6-CA38-3CA4-8619-D24ED5DD492E> /usr/lib/libz.1.dylib
0x7fff94342000 - 0x7fff9435eff7 libsystem_kernel.dylib (2422.115.4) <9EDE872E-2A9E-3A78-8E1D-AB790794A098> /usr/lib/system/libsystem_kernel.dylib
0x7fff9448e000 - 0x7fff9448fff7 libSystem.B.dylib (1197.1.1) <E303F2F8-A8CF-3DF3-84B3-F2D0EE41CCF6> /usr/lib/libSystem.B.dylib
0x7fff9496c000 - 0x7fff94987ff7 libsystem_malloc.dylib (23.10.1) <A695B4E4-38E9-332E-A772-29D31E3F1385> /usr/lib/system/libsystem_malloc.dylib
0x7fff94ed6000 - 0x7fff94edbfff libmacho.dylib (845) <1D2910DF-C036-3A82-A3FD-44FF73B5FF9B> /usr/lib/system/libmacho.dylib
0x7fff9528d000 - 0x7fff95472fff com.apple.CoreFoundation (6.9 - 855.17) <729BD6DA-1F63-3E72-A148-26F21EBF52BB> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff9555e000 - 0x7fff9555fffb libremovefile.dylib (33) <3543F917-928E-3DB2-A2F4-7AB73B4970EF> /usr/lib/system/libremovefile.dylib
0x7fff955ee000 - 0x7fff955f2ff7 libsystem_stats.dylib (93.90.3) <4E51D5B0-92A0-3D0D-B90E-495A1ED3E391> /usr/lib/system/libsystem_stats.dylib
0x7fff95781000 - 0x7fff9592ef27 libobjc.A.dylib (551.1) <AD7FD984-271E-30F4-A361-6B20319EC73B> /usr/lib/libobjc.A.dylib
0x7fff95931000 - 0x7fff959baff7 libsystem_c.dylib (997.90.3) <6FD3A400-4BB2-3B95-B90C-BE6E9D0D78FA> /usr/lib/system/libsystem_c.dylib
0x7fff95cfe000 - 0x7fff95d50fff libc++.1.dylib (120) <4F68DFC5-2077-39A8-A449-CAC5FDEE7BDE> /usr/lib/libc++.1.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 630
thread_create: 1
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=78.9M resident=54.4M(69%) swapped_out_or_unallocated=24.5M(31%)
Writable regions: Total=17.7M written=336K(2%) resident=404K(2%) swapped_out=0K(0%) unallocated=17.3M(98%)
REGION TYPE VIRTUAL
=========== =======
Kernel Alloc Once 4K
MALLOC 9396K
MALLOC (admin) 16K
STACK GUARD 56.0M
Stack 8192K
VM_ALLOCATE 8K
__DATA 1352K
__LINKEDIT 67.3M
__TEXT 11.6M
__UNICODE 544K
shared memory 4K
=========== =======
TOTAL 154.0M
Here I am running two instance of same program in two different terminals. The process map of them are
In first terminal -
vikram#vikram-Studio-XPS-1645:~$ pmap 6548
6548: ./a.out
0000000000400000 4K r-x-- /home/vikram/a.out
0000000000600000 4K r---- /home/vikram/a.out
0000000000601000 4K rw--- /home/vikram/a.out
00007f90f2406000 1576K r-x-- /lib/x86_64-linux-gnu/libc-2.13.so
00007f90f2590000 2044K ----- /lib/x86_64-linux-gnu/libc-2.13.so
00007f90f278f000 16K r---- /lib/x86_64-linux-gnu/libc-2.13.so
00007f90f2793000 4K rw--- /lib/x86_64-linux-gnu/libc-2.13.so
00007f90f2794000 24K rw--- [ anon ]
00007f90f279a000 132K r-x-- /lib/x86_64-linux-gnu/ld-2.13.so
00007f90f2992000 12K rw--- [ anon ]
00007f90f29b7000 12K rw--- [ anon ]
00007f90f29ba000 4K r---- /lib/x86_64-linux-gnu/ld-2.13.so
00007f90f29bb000 8K rw--- /lib/x86_64-linux-gnu/ld-2.13.so
00007fffb2333000 132K rw--- [ stack ]
00007fffb23ff000 4K r-x-- [ anon ]
ffffffffff600000 4K r-x-- [ anon ]
total 3984K
In second terminal -
vikram#vikram-Studio-XPS-1645:~$ pmap 6676
6676: ./a.out
0000000000400000 4K r-x-- /home/vikram/a.out
0000000000600000 4K r---- /home/vikram/a.out
0000000000601000 4K rw--- /home/vikram/a.out
00007f3b0ad37000 1576K r-x-- /lib/x86_64-linux-gnu/libc-2.13.so
00007f3b0aec1000 2044K ----- /lib/x86_64-linux-gnu/libc-2.13.so
00007f3b0b0c0000 16K r---- /lib/x86_64-linux-gnu/libc-2.13.so
00007f3b0b0c4000 4K rw--- /lib/x86_64-linux-gnu/libc-2.13.so
00007f3b0b0c5000 24K rw--- [ anon ]
00007f3b0b0cb000 132K r-x-- /lib/x86_64-linux-gnu/ld-2.13.so
00007f3b0b2c3000 12K rw--- [ anon ]
00007f3b0b2e8000 12K rw--- [ anon ]
00007f3b0b2eb000 4K r---- /lib/x86_64-linux-gnu/ld-2.13.so
00007f3b0b2ec000 8K rw--- /lib/x86_64-linux-gnu/ld-2.13.so
00007fffb1153000 132K rw--- [ stack ]
00007fffb11c7000 4K r-x-- [ anon ]
ffffffffff600000 4K r-x-- [ anon ]
total 3984K
My questions are -
"/lib/x86_64-linux-gnu/ld-2.13.so" this library has two different addresses in terminal 1 and 2 ( 00007f90f279a000 and 00007f3b0b0cb000 ). Is it means this library is loaded 2 times in main memory ?
Assuming a.out is binary of simple Hello_World.c program
#include<stdio.h>
void main()
{ printf("Hello World");}
then which part of a.out has r & w permission ?
In simple words which part of source " 0000000000601000 4K rw--- /home/vikram/a.out " this segment is suppose to contain ?
Why anon is not continuous like other segments ?
What " 00007f90f2590000 2044K ----- /lib/x86_64-linux-gnu/libc-2.13.so " this segment suppose to contain .... because it doesn't have read, write, execute permissions.
1) Dynamic loader or the ld is the first to be executed after OS starts the process. Those address are virtual addresses of the process, but would ultimately map to same physical memory.
2) data segment of the process. (both initialized data and BSS)
3) Its used various purposes such as heap, mmap and any sharedmemory etc.
4) AFAIK its internal private data.