#790 debugger causes segfaults when gcc 3.4.0 is used

fixed_in_v2.2
closed
nobody
Debugger (99)
6
2012-10-15
2004-05-15
V. Hankala
No

Hi!

Bochs (2.1.1) debugger causes segmentation faults when
gcc 3.4.0 has been used to compile the emulator (gcc
3.3.3 worked fine). Debugging with gdb showed that the
error might be in bx_debug/lexer.l at line 209:
"memcpy(buf, lex_input_ptr, max_size);".

When I changed the row to "strcpy(buf,
lex_input_ptr);", the error disappeared. Maybe this
caused some other problems or the actual error is
somewhere else but the debugger seems to be working.

Discussion

  • Phillip Wilson

    Phillip Wilson - 2004-08-24

    Logged In: YES
    user_id=223602

    I have the same issue with gcc-3.4.1-2

    I used strncpy(buf, lex_input_ptr, max_size) instead of
    strcpy(...)

    Thanks for posting a work-around

     
  • Robin Green

    Robin Green - 2005-02-19

    Logged In: YES
    user_id=2202

    Here is the fix - it was a simple logic error:

    --- bochs-2.1.1/bx_debug/lexer.l.orig 2005-02-19
    00:26:12.000000000 +0000
    +++ bochs-2.1.1/bx_debug/lexer.l 2005-02-19
    00:21:35.000000000 +0000
    @@ -203,7 +203,7 @@
    }

    len = strlen(lex_input_ptr);
    - if (len > max_size)
    + if (max_size > len)
    max_size = len;

    memcpy(buf, lex_input_ptr, max_size);

    Please apply this patch.

     
  • Stanislav Shwartsman

    Logged In: YES
    user_id=487634

    Thank you !
    The patch applied to CVS for Bochs 2.2.

    Stanislav

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks