Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App lifecycle error #93

Closed
sanidhya-saraswat opened this issue Feb 24, 2023 · 6 comments
Closed

App lifecycle error #93

sanidhya-saraswat opened this issue Feb 24, 2023 · 6 comments

Comments

@sanidhya-saraswat
Copy link
Contributor

While running demo/app_lifecycle.py on the latest code, getting this error:

This issue also occurs, while using the pip module.

2023-02-24 15:42:06 [INFO] [LockDown] lockdown.py[line:73] Connecting Device xxxxxx-xxxxxxxx
2023-02-24 15:42:06 [INFO] [Instrument] Instrument.py[line:22] InstrumentServer init ...
2023-02-24 15:42:06 [INFO] [Instrument] dvt.py[line:167] set com.apple.instruments.server.services.coreprofilesessiontap callback ...
2023-02-24 15:42:06 [INFO] [LockDown] lockdown.py[line:73] Connecting Device xxxxx-xxxxxxx 
2023-02-24 15:42:06 [INFO] [Instrument] Instrument.py[line:22] InstrumentServer init ...
2023-02-24 15:42:06 [ERROR] [Instrument] dvt.py[line:252] could not find container end marker
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/servers/dvt.py", line 239, in _receiver
    self._channel_callbacks[(2 ** 32 - dtx.channel_code)](dtx)
  File "/Users/sanidhya/repos/py-ios-device/demo/instrument_demo/app_lifecycle.py", line 32, in on_graphics_message
    demo(res.selector.data)
  File "/Users/sanidhya/repos/py-ios-device/demo/instrument_demo/app_lifecycle.py", line 22, in demo
    for event in Kperf.to_dict(data):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kperf_data.py", line 1021, in to_dict
    for event in self.parse(kd_buf):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kperf_data.py", line 971, in parse
    yield kc_data_parse(buf_io.read())
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 1710, in kc_data_parse
    for i, kcdata_buffer in enumerate(iterate_kcdatas(data)):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 1667, in iterate_kcdatas
    kcdata_buffer.ReadItems(iterator)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 670, in ReadItems
    o.ReadItems(iterator)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 670, in ReadItems
    o.ReadItems(iterator)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 677, in ReadItems
    raise Exception(self.no_end_message)
Exception: could not find container end marker
start notion.id pid:22491```
@YueChen-C
Copy link
Owner

YueChen-C commented Feb 27, 2023

I need the iPhone model and os version to test

@sanidhya-saraswat
Copy link
Contributor Author

iPhone 13, OS Version: 16.2

@sanidhya-saraswat
Copy link
Contributor Author

One more error similar to this comes sometimes:

2023-02-27 11:44:55 [INFO] [Instrument] Instrument.py[line:22] InstrumentServer init ...
2023-02-27 11:44:55 [INFO] [Instrument] dvt.py[line:167] set com.apple.instruments.server.services.coreprofilesessiontap callback ...
2023-02-27 11:44:56 [INFO] [LockDown] lockdown.py[line:73] Connecting Device xxxxx-xxxxxxxx 
2023-02-27 11:44:56 [INFO] [Instrument] Instrument.py[line:22] InstrumentServer init ...
2023-02-27 11:44:56 [ERROR] [Instrument] dvt.py[line:252] unpack_from requires a buffer of at least 36 bytes for unpacking 36 bytes at offset 0 (actual buffer size is 0)
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/servers/dvt.py", line 239, in _receiver
    self._channel_callbacks[(2 ** 32 - dtx.channel_code)](dtx)
  File "/Users/sanidhya/repos/py-ios-device/demo/instrument_demo/app_lifecycle.py", line 32, in on_graphics_message
    demo(res.selector.data)
  File "/Users/sanidhya/repos/py-ios-device/demo/instrument_demo/app_lifecycle.py", line 22, in demo
    for event in Kperf.to_dict(data):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kperf_data.py", line 1021, in to_dict
    for event in self.parse(kd_buf):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kperf_data.py", line 971, in parse
    yield kc_data_parse(buf_io.read())
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 1710, in kc_data_parse
    for i, kcdata_buffer in enumerate(iterate_kcdatas(data)):
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 1667, in iterate_kcdatas
    kcdata_buffer.ReadItems(iterator)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 670, in ReadItems
    o.ReadItems(iterator)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 670, in ReadItems
    o.ReadItems(iterator)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 663, in ReadItems
    o = KCObject.FromKCItem(i)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 462, in FromKCItem
    return KCObject(kcitem.i_type, kcitem.i_data, kcitem.i_offset, kcitem.i_flags)
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 443, in __init__
    self.ParseData()
  File "/opt/homebrew/lib/python3.9/site-packages/ios_device/util/kc_data.py", line 519, in ParseData
    u_d = struct.unpack_from('32sI', self.i_data)
struct.error: unpack_from requires a buffer of at least 36 bytes for unpacking 36 bytes at offset 0 (actual buffer size is 0)
start notion.id pid:38207
^CTraceback (most recent call last):
  File "/Users/sanidhya/repos/py-ios-device/demo/instrument_demo/app_lifecycle.py", line 63, in <module>
    app_launch_lifecyle(rpc, 'notion.id')
  File "/Users/sanidhya/repos/py-ios-device/demo/instrument_demo/app_lifecycle.py", line 56, in app_launch_lifecyle
    time.sleep(1000)
KeyboardInterrupt
^CException ignored in: <module 'threading' from '/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py'>
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 1470, in _shutdown
    lock.acquire()
KeyboardInterrupt: ```

@Ren-Qan
Copy link

Ren-Qan commented Feb 27, 2023

同无法获取app启动数据:
情况1:同上
情况2:
image
情况3:只有整体启动耗时。

iPhone13 pro max - 16.1

@YueChen-C
Copy link
Owner

I don't know why. Sometimes the stackshot data is truncated, But not every time

@erduoniba
Copy link

erduoniba commented Dec 7, 2023

同无法获取app启动数据: 情况1:同上 情况2: image 情况3:只有整体启动耗时。

iPhone13 pro max - 16.1

@Ren-Qan 情况 3 参考 #127 看是否能解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants