16 Dec, 2013, Davenge wrote in the 1st comment:
Votes: 0
That's what GDB had to say.

Quote
*** buffer overflow detected ***: /home/irish/chaos/src/dbtls terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ffff73d8f47]
/lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7ffff73d7e40]
/home/irish/chaos/src/dbtls[0x4806b1]
/home/irish/chaos/src/dbtls[0x4836cf]
/home/irish/chaos/src/dbtls[0x484ba3]
/home/irish/chaos/src/dbtls[0x489d61]
/home/irish/chaos/src/dbtls[0x48a2dd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ffff72ef76d]
/home/irish/chaos/src/dbtls[0x402789]
======= Memory map: ========
00400000-0069d000 r-xp 00000000 08:01 74721625 /home/irish/chaos/src/dbtls
0089c000-0089d000 r–p 0029c000 08:01 74721625 /home/irish/chaos/src/dbtls
0089d000-008a9000 rw-p 0029d000 08:01 74721625 /home/irish/chaos/src/dbtls
008a9000-027b5000 rw-p 00000000 00:00 0 [heap]
7ffff6a87000-7ffff6a9c000 r-xp 00000000 08:01 72882410 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6a9c000-7ffff6c9b000 —p 00015000 08:01 72882410 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6c9b000-7ffff6c9c000 r–p 00014000 08:01 72882410 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6c9c000-7ffff6c9d000 rw-p 00015000 08:01 72882410 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6c9d000-7ffff6cb5000 r-xp 00000000 08:01 72888712 /lib/x86_64-linux-gnu/libresolv-2.15.so
7ffff6cb5000-7ffff6eb5000 —p 00018000 08:01 72888712 /lib/x86_64-linux-gnu/libresolv-2.15.so
7ffff6eb5000-7ffff6eb6000 r–p 00018000 08:01 72888712 /lib/x86_64-linux-gnu/libresolv-2.15.so
7ffff6eb6000-7ffff6eb7000 rw-p 00019000 08:01 72888712 /lib/x86_64-linux-gnu/libresolv-2.15.so
7ffff6eb7000-7ffff6eb9000 rw-p 00000000 00:00 0
7ffff6eb9000-7ffff6ec0000 r-xp 00000000 08:01 72888713 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ffff6ec0000-7ffff70bf000 —p 00007000 08:01 72888713 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ffff70bf000-7ffff70c0000 r–p 00006000 08:01 72888713 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ffff70c0000-7ffff70c1000 rw-p 00007000 08:01 72888713 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7ffff70c1000-7ffff70cd000 r-xp 00000000 08:01 72888711 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ffff70cd000-7ffff72cc000 —p 0000c000 08:01 72888711 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ffff72cc000-7ffff72cd000 r–p 0000b000 08:01 72888711 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ffff72cd000-7ffff72ce000 rw-p 0000c000 08:01 72888711 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7ffff72ce000-7ffff7483000 r-xp 00000000 08:01 72888707 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7483000-7ffff7683000 —p 001b5000 08:01 72888707 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7683000-7ffff7687000 r–p 001b5000 08:01 72888707 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7687000-7ffff7689000 rw-p 001b9000 08:01 72888707 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7689000-7ffff768e000 rw-p 00000000 00:00 0
7ffff768e000-7ffff7697000 r-xp 00000000 08:01 72888708 /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ffff7697000-7ffff7897000 —p 00009000 08:01 72888708 /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ffff7897000-7ffff7898000 r–p 00009000 08:01 72888708 /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ffff7898000-7ffff7899000 rw-p 0000a000 08:01 72888708 /lib/x86_64-linux-gnu/libcrypt-2.15.so
7ffff7899000-7ffff78c7000 rw-p 00000000 00:00 0
7ffff78c7000-7ffff79c2000 r-xp 00000000 08:01 72888718 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff79c2000-7ffff7bc1000 —p 000fb000 08:01 72888718 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff7bc1000-7ffff7bc2000 r–p 000fa000 08:01 72888718 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff7bc2000-7ffff7bc3000 rw-p 000fb000 08:01 72888718 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff7bc3000-7ffff7bd9000 r-xp 00000000 08:01 72882365 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7ffff7bd9000-7ffff7dd8000 —p 00016000 08:01 72882365 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7ffff7dd8000-7ffff7dd9000 r–p 00015000 08:01 72882365 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7ffff7dd9000-7ffff7dda000 rw-p 00016000 08:01 72882365 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7ffff7dda000-7ffff7dfc000 r-xp 00000000 08:01 72888719 /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7fe3000-7ffff7fe7000 rw-p 00000000 00:00 0
7ffff7ff6000-7ffff7ffa000 rw-p 00000000 00:00 0
7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso]
7ffff7ffc000-7ffff7ffd000 r–p 00022000 08:01 72888719 /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7ffd000-7ffff7fff000 rw-p 00023000 08:01 72888719 /lib/x86_64-linux-gnu/ld-2.15.so
7ffffffd6000-7ffffffff000 rw-p 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Program received signal SIGABRT, Aborted.
0x00007ffff7304425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.


Problems working between 32 and 64 bit???
16 Dec, 2013, plamzi wrote in the 2nd comment:
Votes: 0
If you're moving the code from 32-bit to 64-bit, did it recompile cleanly?

I'm assuming you realize you absolutely have to recompile and that, even after you do, many things may need to be tweaked to work properly (e. g. bitvectors).
16 Dec, 2013, Davenge wrote in the 3rd comment:
Votes: 0
Yah, I recompiled cleanly and that worked for the first compatibility issues but now its going nuts with this buffer overflow stuff.

From what I've read, I should be able to compile with -m32 flag but then I need the 32 bit libraries and point to them on the gcc command line somehow, but I don't know how or what libraries I need.
16 Dec, 2013, quixadhal wrote in the 4th comment:
Votes: 0
Your error is a buffer overflow. Is it possible you compiled using a newer version of gcc, which has more stringent error checking, and thus caught an error that your older binary simply ignored?

While it's possible that it's a 32 vs. 64 bit issue, most of the time those surface as either bus errors (word alignment offsets) or segmentation faults (bad pointer arithmetic that assumes 32-bit pointer sizes).
17 Dec, 2013, Davenge wrote in the 5th comment:
Votes: 0
Is there's no way to run the program in a 32-bit environment on a 64-bit machine?
17 Dec, 2013, Davion wrote in the 6th comment:
Votes: 0
Davenge said:
Is there's no way to run the program in a 32-bit environment on a 64-bit machine?


You pretty much got it with the -m32 flag. Just point to the libaries and you're good to go. Get someone to install glib.x86 for ya and point to it with a -l flag. Theoretically, that should work.
17 Dec, 2013, Davenge wrote in the 7th comment:
Votes: 0
Ok, it's my VPS so I can get the glib.x86, then its what -l glib.x86 with a space?
17 Dec, 2013, Davenge wrote in the 8th comment:
Votes: 0
so, I tagged -m32 and -L/lib32/ -lc

It compiled, but I'm getting compatibility errors with ever .o

"is incompatible with i386:x86-64 output"
17 Dec, 2013, Davion wrote in the 9th comment:
Votes: 0
Davenge said:
so, I tagged -m32 and -L/lib32/ -lc

It compiled, but I'm getting compatibility errors with ever .o

"is incompatible with i386:x86-64 output"


You may need -m32 in your ld flags as well.
17 Dec, 2013, Davenge wrote in the 10th comment:
Votes: 0
That got it to compile, but still having the same error.

It's still saying "backtrace: /lib/i386-linux-gnu/libc.so.6" which is not the libc that I pointed it to?

What's wrong with my linking, I wonder?
17 Dec, 2013, quixadhal wrote in the 11th comment:
Votes: 0
There's nothing wrong with your linking… if there were, you wouldn't have an executable to run. As I said, it's an overflow error that is being caught at runtime, and is very likely a bug that went undetected in your code on your 32-bit platform because your system had older compilers and libraries that didn't DO those checks.

Also, libc is treated special by gcc. If you want to NOT include the system libc, there's a flag specifically to do that which I don't recall off the top of my head.
17 Dec, 2013, Tijer wrote in the 12th comment:
Votes: 0
that buffer overflow is due to you printing to a buffer thats not big enough for whatever you are printing.. a prime reason why you should be using snprintf !!

Newer versions of gcc do not like doing that!!
18 Dec, 2013, Davenge wrote in the 13th comment:
Votes: 0
Well, it's incredibly old and shitty code and I did not use write it. But that's besides the point, it worked fine on the old server. Probably had an older version of GCC.
0.0/13