• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Issues trying to run TFS with gdb on ubuntu 20.04

Mjmackan

Mapper ~ Writer
Premium User
Joined
Jul 18, 2009
Messages
1,424
Solutions
15
Reaction score
176
Location
Sweden
Hiya! As title says, tried to run tfs 1.3 with GDB, on ubuntu 20.04 but for some reason it kills the process.
Otherwise i can run everything fine both at the linux machine without the debug mode and on my windows machine without any errors in the console.

gdb.png
 
"Killed" means that the process received a kill signal. I have seen this happen with the OOM (out of memory) reaper killing the server. Since it happens during map loading it could be that you don't have enough memory for the map you're using.

It may seem dumb, but make sure you don't have another instance running. If you have a spigu VPS, you need to shut the server down with stop tfs or systemctl stop tfs, else it will restart automatically.
Code:
ps aux | grep tfs

You can also check the system logs for messages related to tfs.
Code:
dmesg | grep tfs
 
"Killed" means that the process received a kill signal. I have seen this happen with the OOM (out of memory) reaper killing the server. Since it happens during map loading it could be that you don't have enough memory for the map you're using.

It may seem dumb, but make sure you don't have another instance running. If you have a spigu VPS, you need to shut the server down with stop tfs or systemctl stop tfs, else it will restart automatically.
Code:
ps aux | grep tfs

You can also check the system logs for messages related to tfs.
Code:
dmesg | grep tfs
I did stop tfs from autorestart, how does it OOM when running in GDB and not in normal though?
Map is about 40mb, running with 3gb of ram might be to smol?

It seems like alot of segfault with connection to IP? and i did see one with memory issues.
Im not aware of how to interpret these errors, so if you'd bother to help it'd be highly appreciated!

Here's the dump:
Code:
[1088324.169917] tfs[17970]: segfault at 405 ip 0000563321e4107e sp 00007ff6607fd860 error 4 in tfs[563321dfc000+332000]
[1403542.125102] tfs[10209]: segfault at 0 ip 0000000000000000 sp 00007f9ca5e2c8d8 error 14
[1412260.415479] tfs[5341]: segfault at 3 ip 0000000000000003 sp 00007f0d998e38a8 error 14
[1414064.182499] tfs[711]: segfault at 0 ip 0000000000000000 sp 00007fbc0ff74958 error 14
[1414568.902207] tfs[21422]: segfault at 7f5f7d234a50 ip 00007f5f7d234a50 sp 00007f5f9e2ff8a8 error 15
[1415019.164706] tfs[14868]: segfault at 0 ip 0000000000000000 sp 00007f7fe79b9958 error 14
[1449749.683505] tfs[16045]: segfault at 7f8bdcb167d0 ip 00007f8bdcb167d0 sp 00007f8c013158a8 error 15
[1449819.194015] tfs[20889]: segfault at 0 ip 00005624e2652103 sp 00007f3dffa29810 error 4 in tfs[5624e2608000+33d000]
[1450387.927316] tfs[25079]: segfault at 10100000009 ip 000055f23a523005 sp 00007f983d6457a0 error 4 in tfs[55f23a23f000+33d000]
[1475708.104627] tfs[7119]: segfault at 0 ip 0000000000000000 sp 00007f8f7dc338a8 error 14
[1488491.210302] tfs[28131]: segfault at 7f6cf168cf50 ip 00007f6cf168cf50 sp 00007f6d1794f958 error 15
[1489755.713559] tfs[28421]: segfault at 0 ip 00005612e126c14d sp 00007f0c7e1be8b0 error 4 in tfs[5612e1222000+340000]
[2732231.457616] traps: tfs[16848] general protection fault ip:5607e61d3e8a sp:7eff88d1d8e0 error:0 in tfs[5607e61c2000+334000]
[2768262.696529] traps: tfs[15743] general protection fault ip:7f7b052ce263 sp:7f7b041458e8 error:0 in libstdc++.so.6.0.28[7f7b052a2000+f0000]
[2898662.201577] tfs[32209]: segfault at 7f5c080007a0 ip 00007f5c080007a0 sp 00007f5c0dad5998 error 15
[2934640.232223] tfs[17903]: segfault at 98 ip 000055b136589c10 sp 00007f0b412d79a0 error 4 in tfs[55b13643b000+334000]
[3098748.280422] traps: tfs[17741] general protection fault ip:561cfcec4c1a sp:7fdbf27129a0 error:0 in tfs[561cfcd76000+334000]
[3099726.228208] tfs[11803]: segfault at 11d ip 0000556ac3102902 sp 00007f4455778890 error 4 in tfs[556ac2ea8000+334000]
[3102295.443516] tfs[27025]: segfault at 7fd4f103d540 ip 00007fd4f103d540 sp 00007fd50df9d488 error 15
[3162363.200357] tfs[29705]: segfault at 25 ip 0000561f7674e0be sp 00007fb2b1dd9890 error 4 in tfs[561f76709000+334000]
[3197335.345541] tfs[10341]: segfault at 7f234db78740 ip 00007f234db78740 sp 00007f236e672998 error 15
[3310640.487138] tfs[6587]: segfault at 7f079e295d70 ip 00007f079e295d70 sp 00007f07b25479a8 error 15
[3310793.962310] traps: tfs[29762] general protection fault ip:55a126138802 sp:7f05e04639b0 error:0 in tfs[55a12609e000+33c000]
[3310996.199096] tfs[6794]: segfault at 55e000260018 ip 000055e02b29be99 sp 00007f830cdc09a0 error 4 in tfs[55e02b294000+33c000]
[3395226.900317] tfs[29267]: segfault at 7f2f940005f0 ip 00007f2f940005f0 sp 00007f2f9cca3998 error 15
[3399985.064573] tfs[10216]: segfault at 7f0300000000 ip 00005621e00c80be sp 00007f03a68b6890 error 4 in tfs[5621e0083000+33c000]
[3409001.814768] traps: tfs[641] general protection fault ip:55f1c139dc1a sp:7f98b94169a0 error:0 in tfs[55f1c124f000+33c000]
[3529256.901253] tfs[27557]: segfault at 7f60800005e0 ip 00007f60800005e0 sp 00007f608665e998 error 15
[3535307.634324] tfs[17782]: segfault at 0 ip 0000000000000000 sp 00007f360c4305d8 error 14
[3554454.313138] traps: tfs[9629] general protection fault ip:55cea938594e sp:7fb3fe277890 error:0 in tfs[55cea9125000+33c000]
[3555705.622869] tfs[15010]: segfault at 7f24a00005e0 ip 00007f24a00005e0 sp 00007f24a58e6998 error 15
[3578044.992570] tfs[19918]: segfault at 100000009 ip 000055e5aa344168 sp 00007f603c85e7a0 error 6 in tfs[55e5aa334000+33c000]
[3630281.496923] tfs[3143]: segfault at 0 ip 0000000000000000 sp 00007f8c73261998 error 14
[3753807.757207] tfs[19363]: segfault at 98 ip 00005562e3d9dc10 sp 00007f9b61f569a0 error 4 in tfs[5562e3c4f000+33c000]
[3767392.751241] traps: tfs[29813] general protection fault ip:7fd6515db263 sp:7fd6504528e8 error:0 in libstdc++.so.6.0.28[7fd6515af000+f0000]
[3801752.947190] tfs[6196]: segfault at 7fb6c0000640 ip 00007fb6c0000640 sp 00007fb6c6c20998 error 15
[4205767.107290] tfs[10416]: segfault at 55d19f94592c ip 000055d19f93f43a sp 00007fa91b79e7f8 error 7 in tfs[55d19f925000+33c000]
[4347024.245627] traps: tfs[21879] general protection fault ip:55ff35edb45c sp:7fdb0f22f990 error:0 in tfs[55ff35e3f000+33c000]
[4358763.679385] traps: tfs[12217] general protection fault ip:56547b7c5436 sp:7f96477b3700 error:0 in tfs[56547b753000+33c000]
[4388846.876479] tfs[10460]: segfault at 100000018 ip 0000563a6319ab4e sp 00007fc6d6534890 error 4 in tfs[563a62f3a000+33c000]
[4408200.715925] tfs[16204]: segfault at 55e1000e0018 ip 000055e11bd67b4e sp 00007ff05cc6b890 error 4 in tfs[55e11bb07000+33c000]
[4430880.303619] traps: tfs[8832] general protection fault ip:55854e2afb4e sp:7f0866f0b890 error:0 in tfs (deleted)[55854e04f000+33c000]
[4505117.088710] traps: tfs[8927] general protection fault ip:564a5fae994e sp:7f4b41260890 error:0 in tfs[564a5f889000+33c000]
[4567208.476967] tfs[8660]: segfault at 7f80c4000600 ip 00007f80c4000600 sp 00007f80c9efa998 error 15
[4595305.076329] traps: tfs[20340] general protection fault ip:55aab72858e8 sp:7f54fdf02890 error:0 in tfs[55aab7224000+33c000]
[4600251.577011] traps: tfs[23207] general protection fault ip:7f8db19e6263 sp:7f8db085d8e8 error:0 in libstdc++.so.6.0.28[7f8db19ba000+f0000]
[4633751.857438] traps: tfs[10131] general protection fault ip:559770c5e0be sp:7fb815989890 error:0 in tfs[559770c19000+33c000]
[4785813.946536] traps: tfs[27702] general protection fault ip:55961ad3e94e sp:7f78fd5de890 error:0 in tfs[55961aade000+33c000]
[4864692.276116] tfs[17863]: segfault at 55b200100020 ip 000055b26063ee8a sp 00007f8a17c9b8e0 error 4 in tfs[55b26062d000+33c000]
[4937029.710035] traps: tfs[24300] general protection fault ip:7fb9fc71d263 sp:7fb9fb5948e8 error:0 in libstdc++.so.6.0.28[7fb9fc6f1000+f0000]
[4976175.848294] traps: tfs[16193] general protection fault ip:56306eae594e sp:7f3608087890 error:0 in tfs[56306e885000+33c000]
[4991321.999755] traps: tfs[18752] general protection fault ip:55dc5dd63e8a sp:7f034957f8e0 error:0 in tfs[55dc5dd52000+33c000]
[5010858.388897] traps: tfs[6561] general protection fault ip:562319fcb436 sp:7fd4916616b0 error:0 in tfs[562319f59000+33c000]
[5012921.851230] tfs[3108]: segfault at 7fb320000640 ip 00007fb320000640 sp 00007fb3277a2998 error 15
[5048995.724729] traps: tfs[27638] general protection fault ip:55a24830fc1a sp:7fa3df85c9a0 error:0 in tfs[55a2481c1000+33c000]
[5103278.739723] traps: tfs[17342] general protection fault ip:55ec0c6a00be sp:7f751403a890 error:0 in tfs (deleted)[55ec0c65b000+33c000]
[5187108.369593] traps: tfs[21498] general protection fault ip:55b78f8740be sp:7f4f9af2f890 error:0 in tfs[55b78f82f000+33c000]
[5229985.800017] tfs[3213]: segfault at 4d ip 00005562ac41594e sp 00007f9f2760b890 error 4 in tfs (deleted)[5562ac1b5000+33c000]
[5259775.240346] [  12037] 101000 12037   291072   244349  2269184        0             0 tfs
[5262495.271383] traps: tfs[12051] general protection fault ip:5609fff6cb4e sp:7f36f7086890 error:0 in tfs[5609ffd0c000+33c000]
[5280639.820424] tfs[7507]: segfault at 7fa400000000 ip 00005627f6cca0be sp 00007fa48d4ab890 error 4 in tfs[5627f6c85000+33c000]
[5294413.078653] tfs[355]: segfault at 7f3838 ip 00005634a5b6d8e8 sp 00007f38ddb5a5e0 error 4 in tfs[5634a5b0c000+33c000]
[5327988.116499] traps: tfs[14650] general protection fault ip:55d5217470be sp:7f917d30c890 error:0 in tfs[55d521702000+33c000]
[5343009.412532] tfs[18970]: segfault at 7fdf00000000 ip 000055799b4fb0be sp 00007fdfd083a890 error 4 in tfs[55799b4b6000+33c000]
[5436513.947373] tfs[19048]: segfault at 7f3ba3626ae0 ip 00007f3ba3626ae0 sp 00007f3bbc4f5998 error 15
[5443119.683767] traps: tfs[19097] general protection fault ip:559ab273243a sp:7f730612c7f8 error:0 in tfs[559ab2718000+33c000]
[5447395.649951] [  12310] 101000 12310   699879   648651  5394432        0             0 tfs
[5447395.654965] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=ns,mems_allowed=0,oom_memcg=/lxc/555573,task_memcg=/lxc/555573/ns/system.slice/tfs.service,task=tfs,pid=12310,uid=101000
[5447395.655619] Memory cgroup out of memory: Killed process 12310 (tfs) total-vm:2799516kB, anon-rss:2594604kB, file-rss:0kB, shmem-rss:0kB, UID:101000 pgtables:5268kB oom_score_adj:0
[5447395.767831] oom_reaper: reaped process 12310 (tfs), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[5449859.061401] tfs invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
[5449859.062064] CPU: 6 PID: 1771 Comm: tfs Tainted: P           O      5.4.78-2-pve #1
[5449859.117087] [   1766] 101000  1766   547746   486106  4050944        0             0 tfs
[5449859.123763] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=ns,mems_allowed=0,oom_memcg=/lxc/555573,task_memcg=/lxc/555573/ns/system.slice/tfs.service,task=tfs,pid=1766,uid=101000
[5449859.124704] Memory cgroup out of memory: Killed process 1766 (tfs) total-vm:2190984kB, anon-rss:1944424kB, file-rss:0kB, shmem-rss:0kB, UID:101000 pgtables:3956kB oom_score_adj:0
[5449859.210577] oom_reaper: reaped process 1766 (tfs), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[5450158.253915] tfs invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
[5450158.254563] CPU: 6 PID: 22208 Comm: tfs Tainted: P           O      5.4.78-2-pve #1
[5450158.302001] [  22203] 101000 22203   334115   274898  2396160        0             0 tfs
[5450158.305722] [  15277] 101000 15277    94384    36099   454656        0             0 tfs
[5450359.049949] [  22203] 101000 22203   334780   275913  2400256        0             0 tfs
[5450423.123756] [  22203] 101000 22203   334780   276080  2400256        0             0 tfs
[5450423.127492] [   4155] 101000  4155    78001    34938   442368        0             0 tfs
[5450497.063030] [  22203] 101000 22203   334876   276434  2400256        0             0 tfs
[5450497.114247] [  12137] 101000 12137    78049    34394   442368        0             0 tfs
[5450665.828043] [  22203] 101000 22203   334925   276982  2400256        0             0 tfs
[5450665.831996] [  28310] 101000 28310    78049    33971   438272        0             0 tfs
 
I'm not super experienced with those error logs. What I can say is that the 'ip' you see doesn't mean ip address, it stands for instruction pointer and 'sp' means stack pointer (where the segfault occured). I don't know how to get any useful information out of the memory addresses though. I'm guessing this is the issue you want to debug with gdb.

You have 2 out of memory kills, probably from when you ran it in gdb. It's possible that your are right on the limit of what your memory can handle and running gdb is enough to push past it.
TFS used 2.6 and 1.95 Gb respectively, at the time of being killed, which seems reasonable given that you have 3 Gb total.
Code:
[5447395.655619] Memory cgroup out of memory: Killed process 12310 (tfs) total-vm:2799516kB, anon-rss:2594604kB, file-rss:0kB, shmem-rss:0kB, UID:101000 pgtables:5268kB oom_score_adj:0
[5449859.124704] Memory cgroup out of memory: Killed process 1766 (tfs) total-vm:2190984kB, anon-rss:1944424kB, file-rss:0kB, shmem-rss:0kB, UID:101000 pgtables:3956kB oom_score_adj:0

Before you run out and get a bigger VPS, look at your memory usage when the server is running normally.
free -m and top -p $(pidof tfs) are useful.
 
I'm not super experienced with those error logs. What I can say is that the 'ip' you see doesn't mean ip address, it stands for instruction pointer and 'sp' means stack pointer (where the segfault occured). I don't know how to get any useful information out of the memory addresses though. I'm guessing this is the issue you want to debug with gdb.

You have 2 out of memory kills, probably from when you ran it in gdb. It's possible that your are right on the limit of what your memory can handle and running gdb is enough to push past it.
TFS used 2.6 and 1.95 Gb respectively, at the time of being killed, which seems reasonable given that you have 3 Gb total.
Code:
[5447395.655619] Memory cgroup out of memory: Killed process 12310 (tfs) total-vm:2799516kB, anon-rss:2594604kB, file-rss:0kB, shmem-rss:0kB, UID:101000 pgtables:5268kB oom_score_adj:0
[5449859.124704] Memory cgroup out of memory: Killed process 1766 (tfs) total-vm:2190984kB, anon-rss:1944424kB, file-rss:0kB, shmem-rss:0kB, UID:101000 pgtables:3956kB oom_score_adj:0

Before you run out and get a bigger VPS, look at your memory usage when the server is running normally.
free -m and top -p $(pidof tfs) are useful.
Ofcourse the debug mode should crave more memory, maybe I will have to upgrade my VPS then to figure this one out.
So the memory looks fine but cpu 152.5%?

mem.png
 
I sucessfully ran gdb and finally got out a error on the shutdown.


Code:
Thread 1 "tfs" received signal SIGTSTP, Stopped (user).
0x00007ffff7eee43e in epoll_wait (epfd=4, events=0x7fffffffdb00, maxevents=128, timeout=-1)
    at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
30      ../sysdeps/unix/sysv/linux/epoll_wait.c: No such file or directory.
 
The %CPU in top is % of 1 logical core, so 150% means it is using 1,5 cores/threads. You can press Shift + i to switch to showing % of total available CPU instead if you prefer that.
It seems kind of high, but I don't have any experience running live servers so I don't know what would be normal for a populated server.

SIGTSTP is a suspend signal. For example if you press Ctrl + Z, it will send SIGTSTP. That doesn't look like an error. I have no idea what could cause the OS to send SIGTSTP on it's own accord. It is definitely not a segfault though, that will show "received signal SIGSEGV".
 
The %CPU in top is % of 1 logical core, so 150% means it is using 1,5 cores/threads. You can press Shift + i to switch to showing % of total available CPU instead if you prefer that.
It seems kind of high, but I don't have any experience running live servers so I don't know what would be normal for a populated server.

SIGTSTP is a suspend signal. For example if you press Ctrl + Z, it will send SIGTSTP. That doesn't look like an error. I have no idea what could cause the OS to send SIGTSTP on it's own accord. It is definitely not a segfault though, that will show "received signal SIGSEGV".
Oh i see, seems like i pasted wrong one, this seems to be the correct fault/error. Thanks for learning me all this the easy way.

Code:
Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5f44700 (LWP 19984)]
0x00005555557e9b44 in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=0x2c29322c3132334a) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
 
Oh i see, seems like i pasted wrong one, this seems to be the correct fault/error. Thanks for learning me all this the easy way.

Code:
Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5f44700 (LWP 19984)]
0x00005555557e9b44 in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=0x2c29322c3132334a) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
What does the backtrace say? You need to type bt or bt full in gdb after the segfault happens.
You should get a core dump that you can inspect if you have closed gdb. I think it's placed in the same folder as the tfs binary, and is named something like core.<pid>.

You can use ls -l | grep core to list core files and find the most recent one. If you find a core file, then run gdb ./tfs core.1234 (replace core.1234 with the actual name of the core file) and you should be able to type bt to get the backtrace.
 
What does the backtrace say? You need to type bt or bt full in gdb after the segfault happens.
You should get a core dump that you can inspect if you have closed gdb. I think it's placed in the same folder as the tfs binary, and is named something like core.<pid>.

You can use ls -l | grep core to list core files and find the most recent one. If you find a core file, then run gdb ./tfs core.1234 (replace core.1234 with the actual name of the core file) and you should be able to type bt to get the backtrace
I tried to type bt/bt full but all i get is "No stack". I found one file with same directory as my config, its named core, its however 106k kb and its unreadable from my notepad. Looks like this:

Code:
             F     0×€°                   p                        F      à€°                                      0F     °à€°                                      @F     Àà€°                  `                       PF      ꀰ                                       PF      ù€°                                       PF     °ý€°                                       PF     Àý€°           °       °                     F     pþ€°           0       0                    0F      þ€°           0       0                    `F     Ðþ€°                                      pF     `ÿ€°                                      pF     ð°                   À                    pF     °°                                      €F     À°                                      F     а                  p                    F     @°                                       F     а                    .                     F     pB°                                        F     €B°           @       @                    àF     ÀB°           /      /                   ðNF     Ðq°           €       €                    pOF     Pr°                  p                    €OF     Àr°                   °                   €OF     px°                   P                    €OF     Ày°                                       €OF     Ðy°                                         OF     ðy°                                      °OF      z°                                     ÀOF     ‘°                                       ÀOF     ©°                   À                    ÀOF     P²°                                       ÀOF     `²°                                      `SF      ¶°                                      pSF     ¶°           P       P                    ÀSF     `¶°                  p                    ÐSF     ж°                                      ÐSF     à·°                   P                    ÐSF     0¸°                                      àSF     @¸°                                      ðSF     P¸°           @       @                    0TF     ¸°                  ð                    @TF     €¹°                   à                    @TF     `º°                   `                     @TF     Àº°                                       @TF     к°                                        `TF     𺰠                                     pTF      »°                  p                    €TF     p»°                                       €TF     p¼°                   P                    €TF     À¼°                                      TF     м°                                       TF     ༰                  P                   °TF     0¿°                   €                   °TF     °Ö°                                        °TF     PÛ°                                       °TF     `Û°           0       0                    àTF     Û°           0       0                    UF     ÀÛ°           `       `                    pUF     ÐÜ°                                      €UF     àÜ°                   0                   €UF     ß°                   €                    €UF      ß°                                      UF     °ß°                                       UF     Àß°                                      °UF      @¿°                                      °YF     UEý                                    À[F     0WEý           0       0                    ð[F     `WEý                                       \F      `ÿÿÿÿÿ                                P     CORE                                  {o     zo  zo  ¥&      €     Ú      àò                                         Àiu˜V  à_V@    ?WEý   ¥£˜V  XÓ°   V  PYÓ°                  ÀYÔ°   V  rYÓ°  >        V   V  ÿÿÿÿÿÿÿÿD›~˜V  3            XÓ°  +        gÔ°                                                    ˆ      CORE    D      @@    è  è  zo     zo  zo  tfs             /home/otsmanager/custom/build/tfs                                                  €   IGISCORE                   V                                                                                                             @     CORE    !        `WEý         ÿûë¿                         d              @@U˜V         8                             ÐÜ°                            °ÆX˜V         è             è     
       è             è
 
I tried to type bt/bt full but all i get is "No stack". I found one file with same directory as my config, its named core, its however 106k kb and its unreadable from my notepad. Looks like this:
Did you load the core dump in gdb, gdb tfs core?

How exactly are you starting tfs in gdb? The core dump is for /home/otsmanager/custom/build/tfs, so the executable is in the build directory, but I don't think your data and config.lua is there?
 
That is true my tfs is in build but i dont have anything in there called 'core~'.
My cnf & data is in: /home/otsmanager/custom/

I did:
->gdb
->set cwd /home/otsmanager/custom/
->file /home/otsmanager/custom/build/tfs
-> run

Am i suppose to do tfs core before i run?
Edit: I ran gdb tfs core now and got this:
Code:
Reading symbols from tfs...
/home/otsmanager/custom/build/core: No such file or directory.
 
Last edited:
Try this:
cd /home/otsmanager/custom
gdb build/tfs core

If it doesn't work, I would run the executable from the working dir (copy tfs to /home/otsmanager/custom) to keep things simple.
 
Try this:
cd /home/otsmanager/custom
gdb build/tfs core

If it doesn't work, I would run the executable from the working dir (copy tfs to /home/otsmanager/custom) to keep things simple.
Does this open up 'core dump' file? or what does that do?
Tried to do it while running tfs, might not be the correct way?

Code:
BFD: warning: /home/otsmanager/custom/core is truncated: expected core file size >= 1176330240, found: 109981696
[New LWP 25585]
[New LWP 25587]
[New LWP 25586]
[New LWP 25584]
Cannot access memory at address 0x7f6f9220f168
Cannot access memory at address 0x7f6f9220f160
Failed to read a valid object file image from memory.
Core was generated by `/home/otsmanager/custom/build/tfs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055fe20838b4e in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=<error reading variable: Cannot access memory at address 0x7f6f90148888>) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
[Current thread is 1 (LWP 25585)]
 
Ok, so now i did:
-> cd /home/otsmanager/custom
-> gdb build/tfs core
Got this fault/error:
Code:
Reading symbols from build/tfs...
BFD: warning: /home/otsmanager/custom/core is truncated: expected core file size >= 1173803008, found: 109297664
[New LWP 7937]
[New LWP 7938]
[New LWP 7936]
[New LWP 7939]
Cannot access memory at address 0x7fc75ce01168
Cannot access memory at address 0x7fc75ce01160
Failed to read a valid object file image from memory.
Core was generated by `/home/otsmanager/custom/build/tfs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055bb9a57fb4e in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=<error reading variable: Cannot access memory at address 0x7fc75ad3a888>) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
[Current thread is 1 (LWP 7937)]
Then i kept on by typing:
-> Run

Everything is running so far but crashes as soon as i try to go out of the gdb, is it suppose to do that?
Code:
Thread 1 "tfs" received signal SIGINT, Interrupt.
0x00005555558c3bfc in xtea::<lambda(uint32_t&, uint32_t&)>::operator()(uint32_t &, uint32_t &) const (__closure=0x7fffffffda40, left=@0x7fffffffda1c: 167279750, right=@0x7fffffffda20: 719178848)
    at /home/otsmanager/custom/src/xtea.cpp:69
69                  right -= ((left << 4 ^ left >> 5) + left) ^ (sum + k[(sum >> 11) & 3]);
 
Does this open up 'core dump' file? or what does that do?
Tried to do it while running tfs, might not be the correct way?

Code:
BFD: warning: /home/otsmanager/custom/core is truncated: expected core file size >= 1176330240, found: 109981696
[New LWP 25585]
[New LWP 25587]
[New LWP 25586]
[New LWP 25584]
Cannot access memory at address 0x7f6f9220f168
Cannot access memory at address 0x7f6f9220f160
Failed to read a valid object file image from memory.
Core was generated by `/home/otsmanager/custom/build/tfs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055fe20838b4e in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=<error reading variable: Cannot access memory at address 0x7f6f90148888>) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
[Current thread is 1 (LWP 25585)]
Sorry for the late reply. Yes, it loads the core dump into gdb so you can examine the memory at the point of the crash. Loading it while tfs is running might be problematic as it will restore the core dump to memory, so you may not have enough memory to load it while tfs is running.
It looks like your core is truncated for some reason. That can happen if your core file size limit is too low but I bet it's already unlimited. You can check with ulimit -c, it will say 'unlimited' or a number if it's limited.

Ok, so now i did:
-> cd /home/otsmanager/custom
-> gdb build/tfs core
Got this fault/error:
Code:
Reading symbols from build/tfs...
BFD: warning: /home/otsmanager/custom/core is truncated: expected core file size >= 1173803008, found: 109297664
[New LWP 7937]
[New LWP 7938]
[New LWP 7936]
[New LWP 7939]
Cannot access memory at address 0x7fc75ce01168
Cannot access memory at address 0x7fc75ce01160
Failed to read a valid object file image from memory.
Core was generated by `/home/otsmanager/custom/build/tfs'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055bb9a57fb4e in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=<error reading variable: Cannot access memory at address 0x7fc75ad3a888>) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
[Current thread is 1 (LWP 7937)]
Then i kept on by typing:
-> Run

Everything is running so far but crashes as soon as i try to go out of the gdb, is it suppose to do that?
Code:
Thread 1 "tfs" received signal SIGINT, Interrupt.
0x00005555558c3bfc in xtea::<lambda(uint32_t&, uint32_t&)>::operator()(uint32_t &, uint32_t &) const (__closure=0x7fffffffda40, left=@0x7fffffffda1c: 167279750, right=@0x7fffffffda20: 719178848)
    at /home/otsmanager/custom/src/xtea.cpp:69
69                  right -= ((left << 4 ^ left >> 5) + left) ^ (sum + k[(sum >> 11) & 3]);
After gdb build/tfs core run 'bt full', not 'run'. When you load a core dump you are examining a previous error, not catching a new one. Since the core is truncated, 'bt' might not give anything, but it could. If you run tfs in gdb and then exit gdb, yes, it will close tfs as well. It tells you as much: Thread 1 "tfs" received signal SIGINT, Interrupt.. That is the signal you get from pressing Ctrl + C.

Because your core dump seems to be incomplete I suggest that you try to run tfs in gdb again:
Code:
cd /home/otsmanager/custom
gdb build/tfs
(gdb) run
You have to leave the console/gdb open and wait for the server to crash. When it does, run 'bt full'. If you can't leave gdb open, you have to start tfs normally, then the server should generate a new core dump the next time it crashes. You can then load that in gdb and use 'bt full' to get the backtrace after the fact.

I am guessing you are running a public server, so I also suggest you compile tfs with cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. so you get a more useful backtrace without hurting performance too much.
 
Sorry for the late reply. Yes, it loads the core dump into gdb so you can examine the memory at the point of the crash. Loading it while tfs is running might be problematic as it will restore the core dump to memory, so you may not have enough memory to load it while tfs is running.
It looks like your core is truncated for some reason. That can happen if your core file size limit is too low but I bet it's already unlimited. You can check with ulimit -c, it will say 'unlimited' or a number if it's limited.


After gdb build/tfs core run 'bt full', not 'run'. When you load a core dump you are examining a previous error, not catching a new one. Since the core is truncated, 'bt' might not give anything, but it could. If you run tfs in gdb and then exit gdb, yes, it will close tfs as well. It tells you as much: Thread 1 "tfs" received signal SIGINT, Interrupt.. That is the signal you get from pressing Ctrl + C.

Because your core dump seems to be incomplete I suggest that you try to run tfs in gdb again:
Code:
cd /home/otsmanager/custom
gdb build/tfs
(gdb) run
You have to leave the console/gdb open and wait for the server to crash. When it does, run 'bt full'. If you can't leave gdb open, you have to start tfs normally, then the server should generate a new core dump the next time it crashes. You can then load that in gdb and use 'bt full' to get the backtrace after the fact.

I am guessing you are running a public server, so I also suggest you compile tfs with cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. so you get a more useful backtrace without hurting performance too much.
I think that was so i did when compiling. I actually got an error and it has one of my raid scripts in there hence the part: "[RANDOM BOSS]: etc"

Here's the fault (bt full) code:
Code:
(gdb) bt full
#0  0x00005555555ce0be in NetworkMessage::getLength (this=0x7068223d00000000) at /home/otsmanager/custom/src/networkmessage.h:120
No locals.
#1  0x0000555555815e78 in Protocol::getOutputBuffer (this=0x7ffff003a388, size=62) at /home/otsmanager/custom/src/protocol.cpp:55
No locals.
#2  0x00005555558199f6 in ProtocolGame::writeToOutputBuffer (this=0x7ffff003a388, msg=...) at /home/otsmanager/custom/src/protocolgame.cpp:396
        out = std::shared_ptr<OutputMessage> (use count -128611512, weak count -1958166016) = {get() = 0x7ffff5f33940}
#3  0x000055555581fb0c in ProtocolGame::sendTextMessage (this=0x7ffff003a388, message=...) at /home/otsmanager/custom/src/protocolgame.cpp:1415
        msg = {static INITIAL_BUFFER_POSITION = 8, info = {length = 62, position = 70, overrun = false},
          buffer = "\000\000\240\242\271\331\377\177\264\004:\000[RANDOM BOSS]: Boss dissapears in 2 minutes if not killed.\377\177\000\000\320\071\363\365\377\177\000\000r\263~UUU\000\000\000\000\000\000\000\000\000\000\017:\363\365\377\177\000\000P:\363\365\377\177\000\000\221\260~UUU\000\000& \377\000\377\000\000&\327:\363\365\377\177\000\000\020;\363\365\377\177\000\000\030;\363\365\377\177\000\000\377\000\000\001E\377\006\377\000\000\377D\377\000\377\000\240\242\271\331\377\177\000\000@:\363\365\377\177\000\000P:\363\365\377\177\000\000\224d\201UUU"...}
#4  0x00005555555bf24a in Player::sendTextMessage (this=0x7ffff10bd100, message=...) at /home/otsmanager/custom/src/player.h:974
No locals.
#5  0x0000555555756c1b in LuaScriptInterface::luaPlayerSendTextMessage (L=0x40040378) at /home/otsmanager/custom/src/luascript.cpp:9278
        player = 0x7ffff10bd100
        parameters = 3
        message = {type = MESSAGE_STATUS_CONSOLE_BLUE, text = "[RANDOM BOSS]: Boss dissapears in 2 minutes if not killed.", position = {x = 0, y = 0, z = 0 '\000'}, channelId = 0, primary = {value = 0, color = -1}, secondary = {
            value = 0, color = -1}}
#6  0x00007ffff792bfb7 in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#7  0x00007ffff797a4a4 in lua_pcall () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#8  0x00005555556d57f0 in LuaScriptInterface::protectedCall (L=0x40040378, nargs=1, nresults=1) at /home/otsmanager/custom/src/luascript.cpp:300
        error_index = 4
        ret = 21845
#9  0x00005555556d6958 in LuaScriptInterface::callFunction (this=0x555555a3a500 <g_luaEnvironment>, params=1) at /home/otsmanager/custom/src/luascript.cpp:547
        result = false
        size = 5
#10 0x000055555576f7ce in LuaEnvironment::executeTimerEvent (this=0x555555a3a500 <g_luaEnvironment>, eventIndex=1542952) at /home/otsmanager/custom/src/luascript.cpp:16406
        env = 0x555555a3a6e0 <LuaScriptInterface::scriptEnv>
        it = {<std::__detail::_Node_iterator_base<std::pair<unsigned int const, LuaTimerEventDesc>, false>> = {_M_cur = 0x7fffe18ad210}, <No data fields>}
        timerEventDesc = {scriptId = 1242, function = 2557, parameters = std::vector of length 1, capacity 1 = {5275}, eventId = 6337126}
#11 0x000055555578ded8 in std::__invoke_impl<void, void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&> (__f=
    @0x7ffff33bcd50: (void (LuaEnvironment::*)(LuaEnvironment * const, unsigned int)) 0x55555576f5fa <LuaEnvironment::executeTimerEvent(unsigned int)>, __t=@0x7ffff33bcd68: 0x555555a3a500 <g_luaEnvironment>)
    at /usr/include/c++/9/bits/invoke.h:73
No locals.
#12 0x000055555578ac72 in std::__invoke<void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&> (__fn=
    @0x7ffff33bcd50: (void (LuaEnvironment::*)(LuaEnvironment * const, unsigned int)) 0x55555576f5fa <LuaEnvironment::executeTimerEvent(unsigned int)>) at /usr/include/c++/9/bits/invoke.h:95
No locals.
#13 0x0000555555786290 in std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) (this=0x7ffff33bcd50, __args=...)
    at /usr/include/c++/9/functional:400
No locals.
#14 0x000055555577fdd5 in std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::operator()<, void>() (this=0x7ffff33bcd50) at /usr/include/c++/9/functional:484
No locals.
#15 0x0000555555779140 in std::_Function_handler<void (), std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)> >::_M_invoke(std::_Any_data const&) (__functor=...)
    at /usr/include/c++/9/bits/std_function.h:300
No locals.
#16 0x000055555589191a in std::function<void ()>::operator()() const (this=0x7fffe02e6620) at /usr/include/c++/9/bits/std_function.h:688
No locals.
#17 0x0000555555891444 in Task::operator() (this=0x7fffe02e6610) at /home/otsmanager/custom/src/tasks.h:40
No locals.
#18 0x0000555555891679 in Dispatcher::threadMain (this=0x555555a3b080 <g_dispatcher>) at /home/otsmanager/custom/src/tasks.cpp:60
        task = 0x7fffe02e6610
        taskLockUnique = {_M_device = 0x555555a3b098 <g_dispatcher+24>, _M_owns = false}
#19 0x00005555557e52d4 in std::__invoke_impl<void, void (Dispatcher::*)(), Dispatcher*> (__f=@0x555555a6cae0: (void (Dispatcher::*)(Dispatcher * const)) 0x55555589156a <Dispatcher::threadMain()>,
    __t=@0x555555a6cad8: 0x555555a3b080 <g_dispatcher>) at /usr/include/c++/9/bits/invoke.h:73
No locals.
#20 0x00005555557e5003 in std::__invoke<void (Dispatcher::*)(), Dispatcher*> (__fn=@0x555555a6cae0: (void (Dispatcher::*)(Dispatcher * const)) 0x55555589156a <Dispatcher::threadMain()>) at /usr/include/c++/9/bits/invoke.h:95
No locals.
#21 0x00005555557e4b6f in std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::_M_invoke<0ul, 1ul> (this=0x555555a6cad8) at /usr/include/c++/9/thread:244
No locals.
#22 0x00005555557e4573 in std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::operator() (this=0x555555a6cad8) at /usr/include/c++/9/thread:251
--Type <RET> for more, q to quit, c to continue without paging--
 
Back
Top