libera/#maemo-leste/ Sunday, 2022-02-20

freemangordonhmm, we have a nasty issue with tinymail - it has the so-called camel-lite library, which seems to be copy-pasted code from some unknown eds version08:17
freemangordonit would all be fine if both libcamel-lite-1.2.so.0.0.0 and libcamel-1.2.so.62.0.0 were not exporting the same symbols :(08:18
freemangordonhmm, maybe I shall symply fix the soname08:19
freemangordonif that even matters08:20
freemangordonsonames are fine08:22
freemangordonI wonder if it makes sense08:32
freemangordonto port to libcamel08:32
freemangordonI don't understand what is so 'lite' in libcamel-lite08:33
freemangordonanyway we pull eds08:33
Wizzupfreemangordon: heh09:55
freemangordonyeah09:55
freemangordonthe issue is that osso-abook pulls eds libs and they try to init their own camel implementation, but camel-lite get called instead :)09:56
freemangordonand it becomes a mess09:56
freemangordontrying to port tinymail to eds libcamel ATM09:56
Wizzupok09:57
freemangordonseems not that hard, but wonder if we are going to lose something09:57
lelnxdefiant opened an issue: https://github.com/maemo-leste/bugtracker/issues/610 (21hildon-desktop-wait should not wait indefinitely )10:13
Wizzuphmm12:16
Wizzupit shouldn't be booted to in rescue mode I think12:16
humpelstilzchen[not really a rescue mode, but it broken X should not prevent network or getty to run12:32
Wizzupmhm12:32
Wizzuphow would you connect to wifi with X not running?12:33
humpelstilzchen[On the pine I can attach an USB-Ethernet12:33
Wizzupok12:34
Wizzupbtw, usbnet should work12:34
Wizzupbut how does usb-ethernet help you12:34
WizzupI don't think it would auto connect?12:35
humpelstilzchen[it does, probably because I configured it do so. Don't think this configuration is default.12:36
humpelstilzchen[Well worst case is to login on tty and run "dhclient eth0"12:36
Wizzupok12:36
humpelstilzchen[tty112:36
Wizzupon recovery mode there is also the tty keyboard12:36
Wizzupdoes that work on pine?12:36
humpelstilzchen[have not tested that yet12:37
freemangordonhmm, porting to libcamel is not that easy as I initially thought :(14:37
freemangordonmaybe will do a static link14:37
freemangordonWizzup: we have a task - port tinymail-camel to upstream libcamel (for leste only that is)17:31
freemangordonit is not that hard, I would guess a week should be enough17:33
Wizzupcan you make an issue for it as well?17:37
freemangordonok17:37
freemangordonyeah, LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcamel-lite-1.2.so.0 ./lib/test_contact_chooser makes it crash :(17:39
freemangordonWizzup: what do you think, instead of porting, could we just rename the functions?17:40
freemangordonI know this is ugly, but at least temporarily17:40
freemangordonI was so excited that modes compiles with osso-abook enabled and now this :(17:41
Wizzupfreemangordon: I will look in 30mins17:52
bencohfreemangordon: what about renaming the symbols? (bsed?)17:52
bencohohwell, looks like you reached that conclusion as well17:54
freemangordonbencoh: what is bsed?18:08
freemangordonsome mass rename?18:08
bencohbbe* (a binary sed), I thought I only had blob libs18:13
bencohs/I only/you only/18:13
freemangordonseems objdump can do similar thing, but they say it is not a good idea to do it for .so files18:14
freemangordonbut we have the source here, so we can rename18:14
freemangordonthe problem is that it is about hondreds of symbols :(18:14
bencohwell, you need to be careful with string size to keep proper offsets18:14
freemangordon*hundreds18:14
bencohso I'd only replace a few chars in the name18:15
bencohI mean, I'd replace all the symbol names, but make sure it retains the same size18:15
freemangordonah, I see18:15
bencohwe're talking about a C-only lib, right? no C++ involved?18:16
freemangordonc-only18:16
freemangordonoh, it is objcopy, not objdump18:16
bencohat least you don't have to worry about c++ (de)mangling18:16
bencohI think you should be fine18:16
freemangordonyeah18:16
bencohI didn't know objcopy could do that, but I doubt it would allow mass-renaming anyway18:17
freemangordoncould you help me with sed?18:17
freemangordonlike, do you know how I shall invoke it18:17
bencohwith bbe* you mean ... here is an example: bbe -e 's/amd64/armhf/' /var/lib/lxc/maemo-leste-armhf/rootfs/amd64/usr/bin/dpkg18:17
freemangordonthanks18:17
bencohyou might need to append 'g' at the end (like sed), I'd need to check that18:18
bencohno need for 'g'18:18
freemangordonok18:18
bencohslightly offtopic, but I'd love to hear your thoughts on radare2/retdec/ghidra vs IDA, assuming you ever tried either of those (I know you use IDA :) )18:20
freemangordonyep, tried it about an year ago18:21
freemangordonmaybe I am used to IDA, but I think it goes circles about ghydra18:21
bencohah18:21
freemangordonit might have improved since then18:21
freemangordonlast version I tried was ghidra 9.2.3.PUBLIC18:22
freemangordonkeep in mind I fed it with complex .so (not sure which one, maybe abook)18:22
freemangordonalso, the fault could be on my side by not knowing how to use it properly18:23
bencohI've used radare2 on various occasions for analysis, and retdec/r2ghidra for decompiling, but the decompilation output really feels ... disappointing18:23
bencohI somehow recalled IDA giving better results18:23
freemangordonyeah, I am talking about the decompiler18:23
bencohah :)18:23
freemangordonalso, I exported a project from IDA and imported in ghidra18:24
bencoh(I'm mostly feeding it bootloaders and similar blobs here)18:24
freemangordonit failed to recognize lots of types18:24
freemangordonbut again, ghidra directory date is 25 may 2021 :)18:25
bencohyeah, it might have improved since then ... although your feedback is quite similar to what I just experienced with r2ghidra18:26
bencoh(ghidra decompiler integration into radare2)18:26
freemangordonnot that I know what radare2 is :)18:27
bencohyet another SRE / binary analysis framework18:27
freemangordonanyway, lemme see if I can make modest work with abook18:27
bencoh:)18:27
freemangordonbencoh: umm, ' bbe -e 's/camel_/goose_/' /usr/lib/x86_64-linux-gnu/libcamel-lite-1.2.so.0' dumped the binary to the screen18:33
Wizzupfreemangordon: maybe jut rename for now I think18:59
freemangordondoes not work :(19:01
Wizzuphm19:02
Wizzupthat's odd?19:02
freemangordonuser@devuan:~/maemo/git/abook/osso-abook$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcamel-lite-1.2.so.0.0.0 ./lib/test_contact_chooser19:02
freemangordon./lib/test_contact_chooser: symbol lookup error: /usr/lib/x86_64-linux-gnu/libcamel-lite-1.2.so.0.0.0: undefined symbol: goose_sasl_ntlm_authtype19:02
freemangordonI renamed with bbe -e 's/camel_/goose_/' /usr/lib/x86_64-linux-gnu/libcamel-lite-1.2.so.0.0.0 > libcamel-lite-1.2.so.0.0.0 and then copied the file19:03
freemangordonmaybe I am missing something obvious, but still19:03
Wizzupbut wait, why can't you rename the src files that have the conflicting names?19:03
freemangordonWizzup: because we talk about hundreds of functions19:24
freemangordonit is not about renaming th efilesd19:24
freemangordon*files19:24
freemangordonwe have conflicting symbols (functions)19:25
Wizzupok19:25
freemangordonoh, bbe does not support regexes19:46
uvoshow is binary patching the so a sane approche here19:50
freemangordonit is not19:51
freemangordonI want it just for testing19:52
freemangordonuvos: if you have a better idea, please...19:52
freemangordonyessss!21:07
freemangordonhttps://ibb.co/ncVhFm6 :)21:09
Wizzupwoo :)21:12
freemangordonyep, "new contact" and "merge" work as well :)21:13
freemangordonyipee21:14
freemangordonand they are immediately available in evolution21:14
freemangordonI can believe this works21:16
freemangordon*can't21:16
Wizzupsweet21:22
Wizzup:)21:22
freemangordonmhm21:23
freemangordonnow I only have to find why it hangs if I try to unref   ESourceRegistry21:24
freemangordonWizzup: ok, I renamed camel_xxx stuff to goose_xxx stuff and it works, but honestly I am not sure how to push that to repos22:04
WizzupI do not fully comprehend the problem and the solution yet22:05
freemangordonmaybe some temp branch for tinymail/modest only, until it is using camel from EDS22:05
Wizzupok22:05
Wizzupsure, that can work22:06
freemangordonthe problem is that both libcamel-lite (provided by tinymail) and libcamel (provided by EDS) use exactly the same function names22:06
Wizzupand we can't rename the tinymail functions?22:06
freemangordonwe can22:06
freemangordonthat's what I did22:06
freemangordonbut, it is (almost) the same code22:07
freemangordonthe one un tinymail is older22:07
freemangordon*in22:07
freemangordonbut thre is 95%match22:07
freemangordonit makes no sense to keep both copies22:07
freemangordonsec22:07
Wizzupright22:08
Wizzupso no binary patching?22:08
freemangordonthis https://github.com/maemo-leste/evolution-data-server/tree/master/src/camel22:08
freemangordonant this https://github.com/maemo-leste/tinymail/tree/master/libtinymail-camel/camel-lite/camel22:08
freemangordonobviously tinymail borrowed that code back then22:09
Wizzupaha22:09
freemangordonno binary patching, no22:09
freemangordonbut, we have to port tinymail to use eds code22:10
freemangordonI made some progress22:10
freemangordonand maybe will finish it, dunno22:10
freemangordonunless we find a volunteer to finish it22:10
freemangordonso I can go back to abook22:11
freemangordonanyway, enough for today :)22:11
* freemangordon goes afk22:11
Wizzupttyl22:12
bencohfreemangordon: wait, what did you mean by bbe not supporting that regex of yours? it's a pretty basic one, afaict it should work (?)23:29
bencohah, it's not really regex, right23:30
bencohbut still, that replace command should work23:30

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!