APE-Project / APE_Server

Ajax Push Engine : Lightweight HTTP Streaming server. Fully written in C language, it provides best performances, making it the faster Comet server to date. APE now support server-side javascript modules through spidermonkey

Home Page:www.ape-project.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aped dies on me, like 5 times per day.

Shinta opened this issue · comments

Here is what I saw in my console.

*** glibc detected *** /usr/local/src/ape_server/bin/aped: double free or corruption (!prev): 0x0a8d32b8 ***
======= Backtrace: =========
/lib/libc.so.6[0xaa15a5]
/lib/libc.so.6(cfree+0x59)[0xaa19e9]
/usr/local/src/ape_server/bin/aped[0x805b0e8]
/usr/local/src/ape_server/bin/aped(sockroutine+0x5e5)[0x804dd85]
/usr/local/src/ape_server/bin/aped(main+0x92b)[0x804cc7b]
/lib/libc.so.6(__libc_start_main+0xdc)[0xa4de9c]
/usr/local/src/ape_server/bin/aped[0x804c281]
======= Memory map: ========
00110000-00118000 r-xp 00000000 08:03 14131923 /usr/lib/libkrb5support.so.0.1
00118000-00119000 rw-p 00007000 08:03 14131923 /usr/lib/libkrb5support.so.0.1
00119000-00129000 rwxp 00119000 00:00 0
0012b000-00135000 r-xp 00000000 08:03 22741031 /lib/libnss_files-2.5.so
00135000-00136000 r--p 00009000 08:03 22741031 /lib/libnss_files-2.5.so
00136000-00137000 rw-p 0000a000 08:03 22741031 /lib/libnss_files-2.5.so
00137000-0025a000 r-xp 00000000 08:03 14484914 /usr/lib/mysql/libmysqlclient_r.so.15.0.0
0025a000-0029c000 rw-p 00123000 08:03 14484914 /usr/lib/mysql/libmysqlclient_r.so.15.0.0
0029c000-0029d000 rw-p 0029c000 00:00 0
002c5000-003f8000 r-xp 00000000 08:03 14488144 /usr/local/src/ape_server/modules/lib/libmod_spidermonkey.so
003f8000-00402000 rw-p 00132000 08:03 14488144 /usr/local/src/ape_server/modules/lib/libmod_spidermonkey.so
00402000-00403000 rw-p 00402000 00:00 0
00403000-0052d000 r-xp 00000000 08:03 22742255 /lib/libcrypto.so.0.9.8e
0052d000-00540000 rw-p 00129000 08:03 22742255 /lib/libcrypto.so.0.9.8e
00540000-00544000 rw-p 00540000 00:00 0
0056b000-0064b000 r-xp 00000000 08:03 14132481 /usr/lib/libstdc++.so.6.0.8
0064b000-0064f000 r--p 000df000 08:03 14132481 /usr/lib/libstdc++.so.6.0.8
0064f000-00650000 rw-p 000e3000 08:03 14132481 /usr/lib/libstdc++.so.6.0.8
00650000-00656000 rw-p 00650000 00:00 0
0065d000-0068a000 r-xp 00000000 08:03 14134261 /usr/lib/libgssapi_krb5.so.2.2
0068a000-0068b000 rw-p 0002d000 08:03 14134261 /usr/lib/libgssapi_krb5.so.2.2
00697000-006bc000 r-xp 00000000 08:03 14133852 /usr/lib/libk5crypto.so.3.1
006bc000-006bd000 rw-p 00025000 08:03 14133852 /usr/lib/libk5crypto.so.3.1
006bf000-00703000 r-xp 00000000 08:03 22742256 /lib/libssl.so.0.9.8e
00703000-00707000 rw-p 00043000 08:03 22742256 /lib/libssl.so.0.9.8e
0071d000-0071e000 r-xp 0071d000 00:00 0 [vdso]
0071e000-007b1000 r-xp 00000000 08:03 14134259 /usr/lib/libkrb5.so.3.3
007b1000-007b4000 rw-p 00092000 08:03 14134259 /usr/lib/libkrb5.so.3.3
0081e000-0082e000 rwxp 0081e000 00:00 0
00a14000-00a2f000 r-xp 00000000 08:03 22741009 /lib/ld-2.5.so
00a2f000-00a30000 r--p 0001a000 08:03 22741009 /lib/ld-2.5.so
00a30000-00a31000 rw-p 0001b000 08:03 22741009 /lib/ld-2.5.so
00a33000-00a35000 r-xp 00000000 08:03 22742250 /lib/libkeyutils-1.2.so
00a35000-00a36000 rw-p 00001000 08:03 22742250 /lib/libkeyutils-1.2.so
00a38000-00b8b000 r-xp 00000000 08:03 22741016 /lib/libc-2.5.so
00b8b000-00b8d000 r--p 00152000 08:03 22741016 /lib/libc-2.5.so
00b8d000-00b8e000 rw-p 00154000 08:03 22741016 /lib/libc-2.5.so
00b8e000-00b91000 rw-p 00b8e000 00:00 0
00b93000-00b96000 r-xp 00000000 08:03 22741044 /lib/libdl-2.5.so
00b96000-00b97000 r--p 00002000 08:03 22741044 /lib/libdl-2.5.so
00b97000-00b98000 rw-p 00003000 08:03 22741044 /lib/libdl-2.5.so
00b9a000-00bc1000 r-xp 00000000 08:03 22741070 /lib/libm-2.5.so
00bc1000-00bc2000 r--p 00026000 08:03 22741070 /lib/libm-2.5.so
00bc2000-00bc3000 rw-p 00027000 08:03 22741070 /lib/libm-2.5.so
00bc5000-00bda000 r-xp 00000000 08:03 22741024 /lib/libpthread-2.5.so
00bda000-00bdb000 r--p 00015000 08:03 22741024 /lib/libpthread-2.5.so
00bdb000-00bdc000 rw-p 00016000 08:03 22741024 /lib/libpthread-2.5.so
00bdc000-00bde000 rw-p 00bdc000 00:00 0
00be0000-00bf2000 r-xp 00000000 08:03 14131443 /usr/lib/libz.so.1.2.3
00bf2000-00bf3000 rw-p 00011000 08:03 14131443 /usr/lib/libz.so.1.2.3
00bf5000-00c30000 r-xp 00000000 08:03 22742252 /lib/libsepol.so.1
00c30000-00c31000 rw-p 0003b000 08:03 22742252 /lib/libsepol.so.1
00c31000-00c3b000 rw-p 00c31000 00:00 0
00c3d000-00c53000 r-xp 00000000 08:03 22742253 /lib/libselinux.so.1
00c53000-00c55000 rw-p 00015000 08:03 22742253 /lib/libselinux.so.1
00c62000-00c77000 r-xp 00000000 08:03 22741040 /lib/libnsl-2.5.so
00c77000-00c78000 r--p 00014000 08:03 22741040 /lib/libnsl-2.5.so
00c78000-00c79000 rw-p 00015000 08:03 22741040 /lib/libnsl-2.5.so
00c79000-00c7b000 rw-p 00c79000 00:00 0
00d5e000-00d67000 r-xp 00000000 08:03 22741898 /lib/libcrypt-2.5.so
00d67000-00d68000 r--p 00008000 08:03 22741898 /lib/libcrypt-2.5.so
00d68000-00d69000 rw-p 00009000 08:03 22741898 /lib/libcrypt-2.5.so
00d69000-00d90000 rw-p 00d69000 00:00 0
00d92000-00d9d000 r-xp 00000000 08:03 22741206 /lib/libgcc_s-4.1.2-20080825.so.1
00d9d000-00d9e000 rw-p 0000a000 08:03 22741206 /lib/libgcc_s-4.1.2-20080825.so.1
00da0000-00da2000 r-xp 00000000 08:03 22742254 /lib/libcom_err.so.2.1
00da2000-00da3000 rw-p 00001000 08:03 22742254 /lib/libcom_err.so.2.1
00da5000-00db5000 r-xp 00000000 08:03 22742251 /lib/libresolv-2.5.so
00db5000-00db6000 r--p 0000f000 08:03 22742251 /lib/libresolv-2.5.so
00db6000-00db7000 rw-p 00010000 08:03 22742251 /lib/libresolv-2.5.so
00db7000-00db9000 rw-p 00db7000 00:00 0
08048000-08065000 r-xp 00000000 08:03 14425222 /usr/local/src/ape_server/bin/aped
08065000-08066000 rw-p 0001d000 08:03 14425222 /usr/local/src/ape_server/bin/aped
09edb000-0c300000 rw-p 09edb000 00:00 0 [heap]
b78a2000-b798b000 rw-p b7c74000 00:00 0
b7a00000-b7c00000 rw-p b7a00000 00:00 0
b7c8e000-b7fb5000 rw-p b7c8e000 00:00 0
b7fbf000-b7fc0000 rw-p b7fbf000 00:00 0
bfb98000-bfbad000 rw-p bffe9000 00:00 0 [stack]

Some Ape.conf:
Server {
daemon = yes
rlimit_nofile = 1000000
}
Log {
debug = 1
}
JSONP {
eval_func = Ape.transport.read
allowed = 1
}

Hey.

Which version? Master or?

Latest I think.
Version : 1.1.2-dev
Build : Jun 18 2011 13:06:17

Sorry for not specifying the version.

Are you using some custom server-side JS. Did you try the official release binary? (1.1.1)

I'm running a dating site, I have a chat for the user to talk each other.
Here is my server-side stuff.

This is a command to send a push to an user in a channel:

Ape.registerCmd("user_in_channel", false, function(params, infos) {
        if (params.password == "XXXXXXXXXXXX") {
                if ($defined(params.channel) && $defined(params.data) && $defined(params.raw)) {
                        var chan = Ape.getChannelByName(params.channel);
                        if (!$defined(chan)) return ["401", "UNKNOWN_CHANNEL"];                        
                        try {
                                chan.userslist.each(function(user) {                         
                                        if (user.getProperty('name') == params.aid) {                             
                                                user.pipe.sendRaw(params.raw, params.data)
                                                throw "break";
                                        }
                                });
                        } catch (e) {
                                if(e != "break") throw e;
                        }
                        return {"name":"pushed","data":{"value":"ok"}};
                } else {
                        return 0;
                }
        } else {
                return ["400", "BAD_PASSWORD"];
        }
});

Then I noticed a way back that my users were disconected after not doing anything for a while, so I implemented a ping, and every user sent this ping to the server every 40 seconds.

Ape.registerCmd('u_mad', true, function(params, infos) {
        return {"name": "u_mad", "data": {"user": params.user}};
});

No, I haven't try that release, but I will do, didn't know there were a new official release.

Hm, let me try to reproduce.
BTW, you don't need a ping system. The APE JSF already to that by itself.

What transport do you use ? (long polling (0) or another (> 0)) ?

Thanks

I testing it without the ping.

Yes, I'm using the default, Long Polling, think is the only thing that works with every freaking browser nowadays. I have traffic that still uses IE6 Y_Y.

Regards.

I will make some tests, and let you know if I have any problem.

Thanks for your support.

Any update on this?

Ape died 51 times today xD, but It seams someone is flooding the port:

Jun 29 10:24:58 club kernel: possible SYN flooding on port 6969. Sending cookies.
Jun 29 11:26:27 club kernel: possible SYN flooding on port 6969. Sending cookies.
Jun 29 11:28:33 club kernel: possible SYN flooding on port 6969. Sending cookies.
Jun 29 11:32:24 club kernel: possible SYN flooding on port 6969. Sending cookies.
Jun 29 11:37:42 club kernel: possible SYN flooding on port 6969. Sending cookies.
Jun 29 11:38:44 club kernel: possible SYN flooding on port 6969. Sending cookies.

Any advice?

Running on CentOS, Xeon Quad Core X3360 @ 2.83GHz with 4GB Ram.

I have a average of 60 people connected to 2 channels all the time.

Issue over 3 years old. Closing. Reopen a new one if issue is still there.