dsanson / termpdf.py

A graphical pdf and epub reader that works inside the kitty terminal
MIT License
496 stars 30 forks source link

termpdf running very slow and traceback while opening pdf #29

Open ciscohack opened 2 years ago

ciscohack commented 2 years ago

hello expert,

termpdf backtrace and runs very slow on macOS 12.3. Below is the traceback for your reference. Suggest how to fix it

Translated Report (Full Report Below)
-------------------------------------

Process:               Python [54897]
Path:                  /usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python
Identifier:            org.python.python
Version:               3.9.12 (3.9.12)
Code Type:             X86-64 (Native)
Parent Process:        zsh [47788]
Responsible:           kitty [36457]
User ID:               501

Date/Time:             2022-04-04 02:08:22.7539 +0530
OS Version:            macOS 12.3.1 (21E258)
Report Version:        12
Bridge OS Version:     6.4 (19P4243)
Anonymous UUID:        3D5C6E09-88A0-E4C3-C1CF-8FAE296AFF0C

Time Awake Since Boot: 54000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib              0x7ff81ad5500e __pthread_kill + 10
1   libsystem_pthread.dylib             0x7ff81ad8b1ff pthread_kill + 263
2   libsystem_c.dylib                   0x7ff81acd6d24 abort + 123
3   Python                                 0x10cb636f9 _Py_FatalErrorFormat + 103
4   Python                                 0x10cbe23e3 _enter_buffered_busy + 320
5   Python                                 0x10cbe3bca buffered_flush + 313
6   Python                                 0x10ca32945 method_vectorcall_NOARGS + 92
7   Python                                 0x10ca28132 PyObject_VectorcallMethod + 138
8   Python                                 0x10cbe9a17 _io_TextIOWrapper_flush + 155
9   Python                                 0x10ca32945 method_vectorcall_NOARGS + 92
10  Python                                 0x10ca28132 PyObject_VectorcallMethod + 138
11  Python                                 0x10cb5fb26 flush_std_files + 170
12  Python                                 0x10cb5f64b fatal_error + 285
13  Python                                 0x10cb637aa _Py_FatalErrorFormat + 280
14  Python                                 0x10cbe23e3 _enter_buffered_busy + 320
15  Python                                 0x10cbe3bca buffered_flush + 313
16  Python                                 0x10ca32945 method_vectorcall_NOARGS + 92
17  Python                                 0x10ca28132 PyObject_VectorcallMethod + 138
18  Python                                 0x10cbe9a17 _io_TextIOWrapper_flush + 155
19  Python                                 0x10ca32945 method_vectorcall_NOARGS + 92
20  Python                                 0x10ca28132 PyObject_VectorcallMethod + 138
21  Python                                 0x10cb5fb26 flush_std_files + 170
22  Python                                 0x10cb5ff7d Py_FinalizeEx + 131
23  Python                                 0x10cb85274 Py_RunMain + 492
24  Python                                 0x10cb867c4 Py_BytesMain + 42
25  dyld                                   0x113dcb51e start + 462

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000113e46600  rcx: 0x00007ff7b3999f38  rdx: 0x0000000000000000
  rdi: 0x0000000000000103  rsi: 0x0000000000000006  rbp: 0x00007ff7b3999f60  rsp: 0x00007ff7b3999f38
   r8: 0x0000000000000000   r9: 0x8d5c392f61aa0da5  r10: 0x0000000000000000  r11: 0x0000000000000246
  r12: 0x0000000000000103  r13: 0x00007ff7b399a178  r14: 0x0000000000000006  r15: 0x0000000000000016
  rip: 0x00007ff81ad5500e  rfl: 0x0000000000000246  cr2: 0x000000012bbc5d73

Logical CPU:     0
Error Code:      0x02000148 
Trap Number:     133

Binary Images:
    0x7ff81ad4d000 -     0x7ff81ad84fff libsystem_kernel.dylib (*) <26a59789-b846-3ed4-96dc-8dbef3c0c8e7> /usr/lib/system/libsystem_kernel.dylib
    0x7ff81ad85000 -     0x7ff81ad90fff libsystem_pthread.dylib (*) <2f6c275d-7e14-3d31-a924-e1bb41d2415f> /usr/lib/system/libsystem_pthread.dylib
    0x7ff81ac55000 -     0x7ff81acddfff libsystem_c.dylib (*) <8e54eca2-9bd8-3482-9589-b9574434d1aa> /usr/lib/system/libsystem_c.dylib
       0x10c9ca000 -        0x10cc85fff org.python.python (3.9.12, (c) 2001-2021 Python Software Foundation.) <c9129da7-ee5b-3a6f-8129-d7a5b32b7a9c> /usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/Python
       0x113dc6000 -        0x113e31fff dyld (*) <dd9e80de-fb3b-349b-96a4-46874ad34d11> /usr/lib/dyld

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: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=378.4M resident=0K(0%) swapped_out_or_unallocated=378.4M(100%)
Writable regions: Total=929.0M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=929.0M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        1 
MALLOC                           507.4M      219 
MALLOC guard page                   16K        4 
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                          4K        1 
Stack                             16.0M        2 
VM_ALLOCATE                       21.5M       88 
__DATA                            1396K       78 
__DATA_CONST                      3743K       72 
__DATA_DIRTY                        79K       24 
__LINKEDIT                       346.5M       36 
__OBJC_RO                         82.6M        1 
__OBJC_RW                         3200K        2 
__TEXT                            31.9M       83 
__UNICODE                          592K        1 
dyld private memory               1024K        1 
shared memory                       12K        2 
===========                     =======  ======= 
TOTAL                              1.4G      616 
TOTAL, minus reserved VM space     1.0G      616 

-----------
Full Report
-----------

{"app_name":"Python","timestamp":"2022-04-04 02:08:22.00 +0530","app_version":"3.9.12","slice_uuid":"04d90438-f1c2-3624-9931-dbecf8989ee4","build_version":"3.9.12","platform":1,"bundleID":"org.python.python","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.3.1 (21E258)","incident_id":"6D7D02EE-2345-4303-9E51-8A3892EE21D0","name":"Python"}
{
  "uptime" : 54000,
  "procLaunch" : "2022-04-04 02:07:22.7088 +0530",
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro16,1",
  "procStartAbsTime" : 54579417019404,
  "coalitionID" : 1169,
  "osVersion" : {
    "train" : "macOS 12.3.1",
    "build" : "21E258",
    "releaseType" : "User"
  },
  "captureTime" : "2022-04-04 02:08:22.7539 +0530",
  "incident" : "6D7D02EE-2345-4303-9E51-8A3892EE21D0",
  "bug_type" : "309",
  "pid" : 54897,
  "procExitAbsTime" : 54639458234964,
  "cpuType" : "X86-64",
  "procName" : "Python",
  "procPath" : "\/usr\/local\/Cellar\/python@3.9\/3.9.12\/Frameworks\/Python.framework\/Versions\/3.9\/Resources\/Python.app\/Contents\/MacOS\/Python",
  "bundleInfo" : {"CFBundleShortVersionString":"3.9.12","CFBundleVersion":"3.9.12","CFBundleIdentifier":"org.python.python"},
  "storeInfo" : {"deviceIdentifierForVendor":"E2FB50F2-0541-52BB-A658-B6381E415C3E","thirdParty":true},
  "parentProc" : "zsh",
  "parentPid" : 47788,
  "coalitionName" : "net.kovidgoyal.kitty",
  "crashReporterKey" : "3D5C6E09-88A0-E4C3-C1CF-8FAE296AFF0C",
  "responsiblePid" : 36457,
  "responsibleProc" : "kitty",
  "bridgeVersion" : {"build":"19P4243","train":"6.4"},
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "asi" : {"libsystem_c.dylib":["abort() called"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":2191249,"threadState":{"r13":{"value":140701846839672},"rax":{"value":0},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":6},"rsi":{"value":6},"r8":{"value":0},"cr2":{"value":5028732275},"rdx":{"value":0},"r10":{"value":0},"r9":{"value":10186079332870000037},"r15":{"value":22},"rbx":{"value":4628702720,"symbolLocation":0,"symbol":"_main_thread"},"trap":{"value":133},"err":{"value":33554760},"r11":{"value":582},"rip":{"value":140703578804238,"matchesCrashFrame":1},"rbp":{"value":140701846839136},"rsp":{"value":140701846839096},"r12":{"value":259},"rcx":{"value":140701846839096},"flavor":"x86_THREAD_STATE","rdi":{"value":259}},"queue":"com.apple.main-thread","frames":[{"imageOffset":32782,"symbol":"__pthread_kill","symbolLocation":10,"imageIndex":0},{"imageOffset":25087,"symbol":"pthread_kill","symbolLocation":263,"imageIndex":1},{"imageOffset":531748,"symbol":"abort","symbolLocation":123,"imageIndex":2},{"imageOffset":1677049,"symbol":"_Py_FatalErrorFormat","symbolLocation":103,"imageIndex":3},{"imageOffset":2196451,"symbol":"_enter_buffered_busy","symbolLocation":320,"imageIndex":3},{"imageOffset":2202570,"symbol":"buffered_flush","symbolLocation":313,"imageIndex":3},{"imageOffset":428357,"symbol":"method_vectorcall_NOARGS","symbolLocation":92,"imageIndex":3},{"imageOffset":385330,"symbol":"PyObject_VectorcallMethod","symbolLocation":138,"imageIndex":3},{"imageOffset":2226711,"symbol":"_io_TextIOWrapper_flush","symbolLocation":155,"imageIndex":3},{"imageOffset":428357,"symbol":"method_vectorcall_NOARGS","symbolLocation":92,"imageIndex":3},{"imageOffset":385330,"symbol":"PyObject_VectorcallMethod","symbolLocation":138,"imageIndex":3},{"imageOffset":1661734,"symbol":"flush_std_files","symbolLocation":170,"imageIndex":3},{"imageOffset":1660491,"symbol":"fatal_error","symbolLocation":285,"imageIndex":3},{"imageOffset":1677226,"symbol":"_Py_FatalErrorFormat","symbolLocation":280,"imageIndex":3},{"imageOffset":2196451,"symbol":"_enter_buffered_busy","symbolLocation":320,"imageIndex":3},{"imageOffset":2202570,"symbol":"buffered_flush","symbolLocation":313,"imageIndex":3},{"imageOffset":428357,"symbol":"method_vectorcall_NOARGS","symbolLocation":92,"imageIndex":3},{"imageOffset":385330,"symbol":"PyObject_VectorcallMethod","symbolLocation":138,"imageIndex":3},{"imageOffset":2226711,"symbol":"_io_TextIOWrapper_flush","symbolLocation":155,"imageIndex":3},{"imageOffset":428357,"symbol":"method_vectorcall_NOARGS","symbolLocation":92,"imageIndex":3},{"imageOffset":385330,"symbol":"PyObject_VectorcallMethod","symbolLocation":138,"imageIndex":3},{"imageOffset":1661734,"symbol":"flush_std_files","symbolLocation":170,"imageIndex":3},{"imageOffset":1662845,"symbol":"Py_FinalizeEx","symbolLocation":131,"imageIndex":3},{"imageOffset":1815156,"symbol":"Py_RunMain","symbolLocation":492,"imageIndex":3},{"imageOffset":1820612,"symbol":"Py_BytesMain","symbolLocation":42,"imageIndex":3},{"imageOffset":21790,"symbol":"start","symbolLocation":462,"imageIndex":4}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703578771456,
    "size" : 229376,
    "uuid" : "26a59789-b846-3ed4-96dc-8dbef3c0c8e7",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703579000832,
    "size" : 49152,
    "uuid" : "2f6c275d-7e14-3d31-a924-e1bb41d2415f",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703577755648,
    "size" : 561152,
    "uuid" : "8e54eca2-9bd8-3482-9589-b9574434d1aa",
    "path" : "\/usr\/lib\/system\/libsystem_c.dylib",
    "name" : "libsystem_c.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4506558464,
    "CFBundleShortVersionString" : "3.9.12, (c) 2001-2021 Python Software Foundation.",
    "CFBundleIdentifier" : "org.python.python",
    "size" : 2867200,
    "uuid" : "c9129da7-ee5b-3a6f-8129-d7a5b32b7a9c",
    "path" : "\/usr\/local\/Cellar\/python@3.9\/3.9.12\/Frameworks\/Python.framework\/Versions\/3.9\/Python",
    "name" : "Python",
    "CFBundleVersion" : "3.9.12"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4628176896,
    "size" : 442368,
    "uuid" : "dd9e80de-fb3b-349b-96a4-46874ad34d11",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  }
],
  "sharedCache" : {
  "base" : 140703575728128,
  "size" : 15224815616,
  "uuid" : "6cc5ecdc-5119-37f0-9a85-4f48a50f5f78"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=378.4M resident=0K(0%) swapped_out_or_unallocated=378.4M(100%)\nWritable regions: Total=929.0M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=929.0M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nKernel Alloc Once                    8K        1 \nMALLOC                           507.4M      219 \nMALLOC guard page                   16K        4 \nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                          4K        1 \nStack                             16.0M        2 \nVM_ALLOCATE                       21.5M       88 \n__DATA                            1396K       78 \n__DATA_CONST                      3743K       72 \n__DATA_DIRTY                        79K       24 \n__LINKEDIT                       346.5M       36 \n__OBJC_RO                         82.6M        1 \n__OBJC_RW                         3200K        2 \n__TEXT                            31.9M       83 \n__UNICODE                          592K        1 \ndyld private memory               1024K        1 \nshared memory                       12K        2 \n===========                     =======  ======= \nTOTAL                              1.4G      616 \nTOTAL, minus reserved VM space     1.0G      616 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60356660bbe37970735c5624",
      "factorPackIds" : {

      },
      "deploymentId" : 240000027
    },
    {
      "rolloutId" : "60da5e84ab0ca017dace9abf",
      "factorPackIds" : {

      },
      "deploymentId" : 240000008
    }
  ],
  "experiments" : [

  ]
}
}

Model: MacBookPro16,1, BootROM 1731.100.130.0.0 (iBridge: 19.16.14243.0.0,0), 6 processors, 6-Core Intel Core i7, 2.6 GHz, 16 GB, SMC 
Graphics: Intel UHD Graphics 630, Intel UHD Graphics 630, Built-In
Display: Color LCD, 3072 x 1920 Retina, Main, MirrorOff, Online
Graphics: AMD Radeon Pro 5300M, AMD Radeon Pro 5300M, PCIe, 4 GB
Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2667 MHz, Micron, 8ATF1G64HZ-2G6E1
Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2667 MHz, Micron, 8ATF1G64HZ-2G6E1
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x7BF), wl0: Jul 12 2021 18:02:56 version 9.30.464.0.32.5.76 FWID 01-c081cfed
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus
USB Device: T2Bus
USB Device: composite_device
USB Device: Touch Bar Backlight
USB Device: Touch Bar Display
USB Device: Apple Internal Keyboard / Trackpad
USB Device: Headset
USB Device: Ambient Light Sensor
USB Device: FaceTime HD Camera (Built-in)
USB Device: Apple T2 Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 63.5
Thunderbolt Bus: MacBook Pro, Apple Inc., 63.5