Author Topic: Bug in 3.0's new unique_mapping()  (Read 4732 times)

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Bug in 3.0's new unique_mapping()
« on: August 10, 2013, 05:21:43 PM »
Hello,

The new unique_mapping() seems to have some problems. Here's a simple example:

eval return unique_mapping( ({ "alpha","bravo","charlie","apple","bongo","cat" }), (: $1[0..0] :) );

On my local test copy (running on a 64-bit system) it just mixes it up and puts in "a" words with "b" words, or vice-versa.

On our test environment on our actual server (running on a 32-bit system, unfortunately), it returns ([ "": "alpha" ]).

When you do an array of objects and have the return type of the function be a string, it gets even worse.

On my local copy (again, 64-bit), I ran "eval return unique_mapping(users(),(: $1->query_name() :))" a few times, then it stopped outputting anything and this spat out at the prompt:

*** glibc detected *** /home/stav/misc/mud/bin/driver: malloc(): memory corruption (fast): 0x000000000165a330 ***

When I run that eval on the 32-bit system, it was doing weird things like putting the date in for player names when using chat lines, etc.

I'll see if I can find out anything more with my own testing. If you want any sort of information from me, like build environments for any of the boxes I'm using, let me know and I'll get whatever you need. Also, if there is a different venue for bug reports that you would like me to use, please let me know.

On a side note, I'm really happy to see the work you guys are putting into the driver, we all really appreciate it.

Thanks,
Stavros

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #1 on: August 10, 2013, 05:24:34 PM »
thanks for the report, i will debug it later today.

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #2 on: August 10, 2013, 09:27:40 PM »
Thanks for the report, this is indeed a nasty bug, fixed in the newly released 3.0-alpha7.2

https://github.com/fluffos/fluffos/releases/tag/fluffos-3.0-alpha7.2

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #3 on: August 11, 2013, 01:55:57 PM »
Thanks for the quick fix! It definitely caught some of the cases, but we're still running into problems. I've managed to find a regular crasher in our lib, but I haven't (yet) been able to reduce it down to a simple eval to reproduce. I'll work on that, but in the mean time, here's a trace of the crash (this is on my 64-bit local test environment):

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
find_in_mapping (m=0xc45b30, lv=<optimized out>) at mapping.cc:727
727         if (msameval(n->values, lv)) { return n->values + 1; }
(gdb) where
#0  find_in_mapping (m=0xc45b30, lv=<optimized out>) at mapping.cc:727
#1  0x0000000000420ea5 in eval_instruction (p=<optimized out>) at interpret.cc:2734
#2  0x000000000042d844 in apply_low (fun=0x827ad8 "describe_item_contents", ob=0xbf5970, num_arg=1) at interpret.cc:4333
#3  0x0000000000477495 in f__call_other () at efuns_main.cc:249
#4  0x000000000041e817 in eval_instruction (p=<optimized out>) at interpret.cc:3822
#5  0x000000000042d844 in apply_low (fun=0x852538 "move_player", ob=0x877210, num_arg=2) at interpret.cc:4333
#6  0x0000000000477495 in f__call_other () at efuns_main.cc:249
#7  0x000000000041e817 in eval_instruction (p=<optimized out>) at interpret.cc:3822
#8  0x000000000042d844 in apply_low (fun=0x9e1eb8 "use_exit", ob=0xc0f8a0, num_arg=1) at interpret.cc:4333
#9  0x00000000004856e4 in apply (where=<optimized out>, num_arg=1, ob=<optimized out>, fun=<optimized out>) at interpret.cc:4368
#10 user_parser(char*) [clone .23858] (buff=0x70c400 "south") at add_action.cc:417
#11 0x0000000000472df5 in parse_command (ob=0x877210, str=0x70c400 "south") at add_action.cc:495
#12 process_input (ip=0x8581a0, user_command=0x858260 "s") at comm.cc:1937
#13 0x0000000000473ac5 in restore_command_giver () at object.cc:2161
#14 parse_command (ob=<optimized out>, str=<optimized out>) at add_action.cc:496
#15 process_input (user_command=0x858260 "s", ip=0x8581a0) at comm.cc:1912
#16 process_user_command () at comm.cc:2026
#17 0x00000000004b3ab8 in backend (base=0x786440) at backend.cc:136
#18 0x0000000000414c1c in main (argc=2, argv=<optimized out>) at main.cc:390


We're using unique_mapping() to display items on the ground (describe_item_contents()), which is why it's so important to us, and why we're catching these bugs :P

Again, if you want me to post any config info, or if you want me to run the gdb with different compile options, let me know.

If I can figure out a simple, generic way to reproduce the crasher, I'll post here.

Thanks!
Stavros

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #4 on: August 11, 2013, 05:25:18 PM »
hmm.... To debug memory issue like this, there is no "crasher"  , you need to run the whole driver under valgrind

Try something like this

Code: [Select]

0. build driver in development mode

$ ./build.FluffOS develop

1. install valgrind and set correct parameter

$ sudo apt-get install valgrind
$ echo 0 > /proc/sys/kernel/yama/ptrace_scope

2. launch driver under valgrind like this

$ valgrind --leak-check=full --track-origins=yes --db-attach=yes --malloc-fill=0x75 --free-fill=0x55 ../driver <your config file>

3. login to your lib as usual, do something fishy   (it will be slow, that is okay) You may also have to relax your maimum eval cost setting, if necessary

4. Do some thing fishy and watch valgrind.

When it prints out a backtrace with "Invalid Read: X in xxx blocks freed"  etc, save the whole stack trace.

 Then press "y" and "enter"  to drop into GDB, do "bt" , and do "info locals" if needed.

5. Send me the report.


I will also put this instruction on fluffos.github.io now





[/code]

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #5 on: August 11, 2013, 05:48:59 PM »
please consult http://fluffos.github.io/bug.html  if needed.

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #6 on: August 11, 2013, 09:59:59 PM »
Here you go. I'm basically just doing exactly what you say, without any real understanding of what I'm doing, so be bear with my ignorance. Let me know if you want me to do anything else.

Thanks!

Code: [Select]
==19282== Memcheck, a memory error detector
==19282== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==19282== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==19282== Command: ./driver Config.SW 2
==19282==
WARNING: rlimit for core dump is 0, you will not get core on crash.
using config file: Config.SW
----------------------------------------------------------------------------
SWmud (FluffOS v3.0-alpha7.2) starting up on Linux/x86-64 - Sun Aug 11 22:29:49 2013


Event backend in use: epoll

Loading preloaded files ...
]Preloading: /adm/daemon/ftpd/ftpdt...](0.0)
]Preloading: /adm/daemon/services...](0.0)
]Preloading: /adm/daemon/intermud...](0.0)
Accepting connections on 127.0.0.1:6666.
Accepting connections on 127.0.0.1:4001.
Socket passed to fd 6 ignored (support is disabled).
Initializations complete.

==19282== Conditional jump or move depends on uninitialised value(s)
==19282==    at 0x462AF3: copy_chars(interactive_s*, char*, int) (comm.cc:1002)
==19282==    by 0x464725: get_user_data(interactive_s*) (comm.cc:1403)
==19282==    by 0x4AC5C9: on_user_read(int, short, void*) (event.cc:82)
==19282==    by 0x52840E3: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==19282==    by 0x4AC453: run_for_at_most_one_second(event_base*) (event.cc:65)
==19282==    by 0x4513A5: backend(event_base*) (backend.cc:131)
==19282==    by 0x4329FF: main (main.cc:390)
==19282==  Uninitialised value was created by a stack allocation
==19282==    at 0x461D0A: copy_chars(interactive_s*, char*, int) (comm.cc:687)
==19282==
==19282==
==19282== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- ==19282== Conditional jump or move depends on uninitialised value(s)
==19282==    at 0x480D4B: int_string_copy(char const*) (stralloc.cc:410)
==19282==    by 0x434AF6: copy_and_push_string(char const*) (interpret.cc:372)
==19282==    by 0x462B32: copy_chars(interactive_s*, char*, int) (comm.cc:1005)
==19282==    by 0x464725: get_user_data(interactive_s*) (comm.cc:1403)
==19282==    by 0x4AC5C9: on_user_read(int, short, void*) (event.cc:82)
==19282==    by 0x52840E3: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==19282==    by 0x4AC453: run_for_at_most_one_second(event_base*) (event.cc:65)
==19282==    by 0x4513A5: backend(event_base*) (backend.cc:131)
==19282==    by 0x4329FF: main (main.cc:390)
==19282==  Uninitialised value was created by a stack allocation
==19282==    at 0x461D0A: copy_chars(interactive_s*, char*, int) (comm.cc:687)
==19282==
==19282==
==19282== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- ==19282== Conditional jump or move depends on uninitialised value(s)
==19282==    at 0x4C2C065: strncpy (mc_replace_strmem.c:472)
==19282==    by 0x480DCC: int_string_copy(char const*) (stralloc.cc:418)
==19282==    by 0x434AF6: copy_and_push_string(char const*) (interpret.cc:372)
==19282==    by 0x462B32: copy_chars(interactive_s*, char*, int) (comm.cc:1005)
==19282==    by 0x464725: get_user_data(interactive_s*) (comm.cc:1403)
==19282==    by 0x4AC5C9: on_user_read(int, short, void*) (event.cc:82)
==19282==    by 0x52840E3: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==19282==    by 0x4AC453: run_for_at_most_one_second(event_base*) (event.cc:65)
==19282==    by 0x4513A5: backend(event_base*) (backend.cc:131)
==19282==    by 0x4329FF: main (main.cc:390)
==19282==  Uninitialised value was created by a stack allocation
==19282==    at 0x461D0A: copy_chars(interactive_s*, char*, int) (comm.cc:687)
==19282==
==19282==
==19282== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- ==19282== Invalid read of size 4
==19282==    at 0x4595DD: sval_hash(svalue_s) (mapping.cc:35)
==19282==    by 0x45AA88: svalue_to_int(svalue_s*) (mapping.cc:458)
==19282==    by 0x45D814: unique_svalue_compare::operator()(svalue_s, svalue_s) const (mapping.cc:575)
==19282==    by 0x45E08A: std::pair<std::_Rb_tree_iterator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, bool> std::_Rb_tree<svalue_s, std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, std::_Select1st<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::_M_insert_unique<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (stl_tree.h:1277)
==19282==    by 0x45DA51: std::pair<std::_Rb_tree_iterator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, bool> std::map<svalue_s, std::deque<svalue_s*, std::allocator<svalue_s*> >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::insert<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, void>(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (stl_map.h:526)
==19282==    by 0x45B468: f_unique_mapping() (mapping.cc:617)
==19282==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==19282==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==19282==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==19282==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==19282==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==19282==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==19282==  Address 0x7352768 is 8 bytes inside a block of size 39 free'd
==19282==    at 0x4C2A26C: free (vg_replace_malloc.c:446)
==19282==    by 0x480A37: deallocate_string(char*) (stralloc.cc:295)
==19282==    by 0x434FA8: int_free_svalue(svalue_s*, char const*) (interpret.cc:482)
==19282==    by 0x441911: apply(char const*, object_s*, int, int) (interpret.cc:4371)
==19282==    by 0x43557B: call_efun_callback(function_to_call_t*, int) (interpret.cc:597)
==19282==    by 0x45B404: f_unique_mapping() (mapping.cc:603)
==19282==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==19282==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==19282==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==19282==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==19282==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==19282==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==19282==
==19282==
==19282== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- ==19282== starting debugger with cmd: /usr/bin/gdb -nw /proc/19301/fd/1024 19301
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /proc/19301/fd/1024...done.
Attaching to program: /proc/19301/fd/1024, process 19301
Reading symbols from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so...Reading symbols from /usr/lib64/debug/usr/lib64/valgrind/vgpreload_core-amd64-linux.so.debug...done.
done.
Loaded symbols for /usr/lib64/valgrind/vgpreload_core-amd64-linux.so
Reading symbols from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so...Reading symbols from /usr/lib64/debug/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so.debug...done.
done.
Loaded symbols for /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so
Reading symbols from /lib64/librt.so.1...Reading symbols from /usr/lib64/debug/lib64/librt-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libcrypt.so.1...Reading symbols from /usr/lib64/debug/lib64/libcrypt-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /usr/lib64/libevent-2.0.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libevent-2.0.so.5
Reading symbols from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...Reading symbols from /usr/lib64/debug/lib64/libm-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...Reading symbols from /usr/lib64/debug/lib64/libc-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libpthread.so.0...Reading symbols from /usr/lib64/debug/lib64/libpthread-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib64/debug/lib64/ld-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Failed to read a valid object file image from memory.
0x00000000004595dd in sval_hash (x=...) at mapping.cc:35
35       return HASH(BLOCK(x.u.string));
[?1034h(gdb) bt
#0  0x00000000004595dd in sval_hash (x=...) at mapping.cc:35
#1  0x000000000045aa89 in svalue_to_int (v=0x7feffb648) at mapping.cc:458
#2  0x000000000045d815 in unique_svalue_compare::operator() (this=0x7feffb8e0, l=..., r=...) at mapping.cc:575
#3  0x000000000045e08b in std::_Rb_tree<svalue_s, std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, std::_Select1st<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::_M_insert_unique<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (this=0x7feffb8e0, __v=...)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/bits/stl_tree.h:1277
#4  0x000000000045da52 in std::map<svalue_s, std::deque<svalue_s*, std::allocator<svalue_s*> >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::insert<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, void>(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (
    this=0x7feffb8e0, __x=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/bits/stl_map.h:526
#5  0x000000000045b469 in f_unique_mapping () at mapping.cc:617
#6  0x0000000000440a1c in eval_instruction (p=0x705370a "\021") at interpret.cc:3848
#7  0x0000000000441868 in apply_low (fun=0x7049bc8 "describe_item_contents", ob=0x6f15c30, num_arg=1) at interpret.cc:4333
#8  0x0000000000471c10 in f__call_other () at efuns_main.cc:249
#9  0x0000000000440a1c in eval_instruction (p=0x788269c "\003{") at interpret.cc:3848
#10 0x0000000000441868 in apply_low (fun=0x77148e8 "move_player", ob=0x78b8b60, num_arg=2) at interpret.cc:4333
#11 0x0000000000471c10 in f__call_other () at efuns_main.cc:249
#12 0x0000000000440a1c in eval_instruction (p=0x6490c0d "\003\230") at interpret.cc:3848
#13 0x0000000000441868 in apply_low (fun=0x6a5bbc8 "use_exit", ob=0x6d7ff20, num_arg=1) at interpret.cc:4333
#14 0x00000000004418f3 in apply (fun=0x6a5bbc8 "use_exit", ob=0x6d7ff20, num_arg=1, where=1) at interpret.cc:4368
#15 0x00000000004a95aa in user_parser (buff=0x760540 <process_input(interactive_s*, char*)::buf> "south") at add_action.cc:417
#16 0x00000000004a97a8 in parse_command (str=0x760540 <process_input(interactive_s*, char*)::buf> "south", ob=0x78b8b60) at add_action.cc:495
#17 0x0000000000466260 in process_input (ip=0x6dff8d0, user_command=0x6dff990 "s") at comm.cc:1937
#18 0x00000000004665b4 in process_user_command () at comm.cc:2026
#19 0x00000000004513b8 in backend (base=0x63d4f40) at backend.cc:136
#20 0x0000000000432a00 in main (argc=3, argv=0x7ff000028) at main.cc:390
(gdb) infor locals
No locals.

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #7 on: August 11, 2013, 10:05:02 PM »
For the trace, I piped stdout and stderr into a logfile, so (1) it doesn't show my input for the actual valgrind stuff, and (2) when I dropped into gdb, it shows *all* input, including terminal stuff like my backspaces when I mistyped. Just a heads up.

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #8 on: August 11, 2013, 10:20:53 PM »
Okay,  Only the first error really matters, after one bad copy all bets are off , unique_mapping() is just the symptom.

you should press Y at first error here:

==19282== Conditional jump or move depends on uninitialised value(s)
==19282==    at 0x462AF3: copy_chars(interactive_s*, char*, int) (comm.cc:1002)
==19282==    by 0x464725: get_user_data(interactive_s*) (comm.cc:1403)
==19282==    by 0x4AC5C9: on_user_read(int, short, void*) (event.cc:82)
==19282==    by 0x52840E3: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==19282==    by 0x4AC453: run_for_at_most_one_second(event_base*) (event.cc:65)
==19282==    by 0x4513A5: backend(event_base*) (backend.cc:131)
==19282==    by 0x4329FF: main (main.cc:390)
==19282==  Uninitialised value was created by a stack allocation
==19282==    at 0x461D0A: copy_chars(interactive_s*, char*, int) (comm.cc:687)

after in get into gdb,  can you also do a "up" 

get to the stack of get_user_data and do "

print *ip
print buf
print num_bytes

hmm.... what client are you using?

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #9 on: August 11, 2013, 10:32:58 PM »
also... describe what did you exactly do to trigger this..  what command did you sent, for example.

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #10 on: August 11, 2013, 10:33:49 PM »
I'm just using telnet for this. This particular error happens right when I connect, before I enter a username or anything. Here is the log from valgrind and gdb:

Code: [Select]
==19595== Memcheck, a memory error detector
==19595== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==19595== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==19595== Command: ./driver Config.SW 2
==19595==
WARNING: rlimit for core dump is 0, you will not get core on crash.
using config file: Config.SW
----------------------------------------------------------------------------
SWmud (FluffOS v3.0-alpha7.2) starting up on Linux/x86-64 - Sun Aug 11 23:23:31 2013


Event backend in use: epoll

Loading preloaded files ...
]Preloading: /adm/daemon/ftpd/ftpdt...](0.0)
]Preloading: /adm/daemon/services...](0.0)
]Preloading: /adm/daemon/intermud...](0.0)
Accepting connections on 127.0.0.1:6666.
Accepting connections on 127.0.0.1:4001.
Socket passed to fd 6 ignored (support is disabled).
Initializations complete.

==19595== Conditional jump or move depends on uninitialised value(s)
==19595==    at 0x462AF3: copy_chars(interactive_s*, char*, int) (comm.cc:1002)
==19595==    by 0x464725: get_user_data(interactive_s*) (comm.cc:1403)
==19595==    by 0x4AC5C9: on_user_read(int, short, void*) (event.cc:82)
==19595==    by 0x52840E3: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==19595==    by 0x4AC453: run_for_at_most_one_second(event_base*) (event.cc:65)
==19595==    by 0x4513A5: backend(event_base*) (backend.cc:131)
==19595==    by 0x4329FF: main (main.cc:390)
==19595==  Uninitialised value was created by a stack allocation
==19595==    at 0x461D0A: copy_chars(interactive_s*, char*, int) (comm.cc:687)
==19595==
==19595==
==19595== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ----
==19595== starting debugger with cmd: /usr/bin/gdb -nw /proc/19606/fd/1024 19606
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /proc/19606/fd/1024...done.
Attaching to program: /proc/19606/fd/1024, process 19606
Reading symbols from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so...Reading symbols from /usr/lib64/debug/usr/lib64/valgrind/vgpreload_core-amd64-linux.so.debug...done.
done.
Loaded symbols for /usr/lib64/valgrind/vgpreload_core-amd64-linux.so
Reading symbols from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so...Reading symbols from /usr/lib64/debug/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so.debug...done.
done.
Loaded symbols for /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so
Reading symbols from /lib64/librt.so.1...Reading symbols from /usr/lib64/debug/lib64/librt-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libcrypt.so.1...Reading symbols from /usr/lib64/debug/lib64/libcrypt-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /usr/lib64/libevent-2.0.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libevent-2.0.so.5
Reading symbols from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...Reading symbols from /usr/lib64/debug/lib64/libm-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...Reading symbols from /usr/lib64/debug/lib64/libc-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libpthread.so.0...Reading symbols from /usr/lib64/debug/lib64/libpthread-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib64/debug/lib64/ld-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Failed to read a valid object file image from memory.
0x0000000000462af3 in copy_chars (ip=0x6eed4f0, from=0x7feffc510 "\377\372\030", num_bytes=75) at comm.cc:1002
1002                   if (env_buf[j]) { j++; }
[?1034h(gdb) bt
#0  0x0000000000462af3 in copy_chars (ip=0x6eed4f0, from=0x7feffc510 "\377\372\030", num_bytes=75) at comm.cc:1002
#1  0x0000000000464726 in get_user_data (ip=0x6eed4f0) at comm.cc:1403
#2  0x00000000004ac5ca in on_user_read (fd=12, what=2, arg=0x6eef720) at event.cc:82
#3  0x00000000052840e4 in event_base_loop () from /usr/lib64/libevent-2.0.so.5
#4  0x00000000004ac454 in run_for_at_most_one_second (base=0x63d4f40) at event.cc:65
#5  0x00000000004513a6 in backend (base=0x63d4f40) at backend.cc:131
#6  0x0000000000432a00 in main (argc=3, argv=0x7ff000028) at main.cc:390
(gdb) info locals
j = 0
k = 2
env_buf = "\340\273s\000\000\000\000\000\200\274s\000\000\000\000\000\214\305\342\005\000\000\000\000\340\064+\006\000\000\000\000d\300\377\376\a\000\000\000r)\321\005\000\000\000\000\342\377L\000\000\000\000\000\220\273s\000\000\000\000\000\302\377L\000\000\000\000\000\300\273s\000\000\000\000\000лs\000\000\000\000\000\300\273s\000\000\000\000\000\340\300\377\376*(\000\000 \243*\006\000\000\000\000\220\273s\000\000\000\000\000лs\000\000\000\000\000m5M\000\000\000\000\060X\311\356\006\000\000\000\000\020\274s\000\000\000\000\000\260\273s\000\000\000\000\000`\275\377\376\a\000\000\000\263 I\000\000\000\000\000p\273s\000\000\000\000\000\020\000\000\000\060\000\000\000m5M\000\000\000\000\000\330\320\356\006\000\000\000\000\000\275\377\376\a\000\000\000\205\031I\000\000\000\000\000\002\021\000\000\000\000\000\000\240\227\002\070\000\000\000\000\002\000\000\000\000\000\000\000\001", '\000' <repeats 15 times>...
i = 74
dont_response = "\377\376"
start = 0
x = 0
wont_response = "\377", <incomplete sequence \374>
(gdb) up
#1  0x0000000000464726 in get_user_data (ip=0x6eed4f0) at comm.cc:1403
1403       copy_chars(ip, buf, num_bytes);
(gdb) print *ip
$1 = {ob = 0x7984530, input_to = 0x79af630, carryover = 0x0, num_carry = 0, connection_type = 1, fd = 12, addr = {ss_family = 2, __ss_align = 0, __ss_padding = 'u' <repeats 112 times>}, addrlen = 16,
  local_port = 6666, external_port = 0, prompt = 0x4d44fc "> ", text = "\000", 'u' <repeats 2047 times>, text_end = 0, text_start = 0, last_time = 1376277831, snooped_by = 0x0, default_err_message = {
    f = 0x0, s = 0x0}, ed_buffer = 0x0, message_producer = 1493, message_consumer = 1493, message_length = 0,
  message_buf = "\377\375\030\377\375\037\377\375[\377\373F\377\373]\377\375'\377\373\311", ' ' <repeats 16 times>, "A long time ago, in a galaxy far, far away...\r\n\r\n", ' ' <repeats 13 times>, '#' <repeats 24 times>, "   ######     ", '#' <repeats 11 times>, ' ' <repeats 15 times>, "\r\n", ' ' <repeats 11 times>, '#' <repeats 26 times>, "  ########    ", '#' <repeats 13 times>, "\r\n          ", '#' <repeats 27 times>, " ####  ####   "..., iflags = 1072, out_of_band = 0 '\000', state = 0, sb_pos = 51, trans = 0x6549a40, sb_buf = 0x6eef6a0 "'", sb_size = 57, slc = {"\000",
     <incomplete sequence \363>,  <incomplete sequence \364>,  <incomplete sequence \365>,  <incomplete sequence \366>, "\000", "\000", "\000",  <incomplete sequence \355>, "\001\b", "\000", "\000",
    "\000", "\000", "\000", "\000", "\000", "\000"}, ws_text = 'u' <repeats 2048 times>, ws_text_end = 0, ws_text_start = 0, ws_size = 0, ws_mask = 1970632053, ws_maskoffs = 117 'u',
  ev_read = 0x6eef770, ev_write = 0x6eef8a0, ev_data = 0x6eef720}
(gdb) print buf
$2 = "\377\372\030\000XTERM-256COLOR\377\360\377\372'\000\003XAUTHORITY\001/home/cpl/.Xauthority\000DISPLAY\001roast:0\377\360\000/\000\000\000\377\377\377\377\000\000\000\000\062\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000 T\006\006", '\000' <repeats 12 times>"\220, \307\034\002\000\000\000\000\001\000\000\000\000\000\000\000\244\201\000\000\350\003\000\000\352\003", '\000' <repeats 14 times>"\326, \022\000\000\000\000\000\000\000\020\000\000\000\000\000\000\020\000\000\000\000\000\000\000\363#\bR\000\000\000\000\031\316Y\004\000\000\000\000\000\002\000\000\000\000\000\000\060\306\377\376\a\000\000\000pX=\006\000\000\000\000\001", '\000' <repeats 23 times>...
(gdb) print num_bytes
$3 = 75

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #11 on: August 11, 2013, 10:46:51 PM »
hmm.  can you reproduce this with other mud client?

Also,

Were you using development version?

build the driver with

./build.FluffOS develop
make clean
make

Then try again with valgrind, see if changes anything (I doubt it).. But in any case, this is a new bug..

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #12 on: August 11, 2013, 10:48:12 PM »
You don't have any your own patch , do you?

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: Bug in 3.0's new unique_mapping()
« Reply #13 on: August 11, 2013, 11:10:31 PM »
No patches, this is straight from git.

OK, so the copy_chars() error only happens with telnet. When I used tinyfugue, I didn't get that one. However, my reliable crasher (seems to be in unique_mapping) still worked with tinyfugue. If you want to split these off into two issues on git or two forum posts, let me know.

I have to get to bed at the moment, but I'll be happy to keep testing stuff tomorrow.

And here's the valgrind log for the unique_mapping issue:

Code: [Select]
==22656== Memcheck, a memory error detector
==22656== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==22656== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==22656== Command: ./driver Config.SW 2
==22656==
WARNING: rlimit for core dump is 0, you will not get core on crash.
using config file: Config.SW
----------------------------------------------------------------------------
SWmud (FluffOS v3.0-alpha7.2) starting up on Linux/x86-64 - Sun Aug 11 23:50:04 2013


Event backend in use: epoll

Loading preloaded files ...
]Preloading: /adm/daemon/ftpd/ftpdt...](0.0)
]Preloading: /adm/daemon/services...](0.0)
]Preloading: /adm/daemon/intermud...](0.0)
Accepting connections on 127.0.0.1:6666.
Accepting connections on 127.0.0.1:4001.
Socket passed to fd 6 ignored (support is disabled).
Initializations complete.

==22656== Invalid read of size 4
==22656==    at 0x4595DD: sval_hash(svalue_s) (mapping.cc:35)
==22656==    by 0x45AA88: svalue_to_int(svalue_s*) (mapping.cc:458)
==22656==    by 0x45D814: unique_svalue_compare::operator()(svalue_s, svalue_s) const (mapping.cc:575)
==22656==    by 0x45E08A: std::pair<std::_Rb_tree_iterator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, bool> std::_Rb_tree<svalue_s, std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, std::_Select1st<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::_M_insert_unique<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (stl_tree.h:1277)
==22656==    by 0x45DA51: std::pair<std::_Rb_tree_iterator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, bool> std::map<svalue_s, std::deque<svalue_s*, std::allocator<svalue_s*> >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::insert<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, void>(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (stl_map.h:526)
==22656==    by 0x45B468: f_unique_mapping() (mapping.cc:617)
==22656==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==22656==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==22656==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==22656==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==22656==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==22656==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==22656==  Address 0x6dddd68 is 8 bytes inside a block of size 44 free'd
==22656==    at 0x4C2A26C: free (vg_replace_malloc.c:446)
==22656==    by 0x480A37: deallocate_string(char*) (stralloc.cc:295)
==22656==    by 0x434FA8: int_free_svalue(svalue_s*, char const*) (interpret.cc:482)
==22656==    by 0x441911: apply(char const*, object_s*, int, int) (interpret.cc:4371)
==22656==    by 0x43557B: call_efun_callback(function_to_call_t*, int) (interpret.cc:597)
==22656==    by 0x45B404: f_unique_mapping() (mapping.cc:603)
==22656==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==22656==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==22656==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==22656==    by 0x440A1B: eval_instruction(char*) (interpret.cc:3848)
==22656==    by 0x441867: apply_low(char const*, object_s*, int) (interpret.cc:4333)
==22656==    by 0x471C0F: f__call_other() (efuns_main.cc:249)
==22656==
==22656==
==22656== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ----
==22656== starting debugger with cmd: /usr/bin/gdb -nw /proc/27209/fd/1024 27209
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /proc/27209/fd/1024...done.
Attaching to program: /proc/27209/fd/1024, process 27209
Reading symbols from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so...Reading symbols from /usr/lib64/debug/usr/lib64/valgrind/vgpreload_core-amd64-linux.so.debug...done.
done.
Loaded symbols for /usr/lib64/valgrind/vgpreload_core-amd64-linux.so
Reading symbols from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so...Reading symbols from /usr/lib64/debug/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so.debug...done.
done.
Loaded symbols for /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so
Reading symbols from /lib64/librt.so.1...Reading symbols from /usr/lib64/debug/lib64/librt-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libcrypt.so.1...Reading symbols from /usr/lib64/debug/lib64/libcrypt-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /usr/lib64/libevent-2.0.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libevent-2.0.so.5
Reading symbols from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...Reading symbols from /usr/lib64/debug/lib64/libm-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...Reading symbols from /usr/lib64/debug/lib64/libc-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libpthread.so.0...Reading symbols from /usr/lib64/debug/lib64/libpthread-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib64/debug/lib64/ld-2.15.so.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Failed to read a valid object file image from memory.
0x00000000004595dd in sval_hash (x=...) at mapping.cc:35
35       return HASH(BLOCK(x.u.string));
[?1034h(gdb) bt
#0  0x00000000004595dd in sval_hash (x=...) at mapping.cc:35
#1  0x000000000045aa89 in svalue_to_int (v=0x7feffb648) at mapping.cc:458
#2  0x000000000045d815 in unique_svalue_compare::operator() (this=0x7feffb8e0, l=..., r=...) at mapping.cc:575
#3  0x000000000045e08b in std::_Rb_tree<svalue_s, std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, std::_Select1st<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::_M_insert_unique<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > >(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (this=0x7feffb8e0, __v=...)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/bits/stl_tree.h:1277
#4  0x000000000045da52 in std::map<svalue_s, std::deque<svalue_s*, std::allocator<svalue_s*> >, unique_svalue_compare, std::allocator<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > > > >::insert<std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >, void>(std::pair<svalue_s const, std::deque<svalue_s*, std::allocator<svalue_s*> > >&&) (
    this=0x7feffb8e0, __x=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/bits/stl_map.h:526
#5  0x000000000045b469 in f_unique_mapping () at mapping.cc:617
#6  0x0000000000440a1c in eval_instruction (p=0x7054afa "\021") at interpret.cc:3848
#7  0x0000000000441868 in apply_low (fun=0x704afb8 "describe_item_contents", ob=0x6d5ecb0, num_arg=1) at interpret.cc:4333
#8  0x0000000000471c10 in f__call_other () at efuns_main.cc:249
#9  0x0000000000440a1c in eval_instruction (p=0x7883a7c "\003{") at interpret.cc:3848
#10 0x0000000000441868 in apply_low (fun=0x7715cc8 "move_player", ob=0x78b9f40, num_arg=2) at interpret.cc:4333
#11 0x0000000000471c10 in f__call_other () at efuns_main.cc:249
#12 0x0000000000440a1c in eval_instruction (p=0x6f1a12d "\003\230") at interpret.cc:3848
#13 0x0000000000441868 in apply_low (fun=0x6530848 "use_exit", ob=0x6d80160, num_arg=1) at interpret.cc:4333
#14 0x00000000004418f3 in apply (fun=0x6530848 "use_exit", ob=0x6d80160, num_arg=1, where=1) at interpret.cc:4368
#15 0x00000000004a95aa in user_parser (buff=0x760540 <process_input(interactive_s*, char*)::buf> "south") at add_action.cc:417
#16 0x00000000004a97a8 in parse_command (str=0x760540 <process_input(interactive_s*, char*)::buf> "south", ob=0x78b9f40) at add_action.cc:495
#17 0x0000000000466260 in process_input (ip=0x6e00cb0, user_command=0x6e00d70 "s") at comm.cc:1937
#18 0x00000000004665b4 in process_user_command () at comm.cc:2026
#19 0x00000000004513b8 in backend (base=0x63d4f40) at backend.cc:136
#20 0x0000000000432a00 in main (argc=3, argv=0x7ff000028) at main.cc:390
(gdb) info locals
No locals.

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Re: Bug in 3.0's new unique_mapping()
« Reply #14 on: August 12, 2013, 01:51:22 AM »
That likely narrows it down to a TELNET negotiation issue, as tinyfugue just uses raw TCP sockets (AFAIK).

Note that utf-8 might also play a part, since a TELNET sequence starts with IAC (char 255), which may also be a flag for utf-8 handling to expect a second byte.  To be clear, TELNET handling MUST be done with the raw bytes. :)