У меня есть код, писал на коленке, есть цепочка запросов, результат которого нужно передать дальше для вызова. Причем нужно в какой-то момент дождаться завершения всех вызовов, чтобы вызвать еще одну асинхронную функцию.
Вот код:
https://github.com/splincode/bullshit-code/blob/ma...
На тот код даже постоянно ошибки сыпятся в консоли:
*** Error in `node': malloc(): memory corruption (fast): 0x0000000003cfe050 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f3c88fd27e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x81d61)[0x7f3c88fdcd61]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f3c88fde5d4]
node(_ZN2v88internal8Malloced3NewEm+0xd)[0xa0956d]
node(_ZNK2v88internal13FeedbackNexus12FindHandlersEPNS0_4ListINS0_6HandleINS0_6ObjectEEENS0_25FreeStoreAllocationPolicyEEEi+0x329)[0x1213139]
node(_ZN2v88internal2IC19UpdatePolymorphicICENS0_6HandleINS0_4NameEEENS2_INS0_6ObjectEEE+0x2f1)[0xf07a91]
node(_ZN2v88internal2IC10PatchCacheENS0_6HandleINS0_4NameEEENS2_INS0_6ObjectEEE+0xd6)[0xf08b86]
node(_ZN2v88internal6LoadIC12UpdateCachesEPNS0_14LookupIteratorE+0xe0)[0xf08e60]
node(_ZN2v88internal6LoadIC4LoadENS0_6HandleINS0_6ObjectEEENS2_INS0_4NameEEE+0x2af)[0xf092cf]
node(_ZN2v88internal19Runtime_LoadIC_MissEiPPNS0_6ObjectEPNS0_7IsolateE+0x2df)[0xf0de2f]
[0x22fe3e0043a7]
======= Memory map: ========
00400000-0204a000 r-xp 00000000 08:02 42730233 /usr/bin/nodejs
0224a000-0224b000 r--p 01c4a000 08:02 42730233 /usr/bin/nodejs
0224b000-02263000 rw-p 01c4b000 08:02 42730233 /usr/bin/nodejs
7f3c74021000-7f3c78000000 ---p 00000000 00:00 0
7f3c78000000-7f3c780bd000 rw-p 00000000 00:00 0
7f3c780bd000-7f3c7c000000 ---p 00000000 00:00 0
7f3c7c000000-7f3c7c1af000 rw-p 00000000 00:00 0
7f3c7c1af000-7f3c80000000 ---p 00000000 00:00 0
7f3c80000000-7f3c80075000 rw-p 00000000 00:00 0
7f3c80075000-7f3c84000000 ---p 00000000 00:00 0
7f3c86d54000-7f3c86d56000 r-xp 00000000 08:02 8522866 /home/splincode/Develop/test-loader/node_modules/deasync/bin/linux-x64-node-7/deasync.node
7f3c86d56000-7f3c86f55000 ---p 00002000 08:02 8522866 /home/splincode/Develop/test-loader/node_modules/deasync/bin/linux-x64-node-7/deasync.node
7f3c86f55000-7f3c86f56000 r--p 00001000 08:02 8522866 /home/splincode/Develop/test-loader/node_modules/deasync/bin/linux-x64-node-7/deasync.node
7f3c86f56000-7f3c86f57000 rw-p 00002000 08:02 8522866 /home/splincode/Develop/test-loader/node_modules/deasync/bin/linux-x64-node-7/deasync.node
7f3c86f57000-7f3c86f58000 ---p 00000000 00:00 0
7f3c86f58000-7f3c87758000 rw-p 00000000 00:00 0
7f3c87758000-7f3c87759000 ---p 00000000 00:00 0
7f3c87759000-7f3c87f59000 rw-p 00000000 00:00 0
7f3c87f59000-7f3c87f5a000 ---p 00000000 00:00 0
7f3c87f5a000-7f3c8875a000 rw-p 00000000 00:00 0
7f3c8875a000-7f3c8875b000 ---p 00000000 00:00 0
7f3c8875b000-7f3c88f5b000 rw-p 00000000 00:00 0
7f3c88f5b000-7f3c8911a000 r-xp 00000000 08:02 16777572 /lib/x86_64-linux-gnu/libc-2.23.so
7f3c8911a000-7f3c8931a000 ---p 001bf000 08:02 16777572 /lib/x86_64-linux-gnu/libc-2.23.so
7f3c8931a000-7f3c8931e000 r--p 001bf000 08:02 16777572 /lib/x86_64-linux-gnu/libc-2.23.so
7f3c8931e000-7f3c89320000 rw-p 001c3000 08:02 16777572 /lib/x86_64-linux-gnu/libc-2.23.so
7f3c89320000-7f3c89324000 rw-p 00000000 00:00 0
7f3c89324000-7f3c8933c000 r-xp 00000000 08:02 16777583 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f3c8933c000-7f3c8953b000 ---p 00018000 08:02 16777583 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f3c8953b000-7f3c8953c000 r--p 00017000 08:02 16777583 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f3c8953c000-7f3c8953d000 rw-p 00018000 08:02 16777583 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f3c8953d000-7f3c89541000 rw-p 00000000 00:00 0
7f3c89541000-7f3c89557000 r-xp 00000000 08:02 16781643 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3c89557000-7f3c89756000 ---p 00016000 08:02 16781643 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3c89756000-7f3c89757000 rw-p 00015000 08:02 16781643 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f3c89757000-7f3c8985f000 r-xp 00000000 08:02 16777570 /lib/x86_64-linux-gnu/libm-2.23.so
7f3c8985f000-7f3c89a5e000 ---p 00108000 08:02 16777570 /lib/x86_64-linux-gnu/libm-2.23.so
7f3c89a5e000-7f3c89a5f000 r--p 00107000 08:02 16777570 /lib/x86_64-linux-gnu/libm-2.23.so
7f3c89a5f000-7f3c89a60000 rw-p 00108000 08:02 16777570 /lib/x86_64-linux-gnu/libm-2.23.so
7f3c89a60000-7f3c89bd2000 r-xp 00000000 08:02 42731453 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f3c89bd2000-7f3c89dd2000 ---p 00172000 08:02 42731453 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f3c89dd2000-7f3c89ddc000 r--p 00172000 08:02 42731453 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f3c89ddc000-7f3c89dde000 rw-p 0017c000 08:02 42731453 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f3c89dde000-7f3c89de2000 rw-p 00000000 00:00 0
7f3c89de2000-7f3c89de9000 r-xp 00000000 08:02 16777579 /lib/x86_64-linux-gnu/librt-2.23.so
7f3c89de9000-7f3c89fe8000 ---p 00007000 08:02 16777579 /lib/x86_64-linux-gnu/librt-2.23.so
7f3c89fe8000-7f3c89fe9000 r--p 00006000 08:02 16777579 /lib/x86_64-linux-gnu/librt-2.23.so
7f3c89fe9000-7f3c89fea000 rw-p 00007000 08:02 16777579 /lib/x86_64-linux-gnu/librt-2.23.so
7f3c89fea000-7f3c89fed000 r-xp 00000000 08:02 16777568 /lib/x86_64-linux-gnu/libdl-2.23.so
7f3c89fed000-7f3c8a1ec000 ---p 00003000 08:02 16777568 /lib/x86_64-linux-gnu/libdl-2.23.so
7f3c8a1ec000-7f3c8a1ed000 r--p 00002000 08:02 16777568 /lib/x86_64-linux-gnu/libdl-2.23.so
7f3c8a1ed000-7f3c8a1ee000 rw-p 00003000 08:02 16777568 /lib/x86_64-linux-gnu/libdl-2.23.so
7f3c8a1ee000-7f3c8a214000 r-xp 00000000 08:02 16777573 /lib/x86_64-linux-gnu/ld-2.23.so
7f3c8a3ea000-7f3c8a3f1000 rw-p 00000000 00:00 0
7f3c8a40c000-7f3c8a40d000 rw-p 00000000 00:00 0
7f3c8a40d000-7f3c8a40e000 ---p 00000000 00:00 0
7f3c8a40e000-7f3c8a413000 rw-p 00000000 00:00 0
7f3c8a413000-7f3c8a414000 r--p 00025000 08:02 16777573 /lib/x86_64-linux-gnu/ld-2.23.so
7f3c8a414000-7f3c8a415000 rw-p 00026000 08:02 16777573 /lib/x86_64-linux-gnu/ld-2.23.so
7f3c8a415000-7f3c8a416000 rw-p 00000000 00:00 0
7ffee5b7c000-7ffee5b9e000 rw-p 00000000 00:00 0 [stack]
7ffee5bc0000-7ffee5bc2000 r--p 00000000 00:00 0 [vvar]
7ffee5bc2000-7ffee5bc4000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
real 0m5.277s
user 0m0.312s
sys 0m0.016s