Skip to content
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

telegram transport not working #146

Closed
silberzwiebel opened this issue May 28, 2016 · 9 comments
Closed

telegram transport not working #146

silberzwiebel opened this issue May 28, 2016 · 9 comments

Comments

@silberzwiebel
Copy link

I tried to setup a transport to telegram with my raspberry pi. I'm using the spectrum version that comes in the apt repository (2.0.3, I guess) and the git version from telegram-purple.
While other transports work well, the telegram transport does not work.
Here is my telegram.cfg, my spectrum2.log and my backend.log.

I know there is #118, but my problem is different (I do not use any [purple] settings).

I appreciate any help.

@vitalyster
Copy link
Collaborator

does this plugin works for you with different purple "ui" (pidgin, finch, adium, bitlbee, etc)?

@silberzwiebel
Copy link
Author

Yes, the plugin does work on a different machine (Fedora) with pidgin. I
do receive an authorization code in telegram while using pidgin, but I
do not receive anything (except an error message in the XMPP client)
when I'm using it with spectrum2.

Am 01.06.2016 um 09:19 schrieb vitalyster:

does this plugin works for you with different purple "ui" (pidgin, finch, adium,
bitlbee, etc)?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#146 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AEUuZixYGdr4ncUokgUwVXSD-mHSrBMcks5qHTJwgaJpZM4IpEzR.

@thundergreen
Copy link
Contributor

I'm facing the same issue

@herndlm
Copy link

herndlm commented Oct 21, 2016

I seem to have the same problem as @silberzwiebel and @thundergreen.. I guess you two still have no solution?
My spectrum2.log, backend-1.log and additionally I managed to get the following coredump:

PID: 817 (spectrum2_libpu)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 6 (ABRT)
     Timestamp: Fri 2016-10-21 13:53:08 CEST (10min ago)
  Command Line: /usr/bin/spectrum2_libpurple_backend --host 127.0.0.1 --port 30902 --service.backend_id=1 -j telegram.<DOMAIN> /etc/spectrum2/transports/telegram.cfg
    Executable: /usr/bin/spectrum2_libpurple_backend
 Control Group: /user.slice/user-1001.slice/session-c9.scope
          Unit: session-c9.scope
         Slice: user-1001.slice
       Session: c9
     Owner UID: 1001 (martin)
       Boot ID: <ID>
    Machine ID: <ID>
      Hostname: raspi2
      Coredump: /var/lib/systemd/coredump/core.spectrum2_libpu.0.d5fa9cafcd94492aa9c6bdd27b4b14f6.817.1477050788000000000000.lz4
       Message: Process 817 (spectrum2_libpu) of user 0 dumped core.

                Stack trace of thread 817:
                #0  0x00000000767d01bc raise (libc.so.6)

gdb backtrace is

(gdb) bt
#0  0x767d01bc in raise () at /usr/lib/libc.so.6
#1  0x767d1520 in abort () at /usr/lib/libc.so.6
#2  0x767c8fa4 in __assert_fail_base () at /usr/lib/libc.so.6
#3  0x767c9080 in __assert_fail () at /usr/lib/libc.so.6
#4  0x701dc3d4 in bn_factorize () at /usr/lib/purple-2/telegram-purple.so
#5  0x701b1bfc in  () at /usr/lib/purple-2/telegram-purple.so

Also I noticed that I get an error message from Telegram if I enter my phone number not as expected (Unable to sign on as xxx: phone number lacks country prefix. Numbers must start with the full international prefix code, e.g. +1 for USA.), so it seems the communication with Telegram in general is working, but maybe Spectrum/libpurple is crashing because of an unexpected response or smth like that?

I would like to help you out with this, please guide me to compile it with debug info if you need that for testing

@herndlm
Copy link

herndlm commented Oct 21, 2016

After recompilling telegram-purple I got this from the backtrace:

(gdb) bt
#0  0x767c11bc in raise () at /usr/lib/libc.so.6
#1  0x767c2520 in abort () at /usr/lib/libc.so.6
#2  0x767b9fa4 in __assert_fail_base () at /usr/lib/libc.so.6
#3  0x767ba080 in __assert_fail () at /usr/lib/libc.so.6
#4  0x701cd3d4 in BN2ull (b=b@entry=0x65) at mtproto-utils.c:101
#5  0x701cd3d4 in bn_factorize (pq=pq@entry=0x16ab368, p=p@entry=0x768d2078 <lock>, q=q@entry=0x16ab6a0) at mtproto-utils.c:127
#6  0x701a2bfc in send_req_dh_packet (temp_key=0, pq=0x16ab368, c=0x16ab540, TLS=0x2) at mtproto-client.c:256
#7  0x701a2bfc in process_respq_answer (TLS=0x2, TLS@entry=0x16a7928, c=c@entry=0x16ab540, len=len@entry=84, temp_key=temp_key@entry=0, packet=0x7067ef38 <Response.14694> "")
    at mtproto-client.c:407
#8  0x701a59a4 in rpc_execute (TLS=0x16a7928, c=0x16ab540, op=0, len=84) at mtproto-client.c:1168
#9  0x70193828 in conn_try_read () at /usr/lib/purple-2/telegram-purple.so
#10 0x00052b14 in _start ()

Maybe @BenWiederhake can help?
Btw. I'm using Linux 4.4.24-2 on armv7l

@BenWiederhake
Copy link

BenWiederhake commented Oct 21, 2016

You're running on a 32-bit platform, I guess? In that case, I recognize the problem, it has been fixed quite a while ago. Try the current dev-1.3.0 branch. Don't forget to git submodule update --init every now and then!
Also, thanks for the attribution, but @majn wrote this fantastic plugin, I only answer a few questions sometimes. :)

EDIT: Specifically, you'll need the "Update tgl (32-bit BN2ull)" commit, which literally just updates tgl: vysheng/tgl@47b571f

@herndlm
Copy link

herndlm commented Oct 21, 2016

Thank you for the quick help! I re-compiled the latest version from that branch and it is looking better now. But unfortunately there is another segfault now related to libgcrypt:

PID: 14923 (spectrum2_libpu)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 6 (ABRT)
     Timestamp: Fri 2016-10-21 15:29:47 CEST (11min ago)
  Command Line: /usr/bin/spectrum2_libpurple_backend --host 127.0.0.1 --port <PORT> --service.backend_id=1 -j telegram.<DOMAIN> /etc/spectrum2/transports/telegram.cfg
    Executable: /usr/bin/spectrum2_libpurple_backend
 Control Group: /user.slice/user-1001.slice/session-c9.scope
          Unit: session-c9.scope
         Slice: user-1001.slice
       Session: c9
     Owner UID: 1001 (martin)
       Boot ID: d5fa9cafcd94492aa9c6bdd27b4b14f6
    Machine ID: 5890fdfecaaa435a8e17b789ddc2ea1a
      Hostname: raspi2
      Coredump: /var/lib/systemd/coredump/core.spectrum2_libpu.0.d5fa9cafcd94492aa9c6bdd27b4b14f6.14923.1477056587000000000000.lz4
       Message: Process 14923 (spectrum2_libpu) of user 0 dumped core.

backtrace is not really revealing atm I guess...:

(gdb) bt
#0  0x755a64cc in  () at /usr/lib/libgcrypt.so.20
#1  0x796b53e0 in  ()

@herndlm
Copy link

herndlm commented Oct 21, 2016

I'm seeing some progress.. I tried downgrading libgcrypt from 1.7.3 to 1.6.5 (and also 1.7.2) and it's not segfaulting now, but when trying to register with my number I get: "Unable to sign on as : problem in the underlying library 'tgl'. Please submit a bug report with the debug log."
The relevant log entries are:

10381: 2016-10-21 18:16:48,888 INFO  libpurple: prpl-telegram:Init gcrypt
10381: 2016-10-21 18:16:48,889 INFO  libpurple: prpl-telegram:Init gcrypt: version mismatch!
10381: 2016-10-21 18:16:48,889 INFO  libpurple: prpl-telegram:Call to tgl_init failed.
10381: 2016-10-21 18:16:48,889 INFO  libpurple: connection:Connection error on 0x2100888 (reason: 7 description: Unable to sign on as <PHONE_NUMBER>: problem in the underlying library 'tgl'. Please submit a bug report with the debug log.)

After re-compiling telegram-purple it starts segfaulting again in libgcrypt. Also with the older version. Don''t know what I can do now I guess. @BenWiederhake sorry for bothering again, do you think you can help me out?

@BenWiederhake
Copy link

This is really the wrong place to discuss this. Either report it at tgl or telegram-purple.
Apart from that, the error message already tells you what's the problem: gcrypt version mismatch. Go fix that. If there's any more issues, create a new issue at the correct repository. I won't respond in this issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants