parallel tests on Mac OS X Catalina crash with Postgres - django

After upgrading to Mac OS X Catalina my parallel django tests cash.
With this in settings I get a crash, without them (when sqlite is used everything is fine)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'xx',
'USER': 'xx',
'PASSWORD': 'xx',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
Execution command is:
python manage.py test --settings=app.settings.test --parallel
The crash report contains this:
Process: Python [30650]
Path: /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 3.7.5 (3.7.5)
Code Type: X86-64 (Native)
Parent Process: Python [30634]
Responsible: Terminal [1592]
User ID: 501
Date/Time: 2019-12-15 10:04:41.315 -0800
OS Version: Mac OS X 10.15.2 (19C57)
Report Version: 12
Bridge OS Version: 4.2 (17P2551)
Anonymous UUID: 9B583AD7-1D7E-AA15-3286-DADFF9B92A49
Sleep/Wake UUID: 41900DFA-568F-4B5B-BFA4-0C5FF8D8C05F
Time Awake Since Boot: 54000 seconds
Time Since Wake: 2000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000011554baba
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [30650]
VM Regions Near 0x11554baba:
VM_ALLOCATE 000000011550b000-000000011554b000 [ 256K] rw-/rwx SM=COW
-->
shared memory 000000011558b000-000000011558f000 [ 16K] r--/r-- SM=SHM
Application Specific Information:
*** multi-threaded process forked ***
crashed on child side of fork pre-exec
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_trace.dylib 0x00007fff6ee9fc45 _os_log_preferences_refresh + 75
1 libsystem_trace.dylib 0x00007fff6eea0624 os_log_type_enabled + 618
2 com.apple.security 0x00007fff43daa6ad Security::DLDbListCFPref::loadPropertyList(bool) + 341
3 com.apple.security 0x00007fff43fee5f4 Security::KeychainCore::StorageManager::getSearchList(std::__1::vector<Security::KeychainCore::Keychain, std::__1::allocator<Security::KeychainCore::Keychain> >&) + 142
4 com.apple.security 0x00007fff43ff0704 Security::KeychainCore::StorageManager::optionalSearchList(void const*, std::__1::vector<Security::KeychainCore::Keychain, std::__1::allocator<Security::KeychainCore::Keychain> >&) + 114
5 com.apple.security 0x00007fff43fb3ea5 SecIdentitySearchCreate + 139
6 com.apple.security 0x00007fff43fc1548 _CreateSecItemParamsFromDictionary(__CFDictionary const*, int*) + 4109
7 com.apple.security 0x00007fff43fbf73b SecItemCopyMatching_osx(__CFDictionary const*, void const**) + 104
8 com.apple.security 0x00007fff43fc3024 SecItemCopyMatching + 338
9 com.apple.Heimdal 0x00007fff5976f303 keychain_query + 531
10 com.apple.Heimdal 0x00007fff5976cf4c hx509_certs_find + 92
11 com.apple.Heimdal 0x00007fff5972bb52 _krb5_pk_find_cert + 466
12 com.apple.GSS 0x00007fff3a2539bb _gsspku2u_acquire_cred + 619
13 com.apple.GSS 0x00007fff3a238c1c gss_acquire_cred + 940
14 libpq.5.dylib 0x00000001054526e3 pg_GSS_have_cred_cache + 54
15 libpq.5.dylib 0x0000000105440eb0 PQconnectPoll + 6356
16 libpq.5.dylib 0x000000010543e026 connectDBComplete + 231
17 libpq.5.dylib 0x000000010543e1ad PQconnectdb + 36
18 _psycopg.cpython-37m-darwin.so 0x00000001053fe587 conn_connect + 135
19 _psycopg.cpython-37m-darwin.so 0x00000001053ffbc0 connection_init + 336
20 org.python.python 0x00000001033dc7ee type_call + 172
21 org.python.python 0x00000001033a1453 _PyObject_FastCallDict + 264
22 org.python.python 0x00000001033a292f _PyObject_CallFunctionVa + 207
23 org.python.python 0x00000001033a2a90 _PyObject_CallFunction_SizeT + 129
24 _psycopg.cpython-37m-darwin.so 0x00000001053f98e0 psyco_connect + 192
25 org.python.python 0x00000001033a1cda PyCFunction_Call + 208
26 org.python.python 0x000000010342f70e _PyEval_EvalFrameDefault + 7738
27 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
28 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
29 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
30 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
31 org.python.python 0x00000001034363d5 call_function + 737
32 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
33 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
34 org.python.python 0x00000001034363d5 call_function + 737
35 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
36 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
37 org.python.python 0x00000001034363d5 call_function + 737
38 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
39 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
40 org.python.python 0x00000001034363d5 call_function + 737
41 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
42 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
43 org.python.python 0x00000001034363d5 call_function + 737
44 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
45 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
46 org.python.python 0x00000001034363d5 call_function + 737
47 org.python.python 0x000000010342f343 _PyEval_EvalFrameDefault + 6767
48 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
49 org.python.python 0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
50 org.python.python 0x00000001034363d5 call_function + 737
51 org.python.python 0x000000010342f3de _PyEval_EvalFrameDefault + 6922
52 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
53 org.python.python 0x00000001034363d5 call_function + 737
54 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
55 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
56 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
57 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
58 org.python.python 0x00000001033a1b45 PyObject_Call + 136
59 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
60 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
61 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
62 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
63 org.python.python 0x00000001033df0ce slot_tp_call + 71
64 org.python.python 0x00000001033a18ae _PyObject_FastCallKeywords + 358
65 org.python.python 0x00000001034363ce call_function + 730
66 org.python.python 0x000000010342f3de _PyEval_EvalFrameDefault + 6922
67 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
68 org.python.python 0x00000001034363d5 call_function + 737
69 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
70 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
71 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
72 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
73 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
74 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
75 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
76 org.python.python 0x00000001034363d5 call_function + 737
77 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
78 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
79 org.python.python 0x00000001034363d5 call_function + 737
80 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
81 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
82 org.python.python 0x00000001034363d5 call_function + 737
83 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
84 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
85 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
86 org.python.python 0x00000001033dfac2 slot_tp_init + 80
87 org.python.python 0x00000001033dc7ee type_call + 172
88 org.python.python 0x00000001033a18ae _PyObject_FastCallKeywords + 358
89 org.python.python 0x00000001034363ce call_function + 730
90 org.python.python 0x000000010342f3de _PyEval_EvalFrameDefault + 6922
91 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
92 org.python.python 0x00000001034363d5 call_function + 737
93 org.python.python 0x000000010342f343 _PyEval_EvalFrameDefault + 6767
94 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
95 org.python.python 0x00000001034363d5 call_function + 737
96 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
97 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
98 org.python.python 0x00000001034363d5 call_function + 737
99 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
100 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
101 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
102 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
103 org.python.python 0x00000001033dfac2 slot_tp_init + 80
104 org.python.python 0x00000001033dc7ee type_call + 172
105 org.python.python 0x00000001033a18ae _PyObject_FastCallKeywords + 358
106 org.python.python 0x00000001034363ce call_function + 730
107 org.python.python 0x000000010342f486 _PyEval_EvalFrameDefault + 7090
108 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
109 org.python.python 0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
110 org.python.python 0x00000001034363d5 call_function + 737
111 org.python.python 0x000000010342f486 _PyEval_EvalFrameDefault + 7090
112 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
113 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
114 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
115 org.python.python 0x00000001033a1b45 PyObject_Call + 136
116 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
117 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
118 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
119 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
120 org.python.python 0x00000001033df0ce slot_tp_call + 71
121 org.python.python 0x00000001033a18ae _PyObject_FastCallKeywords + 358
122 org.python.python 0x00000001034363ce call_function + 730
123 org.python.python 0x000000010342f3de _PyEval_EvalFrameDefault + 6922
124 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
125 org.python.python 0x00000001034363d5 call_function + 737
126 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
127 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
128 org.python.python 0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
129 org.python.python 0x00000001034363d5 call_function + 737
130 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
131 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
132 org.python.python 0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
133 org.python.python 0x00000001034363d5 call_function + 737
134 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
135 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
136 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
137 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
138 org.python.python 0x00000001033a1b45 PyObject_Call + 136
139 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
140 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
141 org.python.python 0x00000001033a1678 _PyFunction_FastCallDict + 444
142 org.python.python 0x00000001033a277f _PyObject_Call_Prepend + 131
143 org.python.python 0x00000001033a1b45 PyObject_Call + 136
144 org.python.python 0x000000010342f627 _PyEval_EvalFrameDefault + 7507
145 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
146 org.python.python 0x00000001034363d5 call_function + 737
147 org.python.python 0x000000010342f343 _PyEval_EvalFrameDefault + 6767
148 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
149 org.python.python 0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
150 org.python.python 0x00000001034363d5 call_function + 737
151 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
152 org.python.python 0x00000001033a1e0c function_code_fastcall + 106
153 org.python.python 0x00000001034363d5 call_function + 737
154 org.python.python 0x000000010342f32a _PyEval_EvalFrameDefault + 6742
155 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
156 org.python.python 0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
157 org.python.python 0x00000001034363d5 call_function + 737
158 org.python.python 0x000000010342f3de _PyEval_EvalFrameDefault + 6922
159 org.python.python 0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
160 org.python.python 0x000000010342d831 PyEval_EvalCode + 51
161 org.python.python 0x000000010345bc3c run_mod + 54
162 org.python.python 0x000000010345ac6f PyRun_FileExFlags + 160
163 org.python.python 0x000000010345a326 PyRun_SimpleFileExFlags + 270
164 org.python.python 0x0000000103472b2e pymain_main + 5445
165 org.python.python 0x000000010347319c _Py_UnixMain + 56
166 libdyld.dylib 0x00007fff6ec827fd start + 1
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x000000011554bab8 rbx: 0x0000000000000000 rcx: 0x00000001072cee6c rdx: 0x0000000000000000
rdi: 0x00007ff2617da290 rsi: 0x0000000000000001 rbp: 0x00007ffeec87a340 rsp: 0x00007ffeec879f00
r8: 0x2bf4e2fa4089247b r9: 0x00000000a5baadb8 r10: 0x00000000a5baadb9 r11: 0x000000001c2a1c07
r12: 0x000000011554babc r13: 0x0000000000000024 r14: 0x0000000000000002 r15: 0x00007ff2617da290
rip: 0x00007fff6ee9fc45 rfl: 0x0000000000010206 cr2: 0x000000011554baba
...

Related

SwiftUI crash AttributeGraph precondition failure: invalid attribute id: 83753

I got this (not particularly helpful, in my eyes) crash message and was wondered what the usual suspect was for this/where I'm best to look? I'm getting this when I navigate using a NavigationLink to another View. I know from some research that this crash tends to have a different cause each time, but I wondered if the stack trace would give any clues?
Each crash companies about the same invalid attribute id: 83753. Any way I can track something down using this ID?
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1c1f2584c __pthread_kill + 8
1 libsystem_pthread.dylib 0x1de7f09e8 pthread_kill + 212
2 libsystem_c.dylib 0x19ed5c8f4 abort + 100
3 AttributeGraph 0x1bd82dc7c util::Heap::Heap(void*, unsigned long, unsigned long) + 186
4 AttributeGraph 0x1bd8269f0 AG::AttributeID::size() const + 238
5 AttributeGraph 0x1bd82d530 AGGraphGetValue + 500
6 SwiftUI 0x19c9e4eb0 ResolvedTextFilter.updateValue() + 56
7 SwiftUI 0x19c4cee34 partial apply for specialized implicit closure #2 in implicit closure #1 in closure #1 in closure #1 in Attribute.init<A>(_:) + 20
8 AttributeGraph 0x1bd81714c AG::Graph::UpdateStack::update() + 484
9 AttributeGraph 0x1bd81755c AG::Graph::update_attribute(AG::data::ptr<AG::Node>, bool) + 328
10 AttributeGraph 0x1bd81c1f8 AG::Graph::value_ref(AG::AttributeID, AGSwiftMetadata const*, bool*) + 152
11 AttributeGraph 0x1bd82d468 AGGraphGetValue + 300
12 SwiftUI 0x19c6321d8 ViewGraph.sizeThatFits(_:) + 212
13 SwiftUI 0x19ca285e0 closure #1 in ViewRendererHost.sizeThatFits(_:) + 52
14 SwiftUI 0x19c5d2ec4 thunk for #callee_guaranteed (#guaranteed ViewGraph) -> (#unowned CGSize) + 24
15 SwiftUI 0x19ca2687c closure #1 in ViewRendererHost.updateViewGraph<A>(body:) + 92
16 SwiftUI 0x19ca1f0b4 ViewRendererHost.updateViewGraph<A>(body:) + 88
17 SwiftUI 0x19ca25328 ViewRendererHost.sizeThatFits(_:) + 112
18 SwiftUI 0x19cb7b980 _UIHostingView.sizeThatFits(_:) + 112
19 SwiftUI 0x19cb7b9c8 #objc _UIHostingView._baselineOffsets(at:) + 48
20 UIKitCore 0x197eadbb0 -[_UITAMICAdaptorView updateForAvailableSize] + 120
21 UIKitCore 0x197eadafc -[_UITAMICAdaptorView didMoveToWindow] + 60
22 UIKitCore 0x198dcdbc0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 2016
23 UIKitCore 0x198dcd680 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 672
24 UIKitCore 0x198dcd680 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 672
25 UIKitCore 0x197ed2350 -[UINavigationBar _didMoveFromWindow:toWindow:] + 64
26 UIKitCore 0x198dc1ac8 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 136
27 UIKitCore 0x198dc19b4 -[UIView(Hierarchy) _postMovedFromSuperview:] + 748
28 UIKitCore 0x198dd0028 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2132
29 UIKitCore 0x1981385d8 -[UILayoutContainerView addSubview:] + 64
30 UIKitCore 0x1981434a0 -[UINavigationController _unhideNavigationBarForEdge:] + 100
31 UIKitCore 0x1981436e8 -[UINavigationController _setNavigationBarHidden:edge:duration:] + 216
32 UIKitCore 0x198142d30 -[UINavigationController _setNavigationBarHidden:edgeIfNotNavigating:duration:] + 516
33 UIKitCore 0x1981416ac -[UINavigationController setNavigationBarHidden:animated:] + 156
34 SwiftUI 0x19cadace8 NavigationBridge_PhoneTV.hostingControllerWillAppear(transitionCoordinator:animated:) + 876
35 SwiftUI 0x19c53fc60 _UIHostingView.viewControllerWillAppear(transitionCoordinator:animated:) + 48
36 SwiftUI 0x19cb7fd20 UIHostingController.viewWillAppear(_:) + 116
37 SwiftUI 0x19cb7fc3c #objc UIHostingController.viewWillAppear(_:) + 40
38 UIKitCore 0x198210a4c -[UIViewController _setViewAppearState:isAnimating:] + 604
39 UIKitCore 0x1982111d0 -[UIViewController __viewWillAppear:] + 116
40 UIKitCore 0x19813f7e8 -[UINavigationController _startCustomTransition:] + 1344
41 UIKitCore 0x198153bb0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 700
42 UIKitCore 0x198154fe0 -[UINavigationController __viewWillLayoutSubviews] + 164
43 UIKitCore 0x198137e78 -[UILayoutContainerView layoutSubviews] + 224
44 UIKitCore 0x198dd6398 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2468
45 QuartzCore 0x1992dbdf4 -[CALayer layoutSublayers] + 288
46 QuartzCore 0x1992e2398 CA::Layer::layout_if_needed(CA::Transaction*) + 520
47 QuartzCore 0x1992ed6e8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140
48 QuartzCore 0x199238d7c CA::Context::commit_transaction(CA::Transaction*, double, double*) + 416
49 QuartzCore 0x199262f40 CA::Transaction::commit() + 728
50 QuartzCore 0x1992641f0 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
51 CoreFoundation 0x195fe087c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
52 CoreFoundation 0x195fdaf50 __CFRunLoopDoObservers + 604
53 CoreFoundation 0x195fdb498 __CFRunLoopRun + 960
54 CoreFoundation 0x195fdaba0 CFRunLoopRunSpecific + 572
55 GraphicsServices 0x1acd43598 GSEventRunModal + 160
56 UIKitCore 0x1988cc2f4 -[UIApplication _run] + 1052
57 UIKitCore 0x1988d1874 UIApplicationMain + 164
58 SwiftUI 0x19ca5a5dc closure #1 in KitRendererCommon(_:) + 108
59 SwiftUI 0x19ca5a56c runApp<A>(_:) + 176
60 SwiftUI 0x19c62bd18 static App.main() + 96
61 ProgressioniOS 0x10077f06c static ProgressionApp.$main() (<compiler-generated>)
62 ProgressioniOS 0x10077f39c main (ProgressionApp.swift)
63 libdyld.dylib 0x195cb9568 start + 4
Any thoughts appreciated.

Reading from an ifstream into integers. While passing ifstream to functions

I am working on a program where I need to read ints from a file into an array and use the array to do work. not super complicated and shouldtm take next to no time at all.
i am still a student learning c++ and i've exhausted all my options trying to get this to function as I understand it.
The text file has 200 lines each line contains a int followed by a '\n' newline character.
When I read the file in the main function into an int it works as expected. when I pass the ifstream by reference into the function that does the exact same for loop it breaks giving me an uninitialized in as the only value.
#include<iostream> // required
#include<fstream>
#include<random>
#include<string>
using namespace std; // using standard namespace as for this entire program
void readNumbers(ifstream&, int[], int); // passing a input filestream by reference, c style array, and an integer for the array length
int totalInts(ifstream&); // this will read how many lines the file has
int main()
{
ifstream is("numbers.txt"); // this is the text file that we are reading from
int ar[200]; // the array of length 200 that everything will be read into
int temp; // temporary holding for our ints
if (!is) // error checking
cout << "somethings <expletive deleted>";
else {
for (int i = 0; i < 200; i++) // iterating through the file 200 times and inputting the int into the temp holding, this is being used to test if this method works as expected.
{
is >> temp;
cout << i << ' ' << temp << '\n'; // prints it out for troubleshooting
}
// cout << totalInts(is);
readNumbers(is, ar, 200);
}
return 0;
}
int totalInts(ifstream& file)
{
string i;
int intNum;
intNum = 0;
while (getline(file, i))
{
intNum++;
}
return intNum;
}
void readNumbers(ifstream &reading, int papi[], int rayLength) // where we really want to read the file
{
int temp; // for temp holding while we troubleshoot
if (!reading)
cout << "somethings fucked";
else
{
for (int i = 0; i < rayLength;i++) // reads the file for as many time as we have space in the array.
{
reading >> temp; // reads into temp
cout << temp; // outputs for troubleshooting
}
}
}
the program outputs below
0 41
1 485
2 340
3 526
4 188
5 739
6 489
7 387
8 988
9 488
10 710
11 173
12 304
13 843
14 970
15 491
16 997
17 953
18 831
19 441
20 423
21 618
22 905
23 153
24 292
25 394
26 438
27 734
28 737
29 914
30 452
31 747
32 785
33 549
34 870
35 931
36 692
37 325
38 52
39 903
40 731
41 834
42 353
43 363
44 690
45 668
46 156
47 718
48 281
49 874
50 572
51 671
52 694
53 789
54 57
55 871
56 731
57 750
58 556
59 778
60 328
61 38
62 212
63 843
64 288
65 136
66 49
67 950
68 283
69 670
70 473
71 828
72 905
73 735
74 394
75 365
76 21
77 132
78 417
79 551
80 648
81 635
82 108
83 973
84 774
85 851
86 970
87 383
88 944
89 334
90 960
91 471
92 650
93 334
94 542
95 559
96 134
97 84
98 951
99 557
100 837
101 146
102 643
103 687
104 726
105 939
106 990
107 308
108 704
109 408
110 26
111 773
112 950
113 91
114 276
115 834
116 803
117 588
118 102
119 528
120 10
121 303
122 170
123 654
124 377
125 791
126 678
127 589
128 35
129 64
130 377
131 151
132 957
133 745
134 979
135 433
136 138
137 221
138 25
139 348
140 472
141 299
142 780
143 393
144 959
145 917
146 241
147 767
148 245
149 606
150 428
151 970
152 533
153 43
154 429
155 197
156 900
157 623
158 780
159 656
160 427
161 365
162 651
163 557
164 569
165 489
166 622
167 45
168 605
169 374
170 301
171 866
172 383
173 31
174 600
175 45
176 375
177 222
178 687
179 508
180 289
181 738
182 53
183 1
184 444
185 965
186 906
187 791
188 145
189 467
190 731
191 907
192 672
193 505
194 824
195 423
196 324
197 623
198 835
199 523
-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460-858993460
E:\Github Repo's\assignment 3.2\Debug\assignment 3.2.exe (process 12832) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
as you can see the output for the first for loop is exactly as expected, however the function which has all the same functionality is not working and is showing an uninitialized int for temp.
this means that it is not reading from the ifstream which I passed to the function. so wrote another function that reads the file using a newly created ifstream as well as the passed ifstream and prints what is read from both streams.
totalInts(ifstream &file)
{
ifstream tester("numbers.txt");
string l,i;
int intNum;
intNum = 0;
for (int j = 0; j < 200; j++)
{
file >> l;
tester >> i;
intNum++;
cout << intNum << ' ' << i << ' ' << l << '\n';
}
file.close();
return intNum;
}
when this is used the output is as expected, so passing the ifstream as a param using reference is the issue, as when I make a new ifstream the program runs fine using that ifstream and reading the file as expected where as the passed ifstream shows no values read.
0 41
1 485
2 340
3 526
4 188
5 739
6 489
7 387
8 988
9 488
10 710
11 173
12 304
13 843
14 970
15 491
16 997
17 953
18 831
19 441
20 423
21 618
22 905
23 153
24 292
25 394
26 438
27 734
28 737
29 914
30 452
31 747
32 785
33 549
34 870
35 931
36 692
37 325
38 52
39 903
40 731
41 834
42 353
43 363
44 690
45 668
46 156
47 718
48 281
49 874
50 572
51 671
52 694
53 789
54 57
55 871
56 731
57 750
58 556
59 778
60 328
61 38
62 212
63 843
64 288
65 136
66 49
67 950
68 283
69 670
70 473
71 828
72 905
73 735
74 394
75 365
76 21
77 132
78 417
79 551
80 648
81 635
82 108
83 973
84 774
85 851
86 970
87 383
88 944
89 334
90 960
91 471
92 650
93 334
94 542
95 559
96 134
97 84
98 951
99 557
100 837
101 146
102 643
103 687
104 726
105 939
106 990
107 308
108 704
109 408
110 26
111 773
112 950
113 91
114 276
115 834
116 803
117 588
118 102
119 528
120 10
121 303
122 170
123 654
124 377
125 791
126 678
127 589
128 35
129 64
130 377
131 151
132 957
133 745
134 979
135 433
136 138
137 221
138 25
139 348
140 472
141 299
142 780
143 393
144 959
145 917
146 241
147 767
148 245
149 606
150 428
151 970
152 533
153 43
154 429
155 197
156 900
157 623
158 780
159 656
160 427
161 365
162 651
163 557
164 569
165 489
166 622
167 45
168 605
169 374
170 301
171 866
172 383
173 31
174 600
175 45
176 375
177 222
178 687
179 508
180 289
181 738
182 53
183 1
184 444
185 965
186 906
187 791
188 145
189 467
190 731
191 907
192 672
193 505
194 824
195 423
196 324
197 623
198 835
199 523
1 41
2 485
3 340
4 526
5 188
6 739
7 489
8 387
9 988
10 488
11 710
12 173
13 304
14 843
15 970
16 491
17 997
18 953
19 831
20 441
21 423
22 618
23 905
24 153
25 292
26 394
27 438
28 734
29 737
30 914
31 452
32 747
33 785
34 549
35 870
36 931
37 692
38 325
39 52
40 903
41 731
42 834
43 353
44 363
45 690
46 668
47 156
48 718
49 281
50 874
51 572
52 671
53 694
54 789
55 57
56 871
57 731
58 750
59 556
60 778
61 328
62 38
63 212
64 843
65 288
66 136
67 49
68 950
69 283
70 670
71 473
72 828
73 905
74 735
75 394
76 365
77 21
78 132
79 417
80 551
81 648
82 635
83 108
84 973
85 774
86 851
87 970
88 383
89 944
90 334
91 960
92 471
93 650
94 334
95 542
96 559
97 134
98 84
99 951
100 557
101 837
102 146
103 643
104 687
105 726
106 939
107 990
108 308
109 704
110 408
111 26
112 773
113 950
114 91
115 276
116 834
117 803
118 588
119 102
120 528
121 10
122 303
123 170
124 654
125 377
126 791
127 678
128 589
129 35
130 64
131 377
132 151
133 957
134 745
135 979
136 433
137 138
138 221
139 25
140 348
141 472
142 299
143 780
144 393
145 959
146 917
147 241
148 767
149 245
150 606
151 428
152 970
153 533
154 43
155 429
156 197
157 900
158 623
159 780
160 656
161 427
162 365
163 651
164 557
165 569
166 489
167 622
168 45
169 605
170 374
171 301
172 866
173 383
174 31
175 600
176 45
177 375
178 222
179 687
180 508
181 289
182 738
183 53
184 1
185 444
186 965
187 906
188 791
189 145
190 467
191 731
192 907
193 672
194 505
195 824
196 423
197 324
198 623
199 835
200 523
E:\Github Repo's\assignment 3.2\Debug\assignment 3.2.exe (process 24600) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
If this was up to me I would just be passing the filename through to the functions as a string param and making new ifstreams in these functions to get the thing to work, however the requirement for this is to have ad least one function that passes an ifstream through reference and utilize it. however after lots of troubleshooting and reading stackexange posts on the topic I cannot get it to function as expected.
what am I doing wrong?
any help would be appreciated.

Prim's algorithm not working on a certain implementation

I have two similar C++ implementations of Prim's algorithm for a minimum spanning tree, but one of them works in every situation, while the other fails in some. The difference is the method of comparison used within the priority queue.
This is the one that fails in a few situations (it uses a struct function in order to compare the cost of given arches):
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>``
#include <fstream>
using namespace std;
#define NMax 200005
#define oo (1 << 30)
ifstream fin("apm.in");
ofstream fout("apm.out");
int T[NMax], n, m, C[NMax];
bool inmst[NMax];
struct comp{
bool operator()(int x, int y)
{
return C[x] > C[y];
}
};
vector <pair <int, int> > G[NMax];
priority_queue<int, vector <int>, comp> pq;
void Prim()
{
for(int i = 1; i <= n; i++)
C[i] = oo;
pq.push(1);
C[1] = 0;
while(!pq.empty())
{
int nod = pq.top();
pq.pop();
inmst[nod] = 1;
for(int i = 0; i < G[nod].size(); i++)
{
int v = G[nod][i].first;
int c = G[nod][i].second;
if(!inmst[v] && C[v] >= c)
{
C[v] = c;
pq.push(v);
T[v] = nod;
}
}
}
}
int main()
{
fin >> n >> m;
for(int i = 1; i <= m; i++)
{
int x, y, c;
fin >> x >> y >> c;
G[x].push_back(make_pair(y, c));
G[y].push_back(make_pair(x, c));
}
Prim();
int ct = 0;
for(int i = 1; i <= n; i++)
ct += C[i];
fout << ct << "\n" << n-1 << "\n";
for(int i = 1; i <= n; i++)
{
if(T[i] == 0) continue;
fout << i << " " << T[i] << "\n";
}
}
And this is the one that succeeds every time (it uses the greater within the priority queue and stores both the cost associated with a node and the node itself within the queue):
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <fstream>
using namespace std;
#define NMax 200005
#define oo (1 << 30)
typedef pair<int, int> iPair;
ifstream fin("apm.in");
ofstream fout("apm.out");
int T[NMax], n, m, C[NMax];
bool inmst[NMax];
struct comp{
bool operator()(int x, int y)
{
return C[x] < C[y];
}
};
vector <pair <int, int> > G[NMax];
priority_queue< pair<int, int>, vector <pair<int, int> > , greater<pair<int, int> > > pq;
void Prim()
{
for(int i = 1; i <= n; i++)
C[i] = oo;
pq.push((make_pair(0, 1)));
C[1] = 0;
while(!pq.empty())
{
int nod = pq.top().second;
pq.pop();
inmst[nod] = 1;
for(int i = 0; i < G[nod].size(); i++)
{
int v = G[nod][i].first;
int c = G[nod][i].second;
if(!inmst[v] && C[v] > c)
{
C[v] = c;
pq.push(make_pair(C[v], v));
T[v] = nod;
}
}
}
}
int main()
{
fin >> n >> m;
for(int i = 1; i <= m; i++)
{
int x, y, c;
fin >> x >> y >> c;
G[x].push_back(make_pair(y, c));
G[y].push_back(make_pair(x, c));
}
Prim();
int ct = 0;
for(int i = 1; i <= n; i++)
ct += C[i];
fout << ct << "\n" << n-1 << "\n";
for(int i = 1; i <= n; i++)
{
if(T[i] == 0) continue;
fout << i << " " << T[i] << "\n";
}
}
Why doesn't the first one work as intended every time and how would I go about changing it while still using the struct function and the code basis I already have? I tried a similar implementation to the one I use for Dijkstra's algorithm.
The program reads the number of nodes and arches and all the given arches from a file and it's supposed to show the minimum cost of the spanning tree, the number of arches and the arches in any order.
The examples I have that fail for the 1st implementation are of pretty abnormal sizes, I don't know if they will be of any help:
apm.in:
164 531
155 74 113
73 15 817
38 87 -153
92 100 699
125 114 -210
5 50 -29
1 4 335
11 39 846
112 59 -745
157 86 -146
92 47 397
146 48 -614
81 123 539
8 36 -799
39 17 175
55 36 -133
14 129 809
134 107 948
153 97 -428
144 73 -975
31 41 293
76 95 -550
111 96 -906
132 54 35
19 36 -627
142 31 -949
127 52 -363
44 17 -913
141 69 36
163 2 -610
17 12 -187
65 41 941
160 39 931
69 127 966
98 128 528
144 145 354
49 86 -201
7 102 569
113 31 -151
155 139 752
13 94 -659
140 69 672
32 8 -945
72 19 -592
104 68 -631
5 87 -760
37 58 -211
32 74 134
88 60 622
128 77 -480
4 20 151
38 66 823
133 41 886
128 58 -522
115 68 403
62 128 379
24 156 3
152 22 -630
126 160 322
61 16 852
57 69 -650
126 99 371
87 54 -659
101 93 -44
4 22 899
128 16 222
96 132 -523
67 74 993
143 110 -346
128 9 -892
146 86 -773
14 8 306
114 156 116
91 77 -581
44 95 978
89 38 609
147 139 -486
67 34 -952
119 36 829
44 90 653
1 164 -197
77 157 -273
7 130 606
3 143 701
37 91 363
44 18 -814
53 34 -170
124 39 -384
38 80 -51
72 4 30
133 59 -53
121 10 676
20 142 967
159 84 -456
118 110 75
68 75 828
154 91 -83
94 128 -740
22 72 269
1 81 -371
58 154 98
73 146 -240
11 6 -254
80 62 -70
72 156 611
119 118 990
109 23 -67
103 97 -281
6 135 388
116 159 -948
1 50 -551
31 60 -577
52 47 -514
164 91 562
113 112 178
45 106 -667
160 22 952
17 156 748
125 34 36
94 93 440
139 117 890
43 144 -179
91 60 346
85 96 853
118 156 -991
67 107 718
60 89 649
17 28 -105
64 47 666
26 136 -174
31 147 835
79 115 -235
106 66 693
8 74 107
162 136 712
83 116 506
82 139 489
110 114 -299
96 69 -94
19 129 -361
30 129 612
122 91 -571
62 2 -318
38 143 662
117 142 -34
91 124 385
112 50 -460
14 81 405
129 145 227
71 106 -774
27 15 -339
157 85 251
146 84 726
127 46 -711
95 134 175
134 51 103
31 154 661
95 150 56
164 27 -845
31 127 -452
46 29 -264
74 102 -477
72 39 320
89 23 -811
12 83 -672
68 136 194
82 90 -326
52 81 819
109 47 -204
148 24 870
146 141 148
83 158 -198
77 9 -351
64 25 575
114 28 -992
29 139 630
21 130 -979
153 104 611
80 162 217
155 74 768
2 51 -643
75 97 -706
124 62 -69
36 135 -181
100 43 -163
146 129 54
126 106 799
15 155 907
125 153 658
85 51 702
112 95 80
149 84 -782
46 105 859
69 73 280
98 150 11
60 93 -997
82 134 -786
20 40 -166
134 90 -810
93 76 893
100 51 -161
43 92 314
162 28 525
121 141 -953
30 58 991
97 100 -890
54 23 314
63 92 -480
97 155 -736
29 136 -817
64 86 -424
86 53 613
96 38 -4
57 65 -789
8 6 -586
18 145 -959
136 19 -497
74 86 -895
7 155 -281
43 6 -814
43 69 361
134 141 257
67 46 -326
111 73 -249
11 13 -581
98 143 -909
133 78 -551
83 25 325
93 162 -503
138 31 -386
161 92 135
84 79 -80
12 108 41
86 158 109
71 3 334
27 62 -517
59 15 613
46 63 -316
74 39 996
37 11 -438
38 102 369
15 129 313
131 6 -841
152 109 -529
124 53 878
35 78 -994
116 117 -312
47 109 -12
47 36 534
84 63 -626
152 142 667
87 79 -201
52 22 -518
99 103 -434
139 53 262
162 1 -524
120 69 836
131 93 368
155 135 5
133 117 -818
59 15 854
37 139 931
111 8 -15
92 58 411
126 19 789
111 12 763
66 147 605
20 142 -446
156 163 -566
137 36 -350
127 156 -307
49 22 376
124 24 -863
36 161 175
63 27 -687
5 29 -375
27 69 -260
24 149 447
141 117 32
58 64 239
87 149 -919
65 101 -807
127 117 237
145 44 -731
32 74 535
142 13 -869
49 5 315
152 105 -747
10 133 -232
69 98 -253
134 86 458
129 48 -322
121 132 46
64 15 -216
103 38 -530
63 17 -871
69 38 -577
55 106 141
111 90 583
138 100 -478
67 43 -608
141 88 921
45 55 596
155 91 338
128 3 532
28 124 -839
134 101 240
36 41 -888
3 156 -139
79 151 446
41 150 978
160 3 70
5 45 -597
89 103 -849
123 56 -820
16 123 779
114 89 -534
160 147 -359
52 140 239
142 80 66
124 66 -18
89 23 945
162 108 -353
151 143 -912
68 121 656
23 122 730
17 8 -81
87 130 44
116 158 -234
16 123 430
66 130 -398
29 65 -844
105 43 -854
84 99 -730
107 162 729
128 153 175
146 13 538
135 43 -753
93 123 996
23 3 -436
45 133 -203
151 132 931
49 159 -358
147 120 -274
132 131 -192
94 141 -758
19 153 946
155 33 284
85 18 646
69 148 -720
142 125 965
80 63 -96
29 140 -129
116 50 -111
38 124 -750
156 102 -674
39 67 -459
50 150 -261
110 29 904
11 83 -520
58 65 449
34 144 -362
103 76 567
97 85 322
151 76 118
61 58 -636
7 143 535
61 26 40
10 57 -155
120 33 -871
28 53 -176
57 86 -602
161 92 -96
69 151 555
49 17 876
43 71 -91
47 118 -191
70 49 576
102 139 -920
60 153 873
80 124 222
30 20 -147
37 158 587
65 9 314
46 69 957
117 16 -831
74 106 -756
95 92 -222
52 147 310
2 61 -427
138 21 -256
113 94 273
162 105 -53
40 80 572
21 143 386
154 115 229
97 126 362
106 40 -164
60 100 -405
29 109 -506
133 35 -867
114 70 -169
132 46 -145
161 133 434
94 47 -939
86 91 543
110 155 -277
20 162 -683
32 145 304
135 124 -23
5 123 283
11 65 -858
31 128 223
54 97 585
8 93 688
91 58 -974
123 97 931
140 61 822
19 13 69
161 162 976
126 115 887
47 84 -502
12 157 -824
135 98 420
114 6 -605
66 138 -354
70 138 -596
56 87 145
37 159 -207
78 136 -573
49 57 271
154 14 859
103 139 -848
32 105 -927
163 126 -935
49 19 262
14 108 408
164 145 -612
37 135 -454
68 20 892
78 164 470
24 109 -598
70 53 -403
71 148 -983
92 46 851
26 34 -602
88 47 -667
66 59 750
142 99 319
43 57 967
109 17 654
85 108 -947
74 33 694
150 83 -845
129 7 -37
65 70 -668
4 102 771
158 69 -615
85 148 225
12 55 172
7 41 -83
123 103 937
110 137 -36
42 131 -392
153 18 -844
86 94 -404
77 44 -307
18 114 -372
75 115 99
53 4 -472
140 159 -844
46 67 -991
84 162 599
91 106 406
149 108 -811
142 22 -653
136 44 496
131 43 -2
122 37 375
103 109 -692
26 58 -822
84 128 -967
71 53 -162
74 18 -123
145 103 722
65 99 -961
56 15 -908
44 147 176
41 133 -145
96 63 915
35 20 -106
122 73 -845
11 150 917
5 105 -361
119 44 -261
27 76 215
129 11 -102
157 140 338
160 120 958
28 131 -194
36 106 -468
130 52 679
16 76 -514
151 156 236
2 137 -335
112 80 724
35 78 -535
44 121 119
62 59 -379
110 141 780
52 37 342
29 33 -49
89 7 828
87 131 171
44 130 419
86 45 438
103 128 558
24 129 -565
86 99 -758
51 110 -571
117 94 476
61 78 -875
127 101 -359
146 40 -871
87 48 -600
97 149 -165
3 58 507
88 37 -764
51 43 918
41 76 10
13 88 -835
apm.ok:
-105854
163
60 93
35 78
114 28
46 67
118 156
71 148
21 130
144 73
91 58
84 128
65 99
18 145
121 141
67 34
142 31
116 159
85 108
32 8
94 47
163 126
32 105
102 139
87 149
44 17
151 143
98 143
56 15
111 96
74 86
128 9
97 100
36 41
61 78
120 33
63 17
146 40
142 13
133 35
124 24
11 65
105 43
89 103
103 139
150 83
164 27
122 73
140 159
153 18
29 65
131 6
28 124
13 88
117 16
12 157
26 58
123 56
133 117
29 136
43 6
44 18
89 23
149 108
134 90
65 101
8 36
57 65
82 134
149 84
71 106
146 86
88 37
5 87
94 141
86 99
74 106
135 43
38 124
152 105
112 59
94 128
97 155
84 99
69 148
127 46
75 97
103 109
63 27
20 162
156 102
12 83
65 70
45 106
88 47
87 54
142 22
2 51
61 58
104 68
152 22
19 36
84 63
158 69
146 48
163 2
67 43
114 6
26 34
24 109
70 138
72 19
91 77
31 60
122 91
51 110
156 163
24 129
1 50
76 95
162 1
96 132
11 83
52 22
27 62
16 76
93 162
147 139
63 92
138 100
53 4
112 50
39 67
159 84
23 3
64 86
70 53
66 130
42 131
1 81
160 147
49 159
66 138
137 36
143 110
27 15
7 155
147 120
119 44
111 73
79 115
10 133
125 114
87 79
113 31
30 20
55 36
80 63
161 92
154 91
134 51
68 136
14 8
83 25
67 107
apm.out:
-105439
163
2 163
3 23
4 53
5 87
6 43
7 155
8 32
9 128
10 133
11 13
12 83
13 142
14 8
15 27
16 117
17 63
18 44
19 36
20 162
21 130
22 142
23 89
24 124
25 83
26 58
27 63
28 114
29 65
30 20
31 60
32 105
33 120
34 67
35 78
36 8
37 88
38 69
39 67
40 146
41 36
42 131
43 105
44 17
45 106
46 67
47 88
48 146
49 159
50 1
51 2
52 22
53 70
54 87
55 36
56 15
57 65
58 61
59 112
60 93
61 78
62 27
63 84
64 86
65 11
66 138
67 43
68 136
69 148
70 65
71 106
72 19
73 122
74 86
75 97
76 16
77 91
78 136
79 87
80 63
81 1
82 134
83 11
84 128
85 108
86 99
87 149
88 13
89 114
90 134
91 58
92 63
93 162
94 47
95 76
96 111
97 100
98 143
99 65
100 138
101 65
102 139
103 89
104 68
105 152
106 74
107 67
108 149
109 103
110 51
111 73
112 50
113 31
114 6
115 79
116 159
117 133
118 156
119 44
120 147
121 141
122 91
123 56
124 28
125 114
126 163
127 46
128 94
129 24
130 66
131 6
132 96
133 35
134 51
135 43
136 29
137 36
138 70
139 103
140 159
141 94
142 31
143 110
144 73
145 18
146 86
147 139
148 71
149 84
150 83
151 143
152 22
153 18
154 91
155 97
156 102
157 12
158 69
159 84
160 147
161 92
162 1
163 156
164 27
Every times you pop a node u from priority_queue, you need to update C[v] with v is adjacent node with u. These v may be already in the queue, so technically, you indirectly update the value of some elements in priority_queue (since value of an element is expressed via C[]). It will break the structure of the queue and lead to incorrect answer.
In the correct version, you push 2 int to queue, and these values never change. Therefore you do not get the above problem.
Looking through the exposed sample codes, I got a suspicion about an essential difference of comparison behaviors. To prove that suspicion, I put both versions of the sample codes into WinMerge and compared them. They look really similar. So, I'm quite sure I'm on the right track:
The first version uses this for comparison:
struct comp{
bool operator()(int x, int y)
{
return C[x] > C[y];
}
};
The second version uses this instead:
std::greater<pair<int, int> >
The big difference: std::greater considers both members of std::pair in comparison but the comparison function in first sample only C[x] and C[y] (but not x and y).
According to cppreference.com
template< class T1, class T2 >
constexpr bool operator>(const pair<T1,T2>& lhs, const pair<T1,T2>& rhs);
is defined as rhs < lhs and
template< class T1, class T2 >
constexpr bool operator<(const pair<T1,T2>& lhs, const pair<T1,T2>& rhs);
does
If lhs.first<rhs.first, returns true. Otherwise, if rhs.first<lhs.first, returns false. Otherwise, if lhs.second<rhs.second, returns true. Otherwise, returns false.
So, if the first comparison shall resemble the second, the comparison functor of first sample has to be changed to e.g.:
struct comp{
bool operator()(int x, int y)
{
return x == y ? C[x] > C[y] : x > y;
}
};
That looks a bit stupid as x == y surely results in C[x] == C[y]. However, it should return the exact same results as the std::greater<std::pair<int, int> > for the second sample code.
Concerning the original problem of the OP, the first version may actually be the correct one (and there is yet another mistake or a wrong expectation about output). In this case, the comparison of second sample had to be adjusted, e.g. introducing a resp. functor for std::pair:
struct comp{
bool operator()(
const std::pair<int, int> &xCx, const std::pair<int, int> &yCy) const
{
return xCx.second > yCy.second;
}
};
As I do not know Prim's algorithm, I cannot decide which one is the actually correct solution. The OP might leave a note regarding this (and I'm would be glad to edit this in).

gr-dect2 - Fatal Python error: PyThreadState_Get: no current thread

I installed gnuradio via macports. I have been able to install the majority of the other blocks via macports, however I was wanting to start playing with DECT and the block was not listed on macports. So I manually went to install it via the following git location:https://github.com/pavelyazev/gr-dect2
When I installed with the standard install, gnuradio did not see the block at all. After researching I found others having success by modifying the cmake call like that below.
cd gr-dect2/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/local ..
make
sudo make install
I was then able to see the dect2 block in gnuradio, however when I went to run the example dect2.grc project I was getting the below message:
Traceback (most recent call last):
File "/Users/krotovd/gr-dect2/grc/top_block.py", line 32, in <module>
import dect2
ImportError: No module named dect2
So I found where the other modules were installed, deleted the build directory and called the original build/install commands with a modification on cmake as shown below.
cmake -DCMAKE_INSTALL_PREFIX=/opt/local/Library/Frameworks/Python.framework/Versions/2.7
Now when I open gnuradio-companion and proceed to open the detc2.grc project it crashes with the error in the title:
Loading: "/Users/krotovd/gr-dect2/grc/dect2.grc"
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
Has anyone been able to successfully install a dect2 block for gnuradio in Mac? Seems like this has been an issue for some time now. Anyone have any ideas on how I might be able to resolve this issue?
Below is a excerpt of my error report. I am inserting the except due to the size, but I beleive what is important should be listed.
Process: Python [1753]
Path: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 2.7.13 (2.7.13)
Code Type: X86-64 (Native)
Parent Process: bash [546]
Responsible: Python [1753]
User ID: 501
Date/Time: 2017-01-23 20:38:31.511 -0500
OS Version: Mac OS X 10.12.2 (16C68)
Report Version: 12
Anonymous UUID: E0592F8C-772E-3B7D-EAF2-2AB68A3171B3
Time Awake Since Boot: 2800 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 0x00007fffd3291dd6 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fffd337d787 pthread_kill + 90
2 libsystem_c.dylib 0x00007fffd31f7420 abort + 129
3 org.python.python 0x00000001280ff8ee Py_FatalError + 49
4 org.python.python 0x00000001280fede8 PyThreadState_Get + 28
5 org.python.python 0x00000001280fbce2 Py_InitModule4_64 + 62
6 _dect2_swig.so 0x0000000128002bb0 init_dect2_swig + 800
7 org.python.python 0x000000010f5372ec _PyImport_LoadDynamicModule + 140
8 org.python.python 0x000000010f535cef import_submodule + 271
9 org.python.python 0x000000010f535778 load_next + 280
10 org.python.python 0x000000010f53480e PyImport_ImportModuleLevel + 1230
11 org.python.python 0x000000010f50d7c7 builtin___import__ + 135
12 org.python.python 0x000000010f519f91 PyEval_EvalFrameEx + 29441
13 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
14 org.python.python 0x000000010f51ed46 fast_function + 118
15 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
16 org.python.python 0x000000010f51ee22 fast_function + 338
17 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
18 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
19 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
20 org.python.python 0x000000010f5331a1 PyImport_ExecCodeModuleEx + 241
21 org.python.python 0x000000010f536273 load_source_module + 1059
22 org.python.python 0x000000010f535cef import_submodule + 271
23 org.python.python 0x000000010f535778 load_next + 280
24 org.python.python 0x000000010f5347b2 PyImport_ImportModuleLevel + 1138
25 org.python.python 0x000000010f50d7c7 builtin___import__ + 135
26 org.python.python 0x000000010f46f203 PyObject_Call + 99
27 org.python.python 0x000000010f518429 PyEval_EvalFrameEx + 22425
28 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
29 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
30 org.python.python 0x000000010f5331a1 PyImport_ExecCodeModuleEx + 241
31 org.python.python 0x000000010f536273 load_source_module + 1059
32 org.python.python 0x000000010f5365ef load_package + 303
33 org.python.python 0x000000010f535cef import_submodule + 271
34 org.python.python 0x000000010f535778 load_next + 280
35 org.python.python 0x000000010f5347b2 PyImport_ImportModuleLevel + 1138
36 org.python.python 0x000000010f50d7c7 builtin___import__ + 135
37 org.python.python 0x000000010f46f203 PyObject_Call + 99
38 org.python.python 0x000000010f518429 PyEval_EvalFrameEx + 22425
39 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
40 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
41 org.python.python 0x000000010f5419df PyRun_StringFlags + 127
42 org.python.python 0x000000010f51303a PyEval_EvalFrameEx + 938
43 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
44 org.python.python 0x000000010f51ed46 fast_function + 118
45 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
46 org.python.python 0x000000010f51ee22 fast_function + 338
47 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
48 org.python.python 0x000000010f51ee22 fast_function + 338
49 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
50 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
51 org.python.python 0x000000010f4965bb function_call + 363
52 org.python.python 0x000000010f46f203 PyObject_Call + 99
53 org.python.python 0x000000010f47d3a6 instancemethod_call + 182
54 org.python.python 0x000000010f46f203 PyObject_Call + 99
55 org.python.python 0x000000010f4ce90f slot_tp_init + 175
56 org.python.python 0x000000010f4caadb type_call + 347
57 org.python.python 0x000000010f46f203 PyObject_Call + 99
58 org.python.python 0x000000010f51a19d PyEval_EvalFrameEx + 29965
59 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
60 org.python.python 0x000000010f51ed46 fast_function + 118
61 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
62 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
63 org.python.python 0x000000010f51ed46 fast_function + 118
64 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
65 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
66 org.python.python 0x000000010f4965bb function_call + 363
67 org.python.python 0x000000010f46f203 PyObject_Call + 99
68 org.python.python 0x000000010f47d3a6 instancemethod_call + 182
69 org.python.python 0x000000010f46f203 PyObject_Call + 99
70 org.python.python 0x000000010f51e7c5 PyEval_CallObjectWithKeywords + 165
71 _gobject.so 0x0000000112dfe5cf pyg_closure_marshal + 212
72 libgobject-2.0.0.dylib 0x0000000112bd3a0d g_closure_invoke + 258
73 libgobject-2.0.0.dylib 0x0000000112be6f6a signal_emit_unlocked_R + 1768
74 libgobject-2.0.0.dylib 0x0000000112be7cb0 g_signal_emit_valist + 2028
75 libgobject-2.0.0.dylib 0x0000000112be8362 g_signal_emit + 134
76 libgtk-x11-2.0.0.dylib 0x000000011327595f gtk_widget_activate + 73
77 libgtk-x11-2.0.0.dylib 0x000000011318a275 gtk_menu_shell_activate_item + 241
78 libgtk-x11-2.0.0.dylib 0x000000011318ae1f gtk_menu_shell_button_release + 576
79 libgtk-x11-2.0.0.dylib 0x000000011317aa48 _gtk_marshal_BOOLEAN__BOXED + 95
80 libgobject-2.0.0.dylib 0x0000000112bd3a0d g_closure_invoke + 258
81 libgobject-2.0.0.dylib 0x0000000112be70d8 signal_emit_unlocked_R + 2134
82 libgobject-2.0.0.dylib 0x0000000112be7d0c g_signal_emit_valist + 2120
83 libgobject-2.0.0.dylib 0x0000000112be8362 g_signal_emit + 134
84 libgtk-x11-2.0.0.dylib 0x000000011327576f gtk_widget_event_internal + 573
85 libgtk-x11-2.0.0.dylib 0x0000000113178d4c gtk_propagate_event + 316
86 libgtk-x11-2.0.0.dylib 0x0000000113178961 gtk_main_do_event + 784
87 libgdk-x11-2.0.0.dylib 0x00000001134b3e02 gdk_event_dispatch + 81
88 libglib-2.0.0.dylib 0x0000000112c4248e g_main_context_dispatch + 279
89 libglib-2.0.0.dylib 0x0000000112c4277d g_main_context_iterate + 413
90 libglib-2.0.0.dylib 0x0000000112c429d3 g_main_loop_run + 207
91 libgtk-x11-2.0.0.dylib 0x00000001131783b2 gtk_main + 180
92 _gtk.so 0x0000000112e6b00b _wrap_gtk_main + 243
93 org.python.python 0x000000010f519fc3 PyEval_EvalFrameEx + 29491
94 org.python.python 0x000000010f51ee22 fast_function + 338
95 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
96 org.python.python 0x000000010f51ee22 fast_function + 338
97 org.python.python 0x000000010f519e87 PyEval_EvalFrameEx + 29175
98 org.python.python 0x000000010f512947 PyEval_EvalCodeEx + 2119
99 org.python.python 0x000000010f5120f6 PyEval_EvalCode + 54
100 org.python.python 0x000000010f541824 PyRun_FileExFlags + 164
101 org.python.python 0x000000010f54135e PyRun_SimpleFileExFlags + 702
102 org.python.python 0x000000010f557b1d Py_Main + 2925
103 libdyld.dylib 0x00007fffd3163255 start + 1
Thread 1:
0 libsystem_kernel.dylib 0x00007fffd32924e2 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fffd337a5fe _pthread_wqthread + 1023
2 libsystem_pthread.dylib 0x00007fffd337a1ed start_wqthread + 13
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx: 0x00007fff5079f2d8 rdx: 0x0000000000000000
rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007fff5079f300 rsp: 0x00007fff5079f2d8
r8: 0x0000000000000040 r9: 0x00007fffdbf8f040 r10: 0x0000000008000000 r11: 0x0000000000000206
r12: 0x00007f8052f7aa00 r13: 0x0000000128031a10 r14: 0x00007fffdbfab3c0 r15: 0x000000010f5f4bd8
rip: 0x00007fffd3291dd6 rfl: 0x0000000000000206 cr2: 0x00007fffdbf8d128
Logical CPU: 0
Error Code: 0x02000148
Trap Number: 133
Binary Images:
0x10f45c000 - 0x10f45dff3 +org.python.python (2.7.13 - 2.7.13) <4031A4B2-CD49-3FB0-9724-9F0C756687F4> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x10f460000 - 0x10f59bfff +org.python.python (2.7.13, [c] 2001-2016 Python Software Foundation. - 2.7.13) <38C706B7-56D9-3A4D-A882-E7CB1BD22812> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python
0x10f822000 - 0x10f824fff +_locale.so (0) <48641A39-37F1-3CE1-84E2-D7B84805CDFE> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
0x10f828000 - 0x10f830ff3 +libintl.8.dylib (0) <34C7A792-8F97-3B47-BE05-892044CF0A65> /opt/local/lib/libintl.8.dylib
.....
0x7fffd3364000 - 0x7fffd336dff3 libsystem_notify.dylib (165.20.1) <E7FD3A7C-DD07-36E2-9FA4-7561F9F114DA> /usr/lib/system/libsystem_notify.dylib
0x7fffd336e000 - 0x7fffd3376fe7 libsystem_platform.dylib (126.1.2) <3CA06D4E-C00A-36DE-AA65-3A390097D1F6> /usr/lib/system/libsystem_platform.dylib
0x7fffd3377000 - 0x7fffd3381ff7 libsystem_pthread.dylib (218.30.1) <C869ED7C-BE29-3532-8E69-3A8DA1447EDC> /usr/lib/system/libsystem_pthread.dylib
0x7fffd3382000 - 0x7fffd3385ff7 libsystem_sandbox.dylib (592.31.1) <7BBFDF96-293F-3DD9-B3A4-7C168280B441> /usr/lib/system/libsystem_sandbox.dylib
0x7fffd3386000 - 0x7fffd3387fff libsystem_secinit.dylib (24) <5C1F1E47-0F7D-3E25-8DEB-D9DB1F902281> /usr/lib/system/libsystem_secinit.dylib
0x7fffd3388000 - 0x7fffd338ffff libsystem_symptoms.dylib (532.30.6) <5D990CF5-B58F-39F7-B375-99B4EC62CFBD> /usr/lib/system/libsystem_symptoms.dylib
0x7fffd3390000 - 0x7fffd33b0ff7 libsystem_trace.dylib (518.30.7) <5BD4ECD4-75CA-38EA-AF5C-B481C15955F8> /usr/lib/system/libsystem_trace.dylib
0x7fffd33b1000 - 0x7fffd33b6ffb libunwind.dylib (35.3) <9F7C2AD8-A9A7-3DE4-828D-B0F0F166AAA0> /usr/lib/system/libunwind.dylib
0x7fffd33b7000 - 0x7fffd33e0ff7 libxpc.dylib (972.30.7) <65E41BB6-EBD5-3D93-B0BE-B190CEE4DD93> /usr/lib/system/libxpc.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: 1427
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=485.7M resident=0K(0%) swapped_out_or_unallocated=485.7M(100%)
Writable regions: Total=265.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=265.2M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 2
Dispatch continuations 16.0M 2
Kernel Alloc Once 8K 2
MALLOC 123.4M 43
MALLOC guard page 32K 7
STACK GUARD 56.0M 3
Stack 8712K 3
VM_ALLOCATE 88.5M 113
__DATA 61.6M 476
__IMAGE 528K 2
__LINKEDIT 162.3M 222
__TEXT 323.3M 425
__UNICODE 556K 2
mapped file 27.2M 4
shared memory 336K 8
=========== ======= =======
TOTAL 868.5M 1299
Model: MacBookPro10,1, BootROM MBP101.00EE.B0B, 4 processors, Intel Core i7, 2.7 GHz, 16 GB, SMC 2.3f36
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In
Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (7.21.171.68.1a4)
Bluetooth: Version 5.0.2f4, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SD512E, 500.28 GB
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: FaceTime HD Camera (Built-in)
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: Hub
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: USB 3.0 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc., 23.4
try my cmake alias, it always worked for me
alias cm='cmake -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7 -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python -DGR_PYTHON_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_INSTALL_PREFIX=/opt/local'

QWebView App crashes when loading (with logs) and painting

0 WTFCrash assertions.cpp 345 0x10f50517
1 WTF::OwnPtr::operator-> ownptr.h 72 0xffbc8cd
2 WebCore::BitmapTextureImageBuffer::updateContents texturemapperimagebuffer.cpp 62 0x109cb865
3 WebCore::TextureMapperTile::updateContents texturemappertile.cpp 70 0x109cfdb5
4 WebCore::TextureMapperTiledBackingStore::updateContents texturemappertiledbackingstore.cpp 147 0x109c1831
5 WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded graphicslayertexturemapper.cpp 624 0x103b852e
6 WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly graphicslayertexturemapper.cpp 444 0x103b79b4
7 WebCore::GraphicsLayerTextureMapper::flushCompositingState graphicslayertexturemapper.cpp 591 0x103b78c7
8 WebCore::GraphicsLayerTextureMapper::flushCompositingState graphicslayertexturemapper.cpp 596 0x103b796f
9 WebCore::GraphicsLayerTextureMapper::flushCompositingState graphicslayertexturemapper.cpp 596 0x103b796f
10 WebCore::GraphicsLayerTextureMapper::flushCompositingState graphicslayertexturemapper.cpp 596 0x103b796f
11 WebCore::GraphicsLayerTextureMapper::flushCompositingState graphicslayertexturemapper.cpp 596 0x103b796f
12 WebCore::GraphicsLayerTextureMapper::flushCompositingState graphicslayertexturemapper.cpp 596 0x103b796f
13 WebCore::RenderLayerCompositor::flushPendingLayerChanges renderlayercompositor.cpp 399 0x1010ef84
14 WebCore::FrameView::flushCompositingStateForThisFrame frameview.cpp 937 0xffda850
15 WebCore::FrameView::paintContents frameview.cpp 3613 0xffdd1a0
16 QWebFrameAdapter::renderRelativeCoords qwebframeadapter.cpp 539 0xfb0787c
17 QWebFrame::render qwebframe.cpp 644 0x60e96a96
18 QWebFrame::render qwebframe.cpp 655 0x60e96a54
19 QWebView::paintEvent qwebview.cpp 833 0x60ea34e8
20 QWidget::event qwidget.cpp 8114 0x778e9b5c
21 QWebView::event qwebview.cpp 732 0x60ea30dc
22 QApplicationPrivate::notify_helper qapplication.cpp 3500 0x778a1dde
23 QApplication::notify qapplication.cpp 3465 0x7789fdbe
24 QCoreApplication::notifyInternal qcoreapplication.cpp 935 0x66412d04
25 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 240 0x66528938
26 QWidgetPrivate::drawWidget qwidget.cpp 5151 0x778ef4f1
27 QWidgetBackingStore::doSync qwidgetbackingstore.cpp 1180 0x778b2a74
28 QWidgetBackingStore::sync qwidgetbackingstore.cpp 1027 0x778b0f40
29 QWidgetPrivate::syncBackingStore qwidget.cpp 1693 0x778f13e1
30 QWidget::event qwidget.cpp 8252 0x778e9ee2
31 QWebView::event qwebview.cpp 732 0x60ea30dc
32 QApplicationPrivate::notify_helper qapplication.cpp 3500 0x778a1dde
33 QApplication::notify qapplication.cpp 3465 0x7789fdbe
34 QCoreApplication::notifyInternal qcoreapplication.cpp 935 0x66412d04
35 QCoreApplication::sendEvent qcoreapplication.h 237 0x6641c0d9
36 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1539 0x66413ce6
37 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1397 0x664117c2
38 QWindowsGuiEventDispatcher::sendPostedEvents qwindowsguieventdispatcher.cpp 88 0x5223bf1
39 qt_internal_proc qeventdispatcher_win.cpp 423 0x664aa392
40 _InternalCallWinProc USER32 0x77467834
41 UserCallWinProcCheckWow USER32 0x77467a9a
42 DispatchMessageWorker USER32 0x7746988e
43 DispatchMessageW USER32 0x774698f1
44 QEventDispatcherWin32::processEvents qeventdispatcher_win.cpp 757 0x664aac85
45 QWindowsGuiEventDispatcher::processEvents qwindowsguieventdispatcher.cpp 80 0x5223b1c
46 QEventLoop::processEvents qeventloop.cpp 137 0x6640eb8c
47 QEventLoop::exec qeventloop.cpp 212 0x6640ed82
48 MainWindow::waitForLoad mainwindow.cpp 345 0xe10fd2
49 MainWindow::thread mainwindow.cpp 460 0xe0729b
50 MainWindow::on_GoButton_clicked mainwindow.cpp 99 0xe04b32
51 MainWindow::qt_static_metacall moc_mainwindow.cpp 72 0xe2f5a8
52 MainWindow::qt_metacall moc_mainwindow.cpp 100 0xe2f53b
53 QMetaObject::metacall qmetaobject.cpp 309 0x6641ede0
54 QMetaObject::activate qobject.cpp 3695 0x6645da56
55 QMetaObject::activate qobject.cpp 3546 0x6645d411
56 QAbstractButton::clicked moc_qabstractbutton.cpp 294 0x77d4809b
57 QAbstractButtonPrivate::emitClicked qabstractbutton.cpp 544 0x779f6657
58 QAbstractButtonPrivate::click qabstractbutton.cpp 536 0x779f5bdb
59 QAbstractButton::mouseReleaseEvent qabstractbutton.cpp 1141 0x779f5042
60 QWidget::event qwidget.cpp 7962 0x778e957c
61 QAbstractButton::event qabstractbutton.cpp 1098 0x779f4ba1
62 QPushButton::event qpushbutton.cpp 682 0x77ab6f1b
63 QApplicationPrivate::notify_helper qapplication.cpp 3500 0x778a1dde
64 QApplication::notify qapplication.cpp 3067 0x7789e5ee
65 QCoreApplication::notifyInternal qcoreapplication.cpp 935 0x66412d04
66 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 240 0x66528938
67 QApplicationPrivate::sendMouseEvent qapplication.cpp 2540 0x778a3123
68 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 505 0x779249f1
69 QWidgetWindow::event qwidgetwindow.cpp 180 0x77923c0e
70 QApplicationPrivate::notify_helper qapplication.cpp 3500 0x778a1dde
71 QApplication::notify qapplication.cpp 2953 0x7789dfb7
72 QCoreApplication::notifyInternal qcoreapplication.cpp 935 0x66412d04
73 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 240 0x66528938
74 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 1701 0x10c82af
75 QGuiApplicationPrivate::processWindowSystemEvent qguiapplication.cpp 1502 0x10ca1d9
76 QWindowSystemInterface::sendWindowSystemEvents qwindowsysteminterface.cpp 579 0x10acad1
77 QWindowsGuiEventDispatcher::sendPostedEvents qwindowsguieventdispatcher.cpp 89 0x5223c01
78 qt_internal_proc qeventdispatcher_win.cpp 423 0x664aa392
79 _InternalCallWinProc USER32 0x77467834
80 UserCallWinProcCheckWow USER32 0x77467a9a
81 DispatchMessageWorker USER32 0x7746988e
82 DispatchMessageW USER32 0x774698f1
83 QEventDispatcherWin32::processEvents qeventdispatcher_win.cpp 757 0x664aac85
84 QWindowsGuiEventDispatcher::processEvents qwindowsguieventdispatcher.cpp 80 0x5223b1c
85 QEventLoop::processEvents qeventloop.cpp 137 0x6640eb8c
86 QEventLoop::exec qeventloop.cpp 212 0x6640ed82
87 QCoreApplication::exec qcoreapplication.cpp 1188 0x66411312
88 QGuiApplication::exec qguiapplication.cpp 1437 0x10c6e78
89 QApplication::exec qapplication.cpp 2746 0x7789dab9
90 main main.cpp 10 0xe02c18 91 WinMain qtmain_win.cpp 131 0xe3145a
92 __tmainCRTStartup crtexe.c 528 0xe30872
93 WinMainCRTStartup crtexe.c 377 0xe3063d
94 BaseThreadInitThunk KERNEL32 0x772f919f
95 __RtlUserThreadStart ntdll 0x7771a8cb
96 _RtlUserThreadStart ntdll 0x7771a8a1
It outputs
QPainter::begin: Paint device returned engine == 0, type: 2 ASSERTION
FAILED: m_ptr
c:\work\build\qt5_workdir\w\s\qtwebkit\Source\WTF\wtf/OwnPtr.h(72) :
WTF::OwnPtr::operator ->
In function
bool MainWindow::waitForLoad(QWebView& view)
{
QEventLoop loopLoad;
QTimer timer;
QObject::connect(&view, SIGNAL(loadFinished(bool)), &loopLoad, SLOT(quit()));
QObject::connect(&view, SIGNAL(loadFinished(bool)), &timer, SLOT(stop()));
QObject::connect(&timer, SIGNAL(timeout()), &loopLoad, SLOT(quit()));
timer.start(timeout);
loopLoad.exec();
if(timer.isActive())
{
timer.stop();
view.stop();
return false;
}
return true;
}
On the line "loopLoad.exec();"
Please help me. What's wrong with my code? Or how to fix that? I ready to disable any user-controls, css, images and ect. Advise me how to make it work
I know the answer! To fix this problem, enable autoload images!