libimobiledevice / idevicerestore

Restore/upgrade firmware of iOS devices
https://libimobiledevice.org
GNU Lesser General Public License v3.0
1.32k stars 391 forks source link

hang at Checkpoint 3844 complete with code 0 #593

Open iOSPrincekin opened 1 year ago

iOSPrincekin commented 1 year ago

iphone 5s, iOS 12.5.7 macos 13.0 iPhone_4.0_64bit_12.5.7_16H81_Restore.ipsw command:idevicerestore -i 6283712406792 -l always hang at Checkpoint 3844 complete with code 0,any help will be a pleasure, Thanks a lot!

` libimobiledevice 1.3.0-190-g6fc41f5 Found device in Recovery mode ECID: 6283712406792 Identified device as n53ap, iPhone6,2 The following firmwares are currently being signed for iPhone6,2: [1] 12.5.7 (build 16H81) Select the firmware you want to restore: 1 1 Selected firmware 12.5.7 (build 16H81) Verifying 'iPhone_4.0_64bit_12.5.7_16H81_Restore.ipsw'...

Checksum matches. Extracting BuildManifest from IPSW Product Version: 12.5.7 Product Build: 16H81 Major: 16 INFO: device serial number is DQGPWCEMFRC6 Device supports Image4: true Variant: Customer Upgrade Install (IPSW) This restore will update the device without erasing user data. Checking IPSW for required components... All required components found in IPSW Using cached filesystem from 'iPhone_4.0_64bit_12.5.7_16H81_Restore/038-87199-051.dmg' Getting ApNonce in recovery mode... c3 23 ed 4f 7c 9b 37 b4 53 86 9c b6 7f 75 f5 6d 40 39 85 22 Trying to fetch new SHSH blob Getting SepNonce in recovery mode... 54 85 be 20 f3 e1 02 90 ce 9e 50 82 10 92 9d 93 22 c2 72 88 Request URL set to https://gs.apple.com/TSS/controller?action=2 Sending TSS request attempt 1... response successfully received Received SHSH blobs Extracting iBEC.iphone6.RELEASE.im4p (Firmware/dfu/iBEC.iphone6.RELEASE.im4p)... Personalizing IMG4 component iBEC... Sending iBEC (731057 bytes)... Recovery Mode Environment: iBoot build-version=iBoot-4513.270.14 iBoot build-style=RELEASE Sending RestoreLogo... Extracting applelogo@2x~iphone.im4p (Firmware/all_flash/applelogo@2x~iphone.im4p)... Personalizing IMG4 component RestoreLogo... Sending RestoreLogo (11857 bytes)... Extracting 038-87260-065.dmg.trustcache (Firmware/038-87260-065.dmg.trustcache)... Personalizing IMG4 component RestoreTrustCache... Sending RestoreTrustCache (9336 bytes)... ramdisk-size=0x10000000 Extracting 038-87260-065.dmg (038-87260-065.dmg)... Personalizing IMG4 component RestoreRamDisk... Sending RestoreRamDisk (93958382 bytes)... Extracting DeviceTree.n53ap.im4p (Firmware/all_flash/DeviceTree.n53ap.im4p)... Personalizing IMG4 component RestoreDeviceTree... Sending RestoreDeviceTree (109009 bytes)... Extracting sep-firmware.n53.RELEASE.im4p (Firmware/all_flash/sep-firmware.n53.RELEASE.im4p)... Personalizing IMG4 component RestoreSEP... Sending RestoreSEP (2606433 bytes)... Extracting kernelcache.release.iphone6 (kernelcache.release.iphone6)... Personalizing IMG4 component RestoreKernelCache... Sending RestoreKernelCache (13337438 bytes)... Waiting for device to enter restore mode... About to restore device... Connecting now... Connected to com.apple.mobile.restored, version 15 Device dc4f477bd5602d9401b6c5ad6069c2c720ddcfd5 has successfully entered restore mode Hardware Information: BoardID: 2 ChipID: 35168 UniqueChipID: 6283712406792 ProductionMode: true Starting FDR listener thread Checkpoint 1621 complete with code 0 Checkpoint 1540 complete with code 0 Checkpoint 1544 complete with code 0 About to send RootTicket... Sending RootTicket now... Done sending RootTicket Checkpoint 1547 complete with code 0 Waiting for NAND (28) Checkpoint 1549 complete with code 0 Checkpoint 1550 complete with code 0 Checkpoint 1551 complete with code 0 Checkpoint 1628 complete with code 0 Checkpoint 1552 complete with code 0 Checkpoint 1555 complete with code 0 Checkpoint 1662 complete with code 0 About to send NORData... Found firmware path Firmware/all_flash Getting firmware manifest from build identity Extracting LLB.iphone6.RELEASE.im4p (Firmware/all_flash/LLB.iphone6.RELEASE.im4p)... Personalizing IMG4 component LLB... Extracting applelogo@2x~iphone.im4p (Firmware/all_flash/applelogo@2x~iphone.im4p)... Personalizing IMG4 component AppleLogo... Extracting batterycharging0@2x~iphone.im4p (Firmware/all_flash/batterycharging0@2x~iphone.im4p)... Personalizing IMG4 component BatteryCharging0... Extracting batterycharging1@2x~iphone.im4p (Firmware/all_flash/batterycharging1@2x~iphone.im4p)... Personalizing IMG4 component BatteryCharging1... Extracting batteryfull@2x~iphone.im4p (Firmware/all_flash/batteryfull@2x~iphone.im4p)... Personalizing IMG4 component BatteryFull... Extracting batterylow0@2x~iphone.im4p (Firmware/all_flash/batterylow0@2x~iphone.im4p)... Personalizing IMG4 component BatteryLow0... Extracting batterylow1@2x~iphone.im4p (Firmware/all_flash/batterylow1@2x~iphone.im4p)... Personalizing IMG4 component BatteryLow1... Extracting glyphplugin@1136~iphone-lightning.im4p (Firmware/all_flash/glyphplugin@1136~iphone-lightning.im4p)... Personalizing IMG4 component BatteryPlugin... Extracting DeviceTree.n53ap.im4p (Firmware/all_flash/DeviceTree.n53ap.im4p)... Personalizing IMG4 component DeviceTree... Extracting recoverymode@1136~iphone-lightning.im4p (Firmware/all_flash/recoverymode@1136~iphone-lightning.im4p)... Personalizing IMG4 component RecoveryMode... Extracting iBoot.iphone6.RELEASE.im4p (Firmware/all_flash/iBoot.iphone6.RELEASE.im4p)... Personalizing IMG4 component iBoot... Extracting sep-firmware.n53.RELEASE.im4p (Firmware/all_flash/sep-firmware.n53.RELEASE.im4p)... Personalizing IMG4 component RestoreSEP... Extracting sep-firmware.n53.RELEASE.im4p (Firmware/all_flash/sep-firmware.n53.RELEASE.im4p)... Personalizing IMG4 component SEP... Sending NORData now... Done sending NORData Checkpoint 1545 complete with code 0 Checking filesystems (15) Checkpoint 1637 complete with code 0 Checking filesystems (15) Checkpoint 1556 complete with code 0 Checkpoint 1620 complete with code 0 Checkpoint 1557 complete with code 0 Checkpoint 1558 complete with code 0 Checkpoint 1559 complete with code 0 Checkpoint 1560 complete with code 0 Checkpoint 1561 complete with code 0 ERROR: Unable to receive message from FDR 0x600000298160 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x600000298420 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x600000286f80 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x600000298060 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x600000227320 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x60000025dfc0 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x600000263c20 (-2). 0/2 bytes ERROR: Unable to receive message from FDR 0x600000263c60 (-2). 0/2 bytes Checkpoint 1562 complete with code 0 ERROR: Unable to receive message from FDR 0x60000026cda0 (-2). 0/2 bytes Checkpoint 1563 complete with code 0 Checkpoint 1633 complete with code 0 Unmounting filesystems (29) Unmounting filesystems (29) Unmounting filesystems (29) Checkpoint 1565 complete with code 0 Checkpoint 1614 complete with code 0 Checkpoint 1619 complete with code 0 Checkpoint 1567 complete with code 0 Checkpoint 1632 complete with code 0 Checkpoint 1570 complete with code 0 Checkpoint 1629 complete with code 0 Creating filesystem (12) Checkpoint 1624 complete with code 0 Checkpoint 1625 complete with code 0 Checkpoint 1631 complete with code 0 Checkpoint 1634 complete with code 0 Checkpoint 1626 complete with code 0 About to send filesystem... Connected to ASR Validating the filesystem Filesystem validated Sending filesystem now...

[= ] 1.0% [== ] 2.0% [== ] 3.0% [=== ] 4.0% [=== ] 5.0% [==== ] 6.0% [==== ] 7.0% [===== ] 8.0% [===== ] 9.0% [====== ] 10.0% [====== ] 11.0% [======= ] 12.0% [======= ] 13.0% [======== ] 14.0% [======== ] 15.0% [========= ] 16.0% [========= ] 17.0% [========== ] 18.0% [========== ] 19.0% [=========== ] 20.0% [=========== ] 21.0% [============ ] 22.0% [============ ] 23.0% [============= ] 24.0% [============= ] 25.0% [============== ] 26.0% [============== ] 27.0% [=============== ] 28.0% [=============== ] 29.0% [================ ] 30.0% [================ ] 31.0% [================= ] 32.0% [================= ] 33.0% [================== ] 34.0% [================== ] 35.0% [=================== ] 36.0% [=================== ] 37.0% [==================== ] 38.0% [==================== ] 39.0% [===================== ] 40.0% [===================== ] 41.0% [====================== ] 42.0% [====================== ] 43.0% [======================= ] 44.0% [======================= ] 45.0% [======================== ] 46.0% [======================== ] 47.0% [========================= ] 48.0% [========================= ] 49.0%ERROR: Unable to receive message from FDR 0x6000002881a0 (-7). 0/2 bytes

[========================== ] 50.0% [========================== ] 51.0% [=========================== ] 52.0% [=========================== ] 53.0% [============================ ] 54.0% [============================ ] 55.0% [============================= ] 56.0% [============================= ] 57.0% [============================== ] 58.0% [============================== ] 59.0% [=============================== ] 60.0% [=============================== ] 61.0% [================================ ] 62.0% [================================ ] 63.0% [================================= ] 64.0% [================================= ] 65.0% [================================== ] 66.0% [================================== ] 67.0% [=================================== ] 68.0% [=================================== ] 69.0% [==================================== ] 70.0% [==================================== ] 71.0% [===================================== ] 72.0% [===================================== ] 73.0% [====================================== ] 74.0% [====================================== ] 75.0% [======================================= ] 76.0% [======================================= ] 77.0% [======================================== ] 78.0% [======================================== ] 79.0% [========================================= ] 80.0% [========================================= ] 81.0% [========================================== ] 82.0% [========================================== ] 83.0% [=========================================== ] 84.0% [=========================================== ] 85.0% [============================================ ] 86.0% [============================================ ] 87.0% [============================================= ] 88.0% [============================================= ] 89.0% [============================================== ] 90.0% [============================================== ] 91.0% [=============================================== ] 92.0% [=============================================== ] 93.0% [================================================ ] 94.0% [================================================ ] 95.0% [================================================= ] 96.0% [================================================= ] 97.0% [==================================================] 98.0% [==================================================] 99.0% [==================================================] 100.0% Done sending filesystem Verifying restore (14)

[= ] 2.0% [== ] 4.0% [=== ] 6.0% [==== ] 8.0% [===== ] 10.0% [====== ] 12.0% [======== ] 14.0% [======== ] 16.0% [========= ] 18.0% [========== ] 20.0% [=========== ] 22.0% [============ ] 24.0% [============= ] 26.0% [=============== ] 28.0% [=============== ] 30.0% [================ ] 32.0% [================= ] 34.0% [================== ] 36.0% [=================== ] 38.0% [==================== ] 40.0% [===================== ] 42.0% [====================== ] 44.0% [======================= ] 46.0% [======================== ] 48.0% [========================= ] 50.0% [========================== ] 52.0% [=========================== ] 54.0% [============================= ] 56.0% [============================= ] 58.0% [============================== ] 60.0% [=============================== ] 62.0% [================================ ] 64.0% [================================= ] 66.0% [================================== ] 68.0% [=================================== ] 70.0% [==================================== ] 72.0% [===================================== ] 74.0% [====================================== ] 76.0% [======================================= ] 78.0% [======================================== ] 80.0% [========================================= ] 82.0% [========================================== ] 84.0% [=========================================== ] 86.0% [============================================ ] 88.0% [============================================= ] 90.0% [============================================== ] 92.0% [=============================================== ] 94.0% [================================================ ] 96.0% [================================================= ] 98.0% [==================================================] 100.0% Checkpoint 1627 complete with code 0 Checking filesystems (15) Checking filesystems (15) Checking filesystems (15) Mounting filesystems (16) Mounting filesystems (16) Checkpoint 1574 complete with code 0 Checkpoint 1575 complete with code 0 About to send KernelCache... Extracting kernelcache.release.iphone6 (kernelcache.release.iphone6)... Personalizing IMG4 component KernelCache... Sending KernelCache now... Done sending KernelCache Installing kernelcache (27) Checkpoint 3584 complete with code 0 About to send DeviceTree... Extracting DeviceTree.n53ap.im4p (Firmware/all_flash/DeviceTree.n53ap.im4p)... Personalizing IMG4 component DeviceTree... Sending DeviceTree now... Done sending DeviceTree Installing DeviceTree (61) Checkpoint 3585 complete with code 0 Checkpoint 3586 complete with code 0 Checkpoint 3587 complete with code 0 Checkpoint 1576 complete with code 0 Checkpoint 1618 complete with code 0 Checkpoint 1588 complete with code 0 Flashing firmware (18)

[==================================================] 100.0% Checkpoint 4864 complete with code 0 Requesting FUD data (36) Found IsFUDFirmware component RestoreTrustCache Found IsFUDFirmware component StaticTrustCache Sending IsFUDFirmware image list Extracting 038-87260-065.dmg.trustcache (Firmware/038-87260-065.dmg.trustcache)... Personalizing IMG4 component RestoreTrustCache... Sending IsFUDFirmware for RestoreTrustCache... Extracting 038-87199-051.dmg.trustcache (Firmware/038-87199-051.dmg.trustcache)... Personalizing IMG4 component StaticTrustCache... Sending IsFUDFirmware for StaticTrustCache... Checkpoint 4294972170 complete with code 0 Updating gas gauge software (47) Checkpoint 4294972161 complete with code 0 Updating gas gauge software (47) Checkpoint 4294972162 complete with code 0 Updating Stockholm (55) Checkpoint 4294972164 complete with code 0 Requesting FUD data (36) Found IsFUDFirmware component RestoreTrustCache Found IsFUDFirmware component StaticTrustCache Sending IsFUDFirmware image list Checkpoint 4294972172 complete with code 0 Checkpoint 9871890447620641542 complete with code 0 Checkpoint 4294972167 complete with code 0 Checkpoint 4294972168 complete with code 0 Checkpoint 4294972174 complete with code 0 Checkpoint 18446744069414589199 complete with code 0 Checkpoint 4294972171 complete with code 0 Updating baseband (19) About to send BasebandData... Sending Baseband TSS request... Request URL set to https://gs.apple.com/TSS/controller?action=2 Sending TSS request attempt 1... response successfully received Received Baseband SHSH blobs Sending BasebandData now... Done sending BasebandData Updating baseband (19) Updating baseband (19) Updating baseband (19) Updating baseband (19) Updating Baseband in progress... About to send BasebandData... Sending Baseband TSS request... Request URL set to https://gs.apple.com/TSS/controller?action=2 Sending TSS request attempt 1... response successfully received Received Baseband SHSH blobs Sending BasebandData now... Done sending BasebandData Updating Baseband in progress... About to send BasebandData... Sending BasebandData now... Done sending BasebandData Updating baseband (19) Updating baseband (19) Updating baseband (19) Updating Baseband in progress... About to send BasebandData... Sending BasebandData now... Done sending BasebandData Updating baseband (19) Updating baseband (19) Updating baseband (19) Updating baseband (19) Updating baseband (19) Updating Baseband completed. Checkpoint 4294972163 complete with code 0 Checkpoint 4294972169 complete with code 0 Checkpoint 18446744069414589197 complete with code 0 Checkpoint 1589 complete with code 0 Checkpoint 1635 complete with code 0 Checkpoint 1596 complete with code 0 Checkpoint 1647 complete with code 0 Fixing up /var (17) Checkpoint 3840 complete with code 0 Checkpoint 3841 complete with code 0 Checkpoint 3842 complete with code 0 Checkpoint 3846 complete with code 0 Checkpoint 3843 complete with code 0 Checkpoint 3844 complete with code 0

`

iOSPrincekin commented 1 year ago

I find it hang at sret = select(fd + 1, &fds, NULL, NULL, pto); , but when I using i4Tools to flash the iPhone_4.0_64bit_12.5.7_16H81_Restore.ipsw to iPhone5s, has no this problem,I don't know why

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007ff80c119292 libsystem_kernel.dylib`__select + 10
  * frame #1: 0x000000010005f451 idevicerestore`socket_check_fd(fd=9, fdm=FDM_READ, timeout=90000) at socket.c:1129:11
    frame #2: 0x000000010005f727 idevicerestore`socket_receive_timeout(fd=9, data=0x00007ff7bfefd21c, length=4, flags=0, timeout=90000) at socket.c:1212:8
    frame #3: 0x0000000100066811 idevicerestore`usbmuxd_recv_timeout(sfd=9, data="", len=4, recv_bytes=0x00007ff7bfefd1bc, timeout=90000) at libusbmuxd.c:1609:18
    frame #4: 0x000000010005188e idevicerestore`internal_connection_receive_timeout(connection=0x0000600000c77540, data="", len=4, recv_bytes=0x00007ff7bfefd1bc, timeout=90000) at idevice.c:759:20
    frame #5: 0x0000000100051817 idevicerestore`idevice_connection_receive_timeout(connection=0x0000600000c77540, data="", len=4, recv_bytes=0x00007ff7bfefd1bc, timeout=90000) at idevice.c:846:9
    frame #6: 0x0000000100068b59 idevicerestore`service_receive_with_timeout(client=0x0000600000028090, data="", size=4, received=0x00007ff7bfefd218, timeout=90000) at service.c:166:33
    frame #7: 0x000000010006df4b idevicerestore`internal_plist_receive_timeout(client=0x0000600000028010, plist=0x00007ff7bfefd4e0, timeout=90000) at property_list_service.c:195:25
    frame #8: 0x000000010006e352 idevicerestore`property_list_service_receive_plist(client=0x0000600000028010, plist=0x00007ff7bfefd4e0) at property_list_service.c:273:9
    frame #9: 0x000000010007f49b idevicerestore`restored_receive(client=0x000060000028c6c0, plist=0x00007ff7bfefd4e0) at restore.c:157:24
    frame #10: 0x0000000100043251 idevicerestore`restore_device(client=0x0000000101304860, build_identity=0x0000600000c5ff00, filesystem="iPhone_4.0_64bit_12.5.7_16H81_Restore/038-87199-051.dmg") at restore.c:4261:19
    frame #11: 0x0000000100027baf idevicerestore`idevicerestore_start(client=0x0000000101304860) at idevicerestore.c:1396:12
    frame #12: 0x000000010002b978 idevicerestore`main(argc=0, argv=0x00007ff7bfeff5a0) at idevicerestore.c:1803:11
    frame #13: 0x00007ff80bdf541f dyld`start + 1903
nikias commented 12 months ago

In this stage, idevicerestore is waiting for something coming from the device. If it doesn't then the device seems to get stuck, but I don't see any reason why idevicerestore would be the reason. Usually if "we" do something wrong, the process is aborted with an error.