TelegramMessenger / MTProxy

4.97k stars 822 forks source link

Stackbacktrace #446

Open dotfrankruan opened 2 years ago

dotfrankruan commented 2 years ago

root@ORWTMC:/opt/MTProxy/objs/bin# ./mtproto-proxy -u nobody -p 9000 -H 21 -S 430ebd9e92f300278be77928e958e080 --aes-pwd proxy-secret proxy-multi.conf -M 2 [746094][2022-01-15 20:50:43.462601 local] Invoking engine mtproxy-0.01 compiled at Jan 15 2022 20:46:43 by gcc 9.3.0 64-bit after commit dc0c7f3de40530053189c572936ae4fd156xxxxx [746094][2022-01-15 20:50:43.462701 local] config_filename = 'proxy-multi.conf' [746094][2022-01-15 20:50:43.462858 local] creating 2 workers mtproto-proxy: common/pid.c:42: init_common_PID: Assertion !(p & 0xffff0000)' failed. mtproto-proxy: common/pid.c:42: init_common_PID: Assertion!(p & 0xffff0000)' failed. [pid 746094] [time 1642251043] ------- Stack Backtrace ------- ./mtproto-proxy(print_backtrace+0x31)[0x5597cd0e3c51] ./mtproto-proxy(extended_debug_handler+0x14)[0x5597cd0e3dd4] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f335025e3c0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f335009d18b] /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f335007c859] /lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f335007c729] /lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f335008df36] ./mtproto-proxy(+0x50bb1)[0x5597cd0e7bb1] ./mtproto-proxy(engine_init+0xf4)[0x5597cd0ddd04] ./mtproto-proxy(default_main+0x113)[0x5597cd0debd3] /lib/x86_64-linux-gnu/libc.so.6(libc_start_main+0xf3)[0x7f335007e0b3] ./mtproto-proxy(_start+0x2e)[0x5597cd0a983e] [pid 746094] [time 1642251043] ------------------------------- [pid 746094] [time 1642251043] mtproxy-0.01 compiled at Jan 15 2022 20:46:43 by gcc 9.3.0 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b[pid 746094] [time 1642251043] root@ORWTMC:/opt/MTProxy/objs/bin# mtproto-proxy: common/pid.c:42: init_common_PID: Assertion `!(p & 0xffff0000)' failed. [pid 746095] [time 1642251043] ------- Stack Backtrace ------- [pid 746096] [time 1642251043] ------- Stack Backtrace ------- ./mtproto-proxy(print_backtrace+0x31)[0x5597cd0e3c51] ./mtproto-proxy(extended_debug_handler+0x14)[0x5597cd0e3dd4] ./mtproto-proxy(print_backtrace+0x31)[0x5597cd0e3c51] ./mtproto-proxy(extended_debug_handler+0x14)[0x5597cd0e3dd4] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f335025e3c0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f335009d18b] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f335025e3c0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f335009d18b] /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f335007c859] /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f335007c859] /lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f335007c729] /lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f335007c729] /lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f335008df36] ./mtproto-proxy(+0x50bb1)[0x5597cd0e7bb1] /lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f335008df36] ./mtproto-proxy(engine_init+0xf4)[0x5597cd0ddd04] ./mtproto-proxy(+0x50bb1)[0x5597cd0e7bb1] ./mtproto-proxy(engine_init+0xf4)[0x5597cd0ddd04] ./mtproto-proxy(default_main+0x113)[0x5597cd0debd3] ./mtproto-proxy(default_main+0x113)[0x5597cd0debd3] /lib/x86_64-linux-gnu/libc.so.6(libc_start_main+0xf3)[0x7f335007e0b3] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f335007e0b3] ./mtproto-proxy(_start+0x2e)[0x5597cd0a983e] [pid 746096] [time 1642251043] ------------------------------- ./mtproto-proxy(_start+0x2e)[0x5597cd0a983e] [pid 746096] [time 1642251043] mtproxy-0.01 compiled at Jan 15 2022 20:46:43 by gcc 9.3.0 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b[pid 746096] [time 1642251043] [pid 746095] [time 1642251043] ------------------------------- [pid 746095] [time 1642251043] mtproxy-0.01 compiled at Jan 15 2022 20:46:43 by gcc 9.3.0 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b[pid 746095] [time 1642251043]

imans777 commented 1 year ago

same here

pursultani commented 1 year ago

Comment assert and recompile. This is to ensure that PID is in a certain range and for some platforms may be a false positive.

diff --git a/common/pid.c b/common/pid.c
index 7bd4b8d..7de6b7e 100644
--- a/common/pid.c
+++ b/common/pid.c
@@ -39,7 +39,7 @@ npid_t PID;
 void init_common_PID (void) {
   if (!PID.pid) {
     int p = getpid ();
-    assert (!(p & 0xffff0000));
+    //assert (!(p & 0xffff0000));
     PID.pid = p;
   }
   if (!PID.utime) {
kooran commented 1 year ago

Hello

Comment assert and recompile. This is to ensure that PID is in a certain range and for some platforms may be a false positive.

diff --git a/common/pid.c b/common/pid.c
index 7bd4b8d..7de6b7e 100644
--- a/common/pid.c
+++ b/common/pid.c
@@ -39,7 +39,7 @@ npid_t PID;
 void init_common_PID (void) {
   if (!PID.pid) {
     int p = getpid ();
-    assert (!(p & 0xffff0000));
+    //assert (!(p & 0xffff0000));
     PID.pid = p;
   }
   if (!PID.utime) {

i have opened pid.c using nano editor, i found similar codes at the begining of it , could you mention where to change exactly and how?

`npid_t PID;

void init_common_PID (void) { if (!PID.pid) { int p = getpid (); //assert (!(p & 0xffff0000)); PID.pid = p; } if (!PID.utime) { PID.utime = time (0); } }`