News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

An unhandled exception ...

Started by LETARTARE, July 01, 2020, 07:59:35 PM

Previous topic - Next topic

LETARTARE

I wanted to edit some old translation files :
Quote'All_codeblocks.po'  ( # 1.5MB)
'All_codeblocks.pot' ( # 1 MB)
with cb-12180, wx3.1.3, gcc-8.1.0, win32 (Vista Business)

When saving :
1- the cursor indicates a wait
2- memory usage increases linearly up to
3- Appearance of a window indicating an exception not maintained
4- after acknowledgement on any CB answer disappears
5- no RPT report

Active plugins:
Quote- AutoSave
- Compiler
- Environment variables
- File extension handler

QuoteNo problem with cb12180, wx3.0.3, gcc-7.5.0 OpenSuse-Leap-15.1

I'll test under Win7 tomorrow.

Can you check if you have the same problem ??

Attachments
- All_codeblocks.po
- cbBigFile.png
in
CBBigFile.7z
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

oBFusCATed

What are the exact steps to reproduce the problem?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

stahta01

#2
Did you answer Abort, Retry, or ignore to the message box?

Edit: I will try Abort; building C::B on Windows 7 64 bit with wxWidgets 3.0.x 64 bit.
Edit2: Saw no problem with C::B on Windows 7 64 bit with wxWidgets 3.0.x 64 bit
Now trying wxWidgets 3.1.x 64 bit; but, without the steps likely will fail to see error.
Edit4: Did not see problem with wxWidgets 3.1.3.

Edit3: Using MSys2 GCC self compiled 10.1.1 20200621

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

#3
I just did a code search for the message and found one in "wxApp::OnExceptionInMainLoop" that is in file "src/msw/app.cpp".

bool wxApp::OnExceptionInMainLoop()
{
    // ask the user about what to do: use the Win32 API function here as it
    // could be dangerous to use any wxWidgets code in this state
    switch (
            ::MessageBox
              (
                NULL,
                wxT("An unhandled exception occurred. Press \"Abort\" to \
terminate the program,\r\n\
\"Retry\" to exit the program normally and \"Ignore\" to try to continue."),
                wxT("Unhandled exception"),
                MB_ABORTRETRYIGNORE |
                MB_ICONERROR|
                MB_TASKMODAL
              )
           )
    {
        case IDABORT:
            throw;

        default:
            wxFAIL_MSG( wxT("unexpected MessageBox() return code") );
            wxFALLTHROUGH;

        case IDRETRY:
            return false;

        case IDIGNORE:
            return true;
    }
}


Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

LETARTARE

@stahta01
Thank you for searching for the 'wx' function responsible for the message.
I can't find the call of this function...

@obfuscated
Steps to reproduce the problem with cb-12180,  gcc-8.1.0-dwarf, wx3.1.3,, win32 (Vista Business) :
1- active project: any
2- load 'All_codeblocks.po'
3- add spaces anywhere
4- save the file ... from that moment on,
- the cursor indicates a standby state for #40 S, then an exception message appears (see attached file)
Quote1- action : 'Abortl' twice => new message 'Error unknown';  action : 'ok' once => CB closes
2- action : 'Retry' or Ignore' once  => CB closes and the modified file is not saved.

I've been running tests on Win7
Quote1- win7-32: cb-12180, gcc-810-dwarf, wx-3.1.3
2- win7-64: cb-12180, gcc-810-seh, wx3.1.3
the save is correct
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

oBFusCATed

I can't reproduce this on linux. You'll have to build a version with symbols and attach a debugger.
Do I understand correctly that the issue happens on vista, but it doesn't happen on win7?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

stahta01

Quote
1- active project: any

Does the problem happen if there is no open project?
Because all my tests were with no open projects.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

LETARTARE

#7
@stahta01
QuoteWin32, cb12180, gcc-810-dwarf, wx-313
I've just done the test without a project: the result is identical

@obfuscated
If I understand your instructions correctly, I have to run a version of 'cb-12180' in debug mode from another version of 'cb' to capture the backup of the file.

I did another test with a version
Quotecb-12171, gcc-810-sljl, wx-313-sljl, Vista-32
and with 'WhatIsHang' from 'http://www.nirsoft.net'.
I managed to capture some information (bigfilepo.txt)
I also captured the state of Vista's memory  (processors.png)
- the linear increase of the memory corresponds to the saving of the file until the exception message is displayed.
- the memory drop corresponds to the destruction of 'CB'.


CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

LETARTARE

I just ran another test on Vista-32 :
I use 'cb-12171, gcc-810-sljl, wx-313-sljl',
wherein I load 'cb-12180, gcc-810-dwarf, wx-313-dwarf'.

I'm running 'cb-12180' in which
1- I load the file 'All_codeblocks.po'.
2- I modify this file
3- I save it
=> the backup is done properly !!
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

LETARTARE

#9
I think I've found the culprit !!
'cbEditor::Save()'
call
'm_pData->EnsureConsistentLineEnds();'
who call
'control->ConvertEOLs(control->GetEOLMode());'
which is creating the problem!
A remark : 'control->GetEOLMode()' return 0 (CRLF) while the file contains only 'LF' !

If I comment on this call the problem disappears!
So it's in ...
void wxScintilla::ConvertEOLs(int eolMode)
{
    SendMsg(SCI_CONVERTEOLS, eolMode, 0);
}


Then I'm no longer competent.
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

oBFusCATed

Do the problem still happen if you disable optimizations? (set a global variable "cb_release_type=-g -O0")
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

LETARTARE

CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

LETARTARE

#12
By finding out why 
QuoteA remark : 'control->GetEOLMode()' return 0 (CRLF) while the file contains only 'LF' !
I replaced
// control->ConvertEOLs(control->GetEOLMode());
by
control->ConvertEOLs(2);
in 'Scintilla.h' we find
#define SC_EOL_LF 2

and then BINGO : it works, no more problems !!

It is therefore a bad detection of the end of line by
int wxScintilla::GetEOLMode() const
{
    return SendMsg(SCI_GETEOLMODE, 0, 0);
}

with Win32.

Gentlemen developers, to your keyboards!

CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

stahta01

Quote from: LETARTARE on July 04, 2020, 05:48:39 PM
By finding out why 
QuoteA remark : 'control->GetEOLMode()' return 0 (CRLF) while the file contains only 'LF' !
I replaced
// control->ConvertEOLs(control->GetEOLMode());
by
control->ConvertEOLs(2);
in 'Scintilla.h' we find
#define SC_EOL_LF 2

and then BINGO : it works, no more problems !!

It is therefore a bad detection of the end of line by
int wxScintilla::GetEOLMode() const
{
    return SendMsg(SCI_GETEOLMODE, 0, 0);
}

with Win32.

Gentlemen developers, to your keyboards!

Not till you post what settings you had inside Code::Blocks!
End of Line options are:
The real important two are
"Ensure Consistent EOLs" and "End of Line Mode".

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

LETARTARE

Yes, you are right.
I use with Win-32
QuoteEnsure Consistent EOLs = Yes
End of Line : CRLF

Well, the file I used contained only Linux end of line (LF) and with the previous options chosen: CB wants to modify the end of line of the file with the end of line of the option and crashes with Win32 !

CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'