-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: monero.dart support #818
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## monerodart #818 +/- ##
=============================================
Coverage ? 41.27%
=============================================
Files ? 54
Lines ? 4625
Branches ? 0
=============================================
Hits ? 1909
Misses ? 2716
Partials ? 0 ☔ View full report in Codecov by Sentry. |
tor proxy
25 words seed (didn't test yet)
updated monero.dart to support wow
I've reinstalled my vm and switched from ubuntu 20.04 to kubuntu 20.04, and there was a crash in one of plugins, in this Patch with backtraceFrom e0510a18c61f9fabf27ac290d693fe62784f3814 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Sat, 30 Mar 2024 08:29:43 +0100
Subject: [PATCH] FIX: double free or corruption in devicelocale_plugin.cc
(gdb) bt
0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
1 0x00007ffff4357859 in __GI_abort () at abort.c:79
2 0x00007ffff43c226e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff44ec298 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
3 0x00007ffff43ca2fc in malloc_printerr (str=str@entry=0x7ffff44ee690 "double free or corruption (!prev)") at malloc.c:5347
4 0x00007ffff43cbfac in _int_free (av=0x7ffff4521b80 <main_arena>, p=0x2012e20, have_lock=<optimized out>) at malloc.c:4317
5 0x00007ffff7f0fd37 in get_category_locale(int) (category=6)
at /home/user/stack_wallet/linux/flutter/ephemeral/.plugin_symlinks/devicelocale/linux/devicelocale_plugin.cc:52
{...}
After simply commenting out the line there were no more issues, and
stack_wallet continued to work as expected.
Issue occurs on kubuntu 20.04 (didn't occur on ubuntu 20.04).
---
devicelocale_plugin.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devicelocale_plugin.cc b/devicelocale_plugin.cc
index c484d53..49fcf61 100644
--- a/devicelocale_plugin.cc
+++ b/devicelocale_plugin.cc
@@ -49,7 +49,7 @@ static gchar *get_category_locale(int category)
bool no_locale = locale == nullptr
|| strncmp(locale, "LC_", sizeof("LC_") - 1) == 0;
if (no_locale) {
- g_free(locale);
+ // g_free(locale);
return nullptr;
} else {
return locale;
|
So basically: when we open the .so file, we define some symbols, and it appears that if we load something else, with the same symbols, under the same thread we cause some funky behaviour - like calling function a wownero function MONERO_Wallet_address() resulting in a monero address being generated. Needless to say, this is undesired, and a blocker for cypherstack/stack_wallet#818 I'm afraid that this may not solve all of our issues (but will solve some significant roadblocks), because of the "genesis block" issue, as output of nm -gDC release/wownero/x86_64-linux-gnu_libwallet2_api_c.so | grep genesis indicate that these functions may share *something* in common across both WOW and XMR libraries. In a case in which this fix won't be sufficient, I think that the way forward would be to close the dynamic libraries, but before we do that I want to check if maybe there is a change to run multiple wallets at once.
So basically: when we open the .so file, we define some symbols, and it appears that if we load something else, with the same symbols, under the same thread we cause some funky behaviour - like calling function a wownero function MONERO_Wallet_address() resulting in a monero address being generated. Needless to say, this is undesired, and a blocker for cypherstack/stack_wallet#818 I'm afraid that this may not solve all of our issues (but will solve some significant roadblocks), because of the "genesis block" issue, as output of nm -gDC release/wownero/x86_64-linux-gnu_libwallet2_api_c.so | grep genesis indicate that these functions may share *something* in common across both WOW and XMR libraries. In a case in which this fix won't be sufficient, I think that the way forward would be to close the dynamic libraries, but before we do that I want to check if maybe there is a change to run multiple wallets at once.
Current version is working with monero and wownero, upon receiving a transaction however it decided to be less cooperative and failed, however it did so with a backtrace:
That leads me to believe that we are not at fault here (we as in monero_c code), I'd put blame on wownero patches? Maybe? This is just an idea, I'll actually test receiving transaction on linux |
https://git.wownero.com/wownero/wownero/issues/484 the crash from above is resolved, monero_c code is also updated to reflect that change, and with this changes it works exactly the same on all (currently supported) platforms, that is
But that being said, the libraries are not packaged, I've workarounded xcode signing by symlinking the libraries and copying it to the right place as a xcode step, to make sure that they work use monero_c release v0.18.3.3-RC14 or newer, I'll most likely leave it as is, and just point to correct directory after adjusting build_all.sh script. (thanks @malik1004x for helping me out and pointing to a correct way to load a dylib on macos, if not for your help I'd most likely still be stuck learning how it works). 27f7465#diff-41c84f65620ae5e6d1f5708be89d2d7ca5b7f264127faccf746620036391e05c I think that the code is ready for some initial review/testing/insight, things like syncing/creation/restore/sending should work across all platforms. |
|
Excuse me @MrCyjaneK, that was an accident. I pushed my own local copy of cypherstack:monerodart back, but you might want to push again (and feel free to force push--though you may not be allowed) and/or double-check commit shas etc. Takes another note to set up commit signing My apologies for any inconvenience. |
Anyways, this is ready to merge to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve these changes for merging into cypherstack:monerodart
(not staging
or main
) as lightly reviewed and tested on:
- Linux
- macOS
- iOS
- Android
- Windows
I will need to more fully review the code before approving these changes for inclusion in staging/main. I mostly just tested it and quickly looked over most code
This PR includes
Build instructions:
or just grab it from https://static.mrcyjanek.net/monero_c/v0.18.3.3-RC10
x86_64 linux
Features roadmap:
blocked by: https://git.wownero.com/wownero/wownero/issues/483 - I can use older tag, the same used by wowlet, but getting upstream to fix the issue is required anyway.I've patched my way around.