My code run on iOS 10.3 correctly. but on iOS 11 on simulator or my iPhone get this error:
CoreData: annotation: Failed to load optimized model at path '/Users/imohammadi/Library/Developer/CoreSimulator/Devices/054E361B-16B2-43D6-9708-A59401DE29B8/data/Containers/Bundle/Application/71EBDC7D-4708-4349-A54B-08E3F6E38D48/iAtlas.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
When app run for first time, google map run correctlly, but after close and run again, app wants to load tiles from caches and crash by error.
downgrade GoogleMaps 2.2 and upgrade to last version cocoapods not solved error.
All log is here:
["/Users/imohammadi/Library/Developer/CoreSimulator/Devices/054E361B-16B2-43D6-9708-A59401DE29B8/data/Containers/Data/Application/71371217-5D6D-4BC1-97C4-4ED1FEBDF8EF/Documents"]
2017-10-22 15:39:11.908262+0330 iAtlas[19195:648732] [MC] Lazy loading NSBundle MobileCoreServices.framework
2017-10-22 15:39:11.909174+0330 iAtlas[19195:648732] [MC] Loaded MobileCoreServices.framework
2017-10-22 15:39:11.927694+0330 iAtlas[19195:648732] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/imohammadi/Library/Developer/CoreSimulator/Devices/054E361B-16B2-43D6-9708-A59401DE29B8/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
CoreData: annotation: Failed to load optimized model at path '/Users/imohammadi/Library/Developer/CoreSimulator/Devices/054E361B-16B2-43D6-9708-A59401DE29B8/data/Containers/Bundle/Application/F46E955A-F5B6-42A8-B435-3A488DB69C55/iAtlas.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
CoreData: annotation: Failed to load optimized model at path '/Users/imohammadi/Library/Developer/CoreSimulator/Devices/054E361B-16B2-43D6-9708-A59401DE29B8/data/Containers/Bundle/Application/F46E955A-F5B6-42A8-B435-3A488DB69C55/iAtlas.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
CoreData: annotation: Failed to load optimized model at path '/Users/imohammadi/Library/Developer/CoreSimulator/Devices/054E361B-16B2-43D6-9708-A59401DE29B8/data/Containers/Bundle/Application/F46E955A-F5B6-42A8-B435-3A488DB69C55/iAtlas.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 19195, TID: 649127, Thread name: com.google.Maps.LabelingBehavior, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4 iAtlas 0x000000010f3049a4 GMSIsApplicationInBackground + 53
5 iAtlas 0x000000010f2f2bfa -[GMSForegroundDispatchQueue initWithName:targetQueue:] + 269
6 iAtlas 0x000000010f3d2a6e _ZN7gmscore6vector4text8GlyphSetC2ERKNS_4base10reffed_ptrINS0_16TextureAtlasPoolEEEPU28objcproto17OS_dispatch_queue8NSObjectPK8__CTFontff + 344
7 iAtlas 0x000000010f3d1ed8 _ZN7gmscore6vector4text10GlyphCache11GetGlyphSetEPK8__CTFontf + 214
8 iAtlas 0x000000010f3cf98e _ZN7gmscore6vector4text6GLText14PrefetchGlyphsERKNS_4base10reffed_ptrINS1_10GlyphCacheEEERKNSt3__16vectorItNS9_9allocatorItEEEEPK8__CTFontf + 22
9 iAtlas 0x000000010f3cfa91 _ZN7gmscore6vector4text6GLText14PrefetchGlyphsERKNS_4base10reffed_ptrINS1_10GlyphCacheEEEPK8__CTLinebf + 207
10 iAtlas 0x000000010f32775f _ZN7gmscore6vector12GLPointLabel22PrefetchGlyphsForGroupEPNS0_12GLLabelGroupE + 181
11 iAtlas 0x000000010f327687 _ZN7gmscore6vector12GLPointLabel14PrefetchGlyphsEv + 33
12 iAtlas 0x000000010f3966aa _ZN7gmscore6vector16LabelingBehavior23CreatePendingOperationsERKNSt3__13setINS_4base10reffed_ptrINS0_7GLLabelEEENS2_4lessIS7_EENS2_9allocatorIS7_EEEESE_SE_NS0_13LabelDrawModeE + 1096
13 iAtlas 0x000000010f39601d _ZN7gmscore6vector16LabelingBehavior14RunLabelingJobERKNS_4base10reffed_ptrINS1_11LabelingJobEEE + 357
14 iAtlas 0x000000010f395eaa ___ZN7gmscore6vector16LabelingBehavior14CommitInternalEPNS_8renderer14EntityRendererE_block_invoke + 22
15 Foundation 0x0000000113fad948 __NSThreadPerformPerform + 334
16 CoreFoundation 0x0000000114bac2b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
17 CoreFoundation 0x0000000114c4bd31 __CFRunLoopDoSource0 + 81
18 CoreFoundation 0x0000000114b90c19 __CFRunLoopDoSources0 + 185
19 CoreFoundation 0x0000000114b901ff __CFRunLoopRun + 1279
20 CoreFoundation 0x0000000114b8fa89 CFRunLoopRunSpecific + 409
21 Foundation 0x0000000113f67e5e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 274
22 iAtlas 0x000000010f3d1165 -[GMSx_GTMSimpleWorkerThread main] + 337
23 Foundation 0x0000000113f758ac __NSThread__start__ + 1197
24 libsystem_pthread.dylib 0x00000001162f36c1 _pthread_body + 340
25 libsystem_pthread.dylib 0x00000001162f356d _pthread_body + 0
26 libsystem_pthread.dylib 0x00000001162f2c5d thread_start + 13
2017-10-22 15:39:13.649828+0330 iAtlas[19195:649127] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 19195, TID: 649127, Thread name: com.google.Maps.LabelingBehavior, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4 iAtlas 0x000000010f3049a4 GMSIsApplicationInBackground + 53
5 iAtlas 0x000000010f2f2bfa -[GMSForegroundDispatchQueue initWithName:targetQueue:] + 269
6 iAtlas 0x000000010f3d2a6e _ZN7gmscore6vector4text8GlyphSetC2ERKNS_4base10reffed_ptrINS0_16TextureAtlasPoolEEEPU28objcproto17OS_dispatch_queue8NSObjectPK8__CTFontff + 344
7 iAtlas 0x000000010f3d1ed8 _ZN7gmscore6vector4text10GlyphCache11GetGlyphSetEPK8__CTFontf + 214
8 iAtlas 0x000000010f3cf98e _ZN7gmscore6vector4text6GLText14PrefetchGlyphsERKNS_4base10reffed_ptrINS1_10GlyphCacheEEERKNSt3__16vectorItNS9_9allocatorItEEEEPK8__CTFontf + 22
9 iAtlas 0x000000010f3cfa91 _ZN7gmscore6vector4text6GLText14PrefetchGlyphsERKNS_4base10reffed_ptrINS1_10GlyphCacheEEEPK8__CTLinebf + 207
10 iAtlas 0x000000010f32775f _ZN7gmscore6vector12GLPointLabel22PrefetchGlyphsForGroupEPNS0_12GLLabelGroupE + 181
11 iAtlas 0x000000010f327687 _ZN7gmscore6vector12GLPointLabel14PrefetchGlyphsEv + 33
12 iAtlas 0x000000010f3966aa _ZN7gmscore6vector16LabelingBehavior23CreatePendingOperationsERKNSt3__13setINS_4base10reffed_ptrINS0_7GLLabelEEENS2_4lessIS7_EENS2_9allocatorIS7_EEEESE_SE_NS0_13LabelDrawModeE + 1096
13 iAtlas 0x000000010f39601d _ZN7gmscore6vector16LabelingBehavior14RunLabelingJobERKNS_4base10reffed_ptrINS1_11LabelingJobEEE + 357
14 iAtlas 0x000000010f395eaa ___ZN7gmscore6vector16LabelingBehavior14CommitInternalEPNS_8renderer14EntityRendererE_block_invoke + 22
15 Foundation 0x0000000113fad948 __NSThreadPerformPerform + 334
16 CoreFoundation 0x0000000114bac2b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
17 CoreFoundation 0x0000000114c4bd31 __CFRunLoopDoSource0 + 81
18 CoreFoundation 0x0000000114b90c19 __CFRunLoopDoSources0 + 185
19 CoreFoundation 0x0000000114b901ff __CFRunLoopRun + 1279
20 CoreFoundation 0x0000000114b8fa89 CFRunLoopRunSpecific + 409
21 Foundation 0x0000000113f67e5e -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 274
22 iAtlas 0x000000010f3d1165 -[GMSx_GTMSimpleWorkerThread main] + 337
23 Foundation 0x0000000113f758ac __NSThread__start__ + 1197
24 libsystem_pthread.dylib 0x00000001162f36c1 _pthread_body + 340
25 libsystem_pthread.dylib 0x00000001162f356d _pthread_body + 0
26 libsystem_pthread.dylib 0x00000001162f2c5d thread_start + 13
2017-10-22 15:39:15.284603+0330 iAtlas[19195:649136] [BoringSSL] Function boringssl_context_get_peer_sct_list: line 1754 received sct extension length is less than sct data length
2017-10-22 15:39:15.562982+0330 iAtlas[19195:649136] [BoringSSL] Function boringssl_context_get_peer_sct_list: line 1754 received sct extension length is less than sct data length
2017-10-22 15:39:16.191452+0330 iAtlas[19195:648732] Google Maps SDK for iOS version: 2.4.30121.0
2017-10-22 15:39:16.195285+0330 iAtlas[19195:649136] TIC Read Status [1:0x0]: 1:57
2017-10-22 15:39:16.195452+0330 iAtlas[19195:649136] TIC Read Status [1:0x0]: 1:57
This issue was reported in Google issue tracker:
https://issuetracker.google.com/issues/64504919
As I can see, the issue was marked as fixed today (October 24, 2017). The Google rep wrote
We believe that this issue should be solved in the Maps iOS SDK v2.5 release. If this issue still occurs, please let us know.
It looks like you have to update your SDK to the latest version 2.5 in order to solve the problem.
UPDATE
It looks like the issue wasn't solved in version 2.5, the bug was reopened in Google issue tracker.
I'm developing a Chrome extension that was reading some data (share numbers) from Pinterest. I had to stop development on it, but it was working OK (I was able to retrieve share numbers and all).
Now that my client wants this again, I restarted work but I'm really dumbfounded because the application now crashes Chrome when the launchWebAuthFlow method is called.
I am able to launch this kind of flow with Dropbox and other OAuth providers. For some reason, when using Pinterest the whole Chrome process crashes hard.
The auth code looks like this (*I've inlined some variables for readability):
var redirectUri = chrome.identity.getRedirectURL("pinterest");
var authUrl = 'https://api.pinterest.com/oauth/?' +
'response_type=code'+
'&redirect_uri='+ encodeURIComponent(redirectUri) +
'&client_id=4831470687770133014'+
'&scope=read_public'+
'&state=somethingRandom';
chrome.identity.launchWebAuthFlow(
{'url': authUrl, 'interactive': true},
function(redirect_url) { console.log(redirect_url);}
);
The authUrl then looks something like this:
https://api.pinterest.com/oauth/?response_type=code&redirect_uri=https://bkjcojjjcgnfgncncmdlbeemoljomghm.chromiumapp.org/pinterest&client_id=4831470687770133014&scope=read_public&state=3875186
If you copy/paste this URL in your browser, you'll see that it works. But when used part of the launchWebAuthFlow, BOOM!
Why??
Spec:
Chrome: 53.0.2785.143
Mac OS: El Captain 10.11.6
This is the Mac OS crash report:
Process: Google Chrome [16077]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 53.0.2785.143 (2785.143)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Google Chrome [16077]
User ID: 501
Date/Time: 2016-10-03 21:09:38.740 -0400
OS Version: Mac OS X 10.11.6 (15G31)
Report Version: 11
Anonymous UUID: AD141569-EBED-B1D4-DF7D-27A6CE685215
Sleep/Wake UUID: 8917F66A-5515-40E1-AA86-8BE0BE1DC1A9
Time Awake Since Boot: 14000 seconds
Time Since Wake: 1600 seconds
System Integrity Protection: enabled
Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000001e8
VM Regions Near 0x1e8:
-->
__TEXT 00000001051ac000-00000001051ad000 [ 4K] r-x/rwx SM=COW /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 com.google.Chrome.framework 0x0000000109d656d2 0x105413000 + 76883666
1 com.google.Chrome.framework 0x0000000109d655c9 0x105413000 + 76883401
2 com.google.Chrome.framework 0x00000001055a42f6 0x105413000 + 1643254
3 com.google.Chrome.framework 0x00000001054c0201 0x105413000 + 709121
4 com.google.Chrome.framework 0x00000001054c03b7 0x105413000 + 709559
5 com.google.Chrome.framework 0x0000000106e3cc29 0x105413000 + 27434025
6 com.google.Chrome.framework 0x0000000106e467f7 0x105413000 + 27473911
7 com.google.Chrome.framework 0x000000010693a148 0x105413000 + 22180168
8 com.google.Chrome.framework 0x0000000106939889 0x105413000 + 22177929
9 com.google.Chrome.framework 0x0000000106e46ad7 0x105413000 + 27474647
10 com.google.Chrome.framework 0x0000000106933a8e 0x105413000 + 22153870
11 com.google.Chrome.framework 0x00000001069315ea 0x105413000 + 22144490
12 com.google.Chrome.framework 0x00000001069318e4 0x105413000 + 22145252
13 com.google.Chrome.framework 0x000000010693ed33 0x105413000 + 22199603
14 com.google.Chrome.framework 0x00000001059a201b 0x105413000 + 5828635
15 com.google.Chrome.framework 0x00000001059c47ac 0x105413000 + 5969836
16 com.google.Chrome.framework 0x00000001059c4abc 0x105413000 + 5970620
17 com.google.Chrome.framework 0x00000001059c4e1b 0x105413000 + 5971483
18 com.google.Chrome.framework 0x000000010599731d 0x105413000 + 5784349
19 com.google.Chrome.framework 0x00000001059ba71a 0x105413000 + 5928730
20 com.google.Chrome.framework 0x0000000105996d24 0x105413000 + 5782820
21 com.apple.CoreFoundation 0x00007fff98059881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 com.apple.CoreFoundation 0x00007fff98038fbc __CFRunLoopDoSources0 + 556
23 com.apple.CoreFoundation 0x00007fff980384df __CFRunLoopRun + 927
24 com.apple.CoreFoundation 0x00007fff98037ed8 CFRunLoopRunSpecific + 296
25 com.apple.HIToolbox 0x00007fff909fb935 RunCurrentEventLoopInMode + 235
26 com.apple.HIToolbox 0x00007fff909fb76f ReceiveNextEventCommon + 432
27 com.apple.HIToolbox 0x00007fff909fb5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
28 com.apple.AppKit 0x00007fff8f014df6 _DPSNextEvent + 1067
29 com.apple.AppKit 0x00007fff8f014226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
30 com.apple.AppKit 0x00007fff8f008d80 -[NSApplication run] + 682
31 com.google.Chrome.framework 0x0000000105997b4e 0x105413000 + 5786446
32 com.google.Chrome.framework 0x0000000105997174 0x105413000 + 5783924
33 com.google.Chrome.framework 0x00000001059dc811 0x105413000 + 6068241
34 com.google.Chrome.framework 0x00000001054b6ce5 0x105413000 + 670949
35 com.google.Chrome.framework 0x0000000108efc984 0x105413000 + 61774212
36 com.google.Chrome.framework 0x0000000108efee02 0x105413000 + 61783554
37 com.google.Chrome.framework 0x0000000108ef8f2d 0x105413000 + 61759277
38 com.google.Chrome.framework 0x0000000105953c90 0x105413000 + 5508240
39 com.google.Chrome.framework 0x0000000105952ed6 0x105413000 + 5504726
40 com.google.Chrome.framework 0x0000000105415aea ChromeMain + 58
41 com.google.Chrome 0x00000001051acd42 main + 530
42 com.google.Chrome 0x00000001051acb24 0x1051ac000 + 2852
etc....
An update to Chrome about a month after this question was asked fixed this issue.
i have issues to install Mix, i updated everything and still have the same issue :
Process: Mix-ide [29364]
Path: /usr/local/Cellar/cpp-ethereum/1.2.4/Mix-ide.app/Contents/MacOS/Mix-ide
Identifier: .
Version: ??? (mix )
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Mix-ide [29364]
User ID: 501
Date/Time: 2016-05-03 16:09:56.394 +0200
OS Version: Mac OS X 10.11.4 (15E65)
Report Version: 11
Anonymous UUID: 13C99257-E029-CFC4-7857-A40E5D5F192E
Sleep/Wake UUID: 56AA9A03-8627-4D70-87F0-8D3C65C820CA
Time Awake Since Boot: 97000 seconds
Time Since Wake: 5700 seconds
System Integrity Protection: enabled
Crashed Thread: 3 QThread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Thread 0:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 libethereum.dylib 0x0000000113024880 0x112f4b000 + 891008
1 libethereum.dylib 0x0000000112fdeb9d dev::eth::ChainParams::genesisBlock() const + 1081
2 libethereum.dylib 0x0000000112f9264c dev::eth::BlockChain::genesis() const + 164
3 libethereum.dylib 0x0000000112f921db dev::eth::BlockChain::init(dev::eth::ChainParams const&, std::__1::basic_string, std::__1::allocator > const&) + 171
4 libethereum.dylib 0x0000000112f91e9f dev::eth::BlockChain::BlockChain(dev::eth::ChainParams const&, std::__1::basic_string, std::__1::allocator > const&, dev::WithExisting, std::__1::function const&) + 979
5 . 0x000000010d03afbd dev::mix::MixBlockChain::MixBlockChain(std::__1::basic_string, std::__1::allocator > const&, std::__1::unordered_mapdev::FixedHash<20u, dev::eth::Account, std::__1::hashdev::FixedHash<20u >, std::__1::equal_todev::FixedHash<20u >, std::__1::allocatorstd::__1::pair<dev::FixedHash<20u const, dev::eth::Account> > > const&) + 99
6 . 0x000000010d03b864 dev::mix::MixClient::resetState(std::__1::unordered_mapdev::FixedHash<20u, dev::eth::Account, std::__1::hashdev::FixedHash<20u >, std::__1::equal_todev::FixedHash<20u >, std::__1::allocatorstd::__1::pair<dev::FixedHash<20u const, dev::eth::Account> > > const&, dev::SecureFixedHash<32u> const&) + 490
7 . 0x000000010d03b51c dev::mix::MixClient::MixClient(std::__1::basic_string, std::__1::allocator > const&) + 300
8 . 0x000000010cfd96da dev::mix::ClientModel::init(QString) + 446
9 . 0x000000010d073cc8 0x10cfcc000 + 687304
10 . 0x000000010d074aea dev::mix::ClientModel::qt_metacall(QMetaObject::Call, int, void) + 112
11 org.qt-project.QtQml 0x00000001123c540b 0x112248000 + 1561611
12 org.qt-project.QtQml 0x00000001123c3ec0 0x112248000 + 1556160
13 org.qt-project.QtQml 0x00000001123c326b QV4::QObjectMethod::callInternal(QV4::CallData) const + 1099
14 org.qt-project.QtQml 0x00000001123d8656 QV4::Runtime::callProperty(QV4::ExecutionEngine, int, QV4::CallData) + 1206
15 ??? 0x0000000118c5af7e 0 + 4710575998
16 org.qt-project.QtQml 0x000000011236fb59 0x112248000 + 1211225
17 org.qt-project.QtQml 0x0000000112467894 QQmlJavaScriptExpression::evaluate(QV4::CallData, bool*) + 644
18 org.qt-project.QtQml 0x000000011240e26d QQmlBoundSignalExpression::evaluate(void) + 829
19 org.qt-project.QtQml 0x000000011240e975 0x112248000 + 1862005
20 org.qt-project.QtQml 0x00000001124482f5 QQmlNotifier::emitNotify(QQmlNotifierEndpoint, void) + 741
21 org.qt-project.QtCore 0x00000001129891a7 QMetaObject::activate(QObject, int, int, void) + 199
22 org.qt-project.QtQml 0x000000011247d5fd 0x112248000 + 2315773
23 org.qt-project.QtQml 0x0000000112404049 QQmlComponentPrivate::complete(QQmlEnginePrivate, QQmlComponentPrivate::ConstructionState) + 73
24 org.qt-project.QtQml 0x0000000112402269 QQmlComponentPrivate::completeCreate() + 41
25 org.qt-project.QtQml 0x0000000112403a22 QQmlComponent::create(QQmlContext) + 114
26 org.qt-project.QtQml 0x000000011246fcbf QQmlApplicationEnginePrivate::_q_finishLoad(QObject) + 111
27 org.qt-project.QtQml 0x0000000112470292 QQmlApplicationEngine::load(QUrl const&) + 34
28 . 0x000000010d033cb1 dev::mix::MixApplication::MixApplication(int&, char) + 115
29 . 0x000000010d033789 main + 42
30 libdyld.dylib 0x00007fff91fe15ad start + 1
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff97dfdefa kevent_qos + 10
1 libdispatch.dylib 0x00007fff930df165 _dispatch_mgr_invoke + 216
2 libdispatch.dylib 0x00007fff930dedcd _dispatch_mgr_thread + 52
Thread 2:: QQmlThread
0 libsystem_kernel.dylib 0x00007fff97dfd07a __select + 10
1 org.qt-project.QtCore 0x00000001129aaf43 qt_safe_select(int, fd_set, fd_set, fd_set, timespec const) + 547
2 org.qt-project.QtCore 0x00000001129abe75 QEventDispatcherUNIXPrivate::doSelect(QFlagsQEventLoop::ProcessEventsFlag, timespec*) + 709
3 org.qt-project.QtCore 0x00000001129ad2b7 QEventDispatcherUNIX::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 231
4 org.qt-project.QtCore 0x000000011294ffe5 QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 421
5 org.qt-project.QtCore 0x000000011278a843 QThread::exec() + 115
6 org.qt-project.QtQml 0x0000000112481e89 0x112248000 + 2334345
7 org.qt-project.QtCore 0x000000011278e2fa 0x112765000 + 168698
8 libsystem_pthread.dylib 0x00007fff9979199d _pthread_body + 131
9 libsystem_pthread.dylib 0x00007fff9979191a _pthread_start + 168
10 libsystem_pthread.dylib 0x00007fff9978f351 thread_start + 13
the whole error below :
<script src="https://gist.github.com/louisCharpentier/7f1348f6e1ae234814d9b31d426341dd.js"></script>
i ve already uninstall and re install, nothing as worked so far.
if you have any answer, thank you
This is the input file input.awk DOS type
06-13-2014,08:43:11
RLS007817
RRC001021
yes,71.61673,0,150,37,1
no,11,156,1.35,306.418
4,3,-1,2.5165,20,-1.4204
-4,0,11,0,0,0
1.00E-001,0.2,3.00E-001,0.6786031,0.5,6.37E-002
110,40,30,222,200,-539
120,50,35,215,220,-547
130,60,40,207,240,-553
140,70,45,196,260,-560
150,80,50,184,280,-566
160,90,55,170,300,-573
170,100,60,157,320,-578
180,110,65,141,340,-582
190,120,70,126,360,-586
200,130,75,110,380,-590
This is what I basically need:
Ignore the first 8 lines (OK)
Pick and split the numbers on lines 6,7 & 8 (OK)
Do AWK math on columns (Error only in first line?)
BASH code
#!/bin/bash
myfile="input.awk"
vzeros=$(sed '6q;d' $myfile)
vshift=$(sed '7q;d' $myfile)
vcalib=$(sed '8q;d' $myfile)
IFS=','
read -a avz <<< "${vzeros}"
read -a avs <<< "${vshift}"
read -a avc <<< "${vcalib}"
z1=${avz[0]};s1=${avs[0]};c1=${avc[0]}
z2=${avz[1]};s2=${avs[1]};c2=${avc[1]}
z3=${avz[2]};s3=${avs[2]};c3=${avc[2]}
z4=${avz[4]};s4=${avs[4]};c4=${avc[4]}
#The single variables will be passed to awk
awk -v z1="$z1" -v c1="$c1" -v s1="$s1" -v z2="$z2" -v c2="$c2" -v s2="$s2" -v z3="$z3" -v c3="$c3" -v s3="$s3" -v z4="$z4" -v c4="$c4" -v s4="$s4" 'NR>8 { FS = "," ;
nc1 = c1 * ( $1 - z1 - s1 );
nc2 = c2 * ( $2 - z2 - s2 );
nc3 = c3 * ( $3 - z3 - s3 );
nc4 = c4 * ( $5 - z4 - s4 );
print nc1,nc2,nc3,nc4 }' $myfile > test.plot
This is the result on the file test.plot
11 -0.6 -3 -10
12 9.4 7.5 100
13 11.4 9 110
14 13.4 10.5 120
15 15.4 12 130
16 17.4 13.5 140
17 19.4 15 150
18 21.4 16.5 160
19 23.4 18 170
20 25.4 19.5 180
This is the weird part... Only in the first line and after the first column all is wrong... And I have no idea why.
This is the expected result file:
11 7.4 6 90
12 9.4 7.5 100
13 11.4 9 110
14 13.4 10.5 120
15 15.4 12 130
16 17.4 13.5 140
17 19.4 15 150
18 21.4 16.5 160
19 23.4 18 170
20 25.4 19.5 180
I've printed the correction factors captured from lines 6,7 & 8 and everything is fine. All math is fine, except on the first line, after the first column.
OS: Slackware 13.37.
AWK: GNU Awk 3.1.6 Copyright (C) 1989, 1991-2007 Free Software Foundation.
I agree with #jeanrjc.
I copied your file and script to my machine and reduced it to processing the first 2 lines of your data.
With your code as is, I duplicate your results, i.e.
#dbg $0=110,40,30,222,200,-539
#dbg c2=0.2 $2= z2=3 s2=0
11 -0.6 -3 -10
#dbg $0=120,50,35,215,220,-547
#dbg c2=0.2 $2= z2=3 s2=0
12 -0.6 -3 -10
With FS=","; commented out, and -F, added in the option list the output is what you are looking for.
#dbg $0=110,40,30,222,200,-539
#dbg c2=0.2 $2=40 z2=3 s2=0
11 7.4 6 90
#dbg $0=120,50,35,215,220,-547
#dbg c2=0.2 $2=50 z2=3 s2=0
12 9.4 7.5 100
So make sure you have removed the FS=","; from the block of code, and you are using -F, In any case, I would say, that resetting the FS="," for each line that is processed is not useful.
If that still doesn't solve it, try the corrected code on a machine with a newer version of awk.
It would take a small magazine article to completely illustrate what is happening while reading thru the first 8 records (when FS="[[:space:]]), the transition to the first row that meets your rule NR>8, the FS is still [:space:] when the fields are parsed, then, FS is set to ,, but that first row is not rescanned.
IHTH!
Your sample is too complex to reproduce something, but I guess you should try :
awk -F"," 'NR>8{...
instead of
awk 'NR>8 { FS = "," ;
You can also try with BEGIN:
awk 'BEGIN{FS=","}NR>8{...
I eventually tested your script, and you should change the position of the FS parameter, as I told you:
awk -v z1="$z1" -v c1="$c1" -v s1="$s1" -v z2="$z2" \
-v c2="$c2" -v s2="$s2" -v z3="$z3" -v c3="$c3" \
-v s3="$s3" -v z4="$z4" -v c4="$c4" -v s4="$s4" -F"," 'NR>8 {
nc1 = c1 * ( $1 - z1 - s1 );
nc2 = c2 * ( $2 - z2 - s2 );
nc3 = c3 * ( $3 - z3 - s3 );
nc4 = c4 * ( $5 - z4 - s4 );
print nc1,nc2,nc3,nc4 }' $myfile
11 7.4 6 90
12 9.4 7.5 100
13 11.4 9 110
14 13.4 10.5 120
15 15.4 12 130
16 17.4 13.5 140
17 19.4 15 150
18 21.4 16.5 160
19 23.4 18 170
20 25.4 19.5 180
0 -0.6 -3 -10
Why you had a problem ?
Because awk parses the line before executing the block, so if you tell it to change something related to parsing, the changes will occur from the next line.
HTH