Closed pavel-kokolemin closed 11 months ago
Hi @pavel-kokolemin thanks for the report.
Can you confirm if this works for you with an earlier gdk version, and if so what is the last version that works?
Can you confirm if this works for you with an earlier gdk version, and if so what is the last version that works?
I have tried release_0.67.1
and some older versions and they do not crash:
GA_init...
send: {"datadir":"./","log_level":"debug"}
06.852 DEBUG - populated the cache with 0 files
06.852 DEBUG - loading 0 cache files
06.852 INFO - `init` took 973.43µs
GA_create_session...
GA_connect...
send: {"name":"liquid"}
[2023-10-05 12:02:06.851755] [0x00000cf0] [info] net: thread started for gdk version
[2023-10-05 12:02:06.851755] [0x00000ba8] [info] change_state_to: requesting state connected
[2023-10-05 12:02:06.867991] [0x00000cf0] [info] net: desired connected actual disconnected
[2023-10-05 12:02:06.867991] [0x00000cf0] [info] net: connect to wss://green-liquid-mainnet.blockstream.com/v2/ws
[2023-10-05 12:02:06.978625] [0x00000570] [debug] Checking for pinned certificate
[2023-10-05 12:02:06.994263] [0x00000570] [debug] Found pinned certificate 64e286b76063602a372efd60cde8db2656a49ee15e84254b3d6eb5fe38f4288b
TX message (125 octets) ...
TX message: hello ["realm1", {"authid":"","authmethods":[],"roles":{"subscriber":{},"publisher":{},"callee":{"features":{"call_timeout":true}},"caller":{"features":{"call_timeout":true}}}}]
RX message received.
RX message: welcome [8796734805482752, {"x_cb_node":"liquid-mainnet-backend-europe-west2-v77c-2482","x_cb_worker":"worker001","x_cb_peer":"tcp4:127.0.0.1:40206","x_cb_pid":2529,"realm":"realm1","authid":"WXFV-EPA6-VH4U-XRA9-GC5V-FG3K","authrole":"anonymous","authmethod":"anonymous","authprovider":"dynamic","authextra":{"x_cb_node":"liquid-mainnet-backend-europe-west2-v77c-2482","x_cb_worker":"worker001","x_cb_peer":"tcp4:127.0.0.1:40206","x_cb_pid":2529},"roles":{"broker":{"features":{"publisher_identification":true,"pattern_based_subscription":true,"session_meta_api":true,"subscription_meta_api":true,"subscriber_blackwhite_listing":true,"publisher_exclusion":true,"subscription_revocation":true,"payload_transparency":true,"payload_encryption_cryptobox":true,"event_retention":true}},"dealer":{"features":{"caller_identification":true,"pattern_based_registration":true,"session_meta_api":true,"registration_meta_api":true,"shared_registration":true,"call_canceling":true,"progressive_call_results":true,"registration_revocation":true,"payload_transparency":true,"testament_meta_api":true,"payload_encryption_cryptobox":true}}}}]
[2023-10-05 12:02:07.295945] [0x00000cf0] [info] net: connection successful
[2023-10-05 12:02:07.376252] [0x00000ba8] [info] change_state_to: changed to connected
Success
So it looks like a regression in release_0.68.0
.
@pavel-kokolemin can you try branch release_0.68_dev?
@pavel-kokolemin can you try branch release_0.68_dev?
@borgbyte work fine, thanks.
Hello @pavel-kokolemin
even though we managed to fix your windows issue by reverting some changes, we are still investigating the root cause of the crash.
We are having hard times replicating it though. May I ask some questions?
Error getting remote endpoint: system:10009 (The file handle supplied is not valid)
and following do you remember your machine having some connectivity problems?
As last request, can you please retest version 0.68.0 with your main.cpp file changed like this?
--- main.cpp.txt 2023-10-25 10:10:51.859571074 +0200
+++ main.cpp2.txt 2023-10-25 10:15:11.635713340 +0200
@@ -31,7 +31,8 @@
int main() {
std::cout << "GA_init..." << std::endl;
- check(GA_init(json({{"datadir", "./"}, {"log_level", "debug"}})));
+ auto *jason = json({{"datadir", "./"}, {"log_level", "debug"}});
+ check(GA_init(jason));
std::cout << "GA_create_session..." << std::endl;
GA_session *session;
@@ -43,5 +44,8 @@
std::cout << "GA_connect..." << std::endl;
check(GA_connect(session, json({{"name", "liquid"}})));
+ check(GA_destroy_json(jason));
+ check(GA_destroy_session(session));
+
std::cout << "Success" << std::endl;
}
thanks
Hi @lightyear15
what windows version were you using?
I'm using Windows 11. The first time the crash was reported by our test user, so I doubt it's related to my Windows installation. And why do other builds work?
do you remember your machine having some connectivity problems?
No. The crash always happens and I have a good network connection.
can you please retest version 0.68.0 with your main.cpp file changed like this?
I applied the patch and tried 0.68.0 and the latest master branch (commit 5021276cbc3c74c52946aa7450a76ac9db5a63f4) and it still crashes. 0.68.2 works fine as I already reported.
We are having hard times replicating it though.
Can you send your libgreenaddress.dll build?
Thanks.
It seems on Windows10 the bug does not pop up.
The zip file attached contains the libgreenaddress.dll and the executable result of the build of my version of your main.cpp (the one patched according to comment above + some few more logs) We tested this binary with windows11 as well and no crash has been reported gdkwincrash.zip
I can't reproduce the crash either. But it crashes:
While the GDK build without 52f2b2eb074fa7f64619d08332d83f47c75a51bf commit works normally in all situations. I will do some more testing and get back to you. Thanks for your help.
I can't reproduce the crash either. But it crashes:
* When running gdkcrash.exe from the bash shell (I use Git for Windows). * In our wallet application.
While the GDK build without 52f2b2e commit works normally in all situations. I will do some more testing and get back to you. Thanks for your help.
Thanks @pavel-kokolemin for your help:
I am not sure I understand the situation:
can you give me some insight on what your build instructions are?
Thanks
Hi @lightyear15 Sorry for the delay. Please try to reproduce the crash with this: main.cpp.txt It crashes reliably for me.
I built it as before: GDK:
./tools/build.sh --mingw-w64
And gdk_crash.exe
:
x86_64-w64-mingw32-c++ main.cpp -o gdk_crash -I/path/to/include/gdk -I/path/to/gdk/build-windows-mingw-w64/external_deps/nlohmann_json/include /path/to/gdk/build-windows-mingw-w64/libgreenaddress.dll.a
Copied gdk_crash.exe, libgreenaddress.dll and these mingw libs (from Debian 12):
/usr/lib/gcc/x86_64-w64-mingw32/12-posix/libstdc++-6.dll
/usr/lib/gcc/x86_64-w64-mingw32/12-posix/libgcc_s_seh-1.dll
/usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll
I have tried: latest master (with commit 52f2b2eb074fa7f64619d08332d83f47c75a51bf): crash release_0.68.0 (with commit 52f2b2eb074fa7f64619d08332d83f47c75a51bf): crash release_0.68.4 (without commit 52f2b2eb074fa7f64619d08332d83f47c75a51bf): no crash
The same crash happened when I tried mingw from Debian 11.
Hi @pavel-kokolemin
can you please do one more round of tests using gdk from this branch? https://github.com/Blockstream/gdk/tree/giulio_mingw_fix, commit 357ceb3b38df59f9904b60301611a3a6b21bf6e8
Thanks a lot for your invaluable help in testing and investigating this issue. I hope this will finally put an end to this issue :crossed_fingers:
Hi @lightyear15, thank you!
I tried this commit and it works a bit better (no crash after the first iteration), but it still crashes after about 10..20 iterations. And I checked release_0.68.4
again and there are no crashes after all 100 iterations.
Hi @pavel-kokolemin , I promise, this will be the final one. same branch, updated to b620464ae780e387603d9866e9731922abb801a0
:crossed_fingers: :crossed_fingers:
@lightyear15 No problem! Sorry, I don't see the commit b620464ae780e387603d9866e9731922abb801a0. I tried b7d4e1454ba04af702eb9b93d6d717c5cd4799b4 but it still crashes.
@pavel-kokolemin yes sorry, you're pointing to the correct commit, my bad.
During the whole process of debugging this issue I managed to reproduce the bug as you were reporting. I could also reproduce the issue you reported where the crash was happening after 10, 20 iterations, so I am pretty confident that we were experiencing the same bug. Now that in my set-up your 100-iteration test does not crash, not even a single time (neither release nor debug builds), I am inclined to think that there is something not right in your set-up. For instance, we upgraded boost to 1.82.0, so be sure to recompile all the dependencies.
Thanks a lot again
I checked again, b7d4e1454ba04af702eb9b93d6d717c5cd4799b4 crashes after about 10..20 iterations while release_0.68.4 works normally. And I have rebuilt all dependencies in both cases.
hello @pavel-kokolemin ,
I definitely lost you here :disappointed:
I cannot reproduce the bug you're reporting any more.
May I ask you to report a stack trace of the bug? A few hints on how to get it:
./tools/build.sh --mingw-w64 --buildtype debug
let me know if you need more detailed explanation or any further help on how to get a stack trace of the bug.
Cheers
Now I can't reproduce the crash either. I guess something was wrong on my end. I will close the issue. Thanks for your help!
GDK 0.68.0 Windows build crashes in
GA_connect
when used with multi-sig accounts (single-sig accounts work fine).I have reproduced the crash in a minimal program (
main.cpp
). To build:Copy libgreenaddress.dll and required mingw libs:
Then run the binary (
gdk_crash.exe
):I tried building on Debian 12 and Debian 11, same crash happens. It works fine on Linux:
main.cpp.txt