Menu

#293 Strange symbols while typing into the console

v1.1.x
fixed
critical (96)
v1.1.1
Bug Fix
2018-04-25
2018-03-13
Erik Hänel
No

If typing into the console, sometimes not only one char is added but multiple in a strange combination, just like w => w°ö?k. Solve this issue.

Analysis:
This issue only occurs in an application, which was compiled using full optimization. The issue could be tracked down to an unitialized buffer in wxTerm::OnChar():

unsigned char
buf[10];

Change this to

// char buffer has to be initialized. Otherwise it might contain unnecessary characters
char buf[] = {"\0\0\0\0\0\0\0\0\0\0"};

Implementation:
The fix was implemented as proposed by the analysis. Implementation tests were passed successfully.

Documentation:
Not needed - Bug fix.

Tests:
Fix was tested in production tests. No deviations detected (it only occured in some cases on some computer architectures and if fully otpimized). Bug fix implemented successfully.

Discussion

  • Erik Hänel

    Erik Hänel - 2018-03-13
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2018-03-13
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,9 @@
     If typing into the console, sometimes not only one char is added but multiple in a strange combination, just like `w => w°ö?k`. Solve this issue.
    +
    +**Analysis:**
    +
    +**Implementation:**
    +
    +**Documentation:**
    +
    +**Tests:**
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2018-03-13
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,18 @@
     If typing into the console, sometimes not only one char is added but multiple in a strange combination, just like `w => w°ö?k`. Solve this issue.
    
     **Analysis:**
    +This issue only occurs in an application, which was compiled using full optimization. The issue could be tracked down to an unitialized buffer in `wxTerm::OnChar()`:
    +
    
    +    :::C++
    +    unsigned char
    +    buf[10];
    +
    +Change this to
    +
    +    :::C++
    +    // char buffer has to be initialized. Otherwise it might contain unnecessary characters
    +    char buf[] = {"\0\0\0\0\0\0\0\0\0\0"}; 
    +    
    
     **Implementation:**
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2018-03-13
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -15,7 +15,9 @@
    
    
     **Implementation:**
    +The fix was implemented as proposed by the analysis. Implementation tests were passed successfully.
    
     **Documentation:**
    +Not needed - Bug fix.
    
     **Tests:**
    
    • status: implementing --> testing
     
  • Erik Hänel

    Erik Hänel - 2018-04-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -21,3 +21,4 @@
     Not needed - Bug fix.
    
     **Tests:**
    +Fix was tested in production tests. No deviations detected (it only occured in some cases on some computer architectures and if fully otpimized). Bug fix implemented successfully.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB