Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

‘Saving as’ an ASM File then Exiting the Program Leads to a Crash

3 posters

Go down  Message [Page 1 of 1]

KerimF

KerimF

Windows 7, 32
SimulIDE-R1861_Win32.

I liked to add a new function to ‘EarTest_08T4.asm’ (the name is not important). So, after I opened it, I saved it with another name as 'EarTest_08T5.asm'. Then, without doing anything else, I closed/exited simulIDE. A crash occurred.

I repeated these few steps several times and I got a crash always.

I hope this can be reproduced on your side.
(You may like to open ‘EarTest_08P_.asm’, you have already, and rename it as ‘EarTest_08PP.asm’ for example, then exit the program).

KerimF

KerimF

Please note that your fix of EEWE is not done for ATmega32 (and perhaps it is not done for some other MCUs in its family).

https://simulide.forumotion.com/t1064-about-working-with-avrasm2-assembler#4683

royqh1979



KerimF wrote:Windows 7, 32
SimulIDE-R1861_Win32.

I liked to add a new function to ‘EarTest_08T4.asm’ (the name is not important). So, after I opened it, I saved it with another name as 'EarTest_08T5.asm'. Then, without doing anything else, I closed/exited simulIDE. A crash occurred.

I repeated these few steps several times and I got a crash always.

I hope this can be reproduced on your side.
(You may like to open ‘EarTest_08P_.asm’, you have already, and rename it as ‘EarTest_08PP.asm’ for example, then exit the program).

It seems that it's because the old filename is not removed from the m_fileList in the editorwidget::saveas().

I've made a patch.

And also an issue I found:
- Some codeeditors may not get closed in the editorwidget::close(). Because when a tab/codeeditor is removed, m_docWidget->count() will decrease. So use icount() as the loop condition will cause the loop to be terminated early.

arcachofo

arcachofo

Thanks KerimF.

And also an issue I found:
- Some codeeditors may not get closed in the editorwidget::close(). Because when a tab/codeeditor is removed, m_docWidget->count() will decrease. So use icount() as the loop condition will cause the loop to be terminated early.
Here is where i get the crash.
Solved at Rev 1873.

It seems that it's because the old filename is not removed from the m_fileList in the editorwidget::saveas().
I didn't solve this one, but definetly can cause problems.
If you already have a solution, I will wait for your patch.

KerimF likes this post

royqh1979



arcachofo wrote:Thanks KerimF.

And also an issue I found:
- Some codeeditors may not get closed in the editorwidget::close(). Because when a tab/codeeditor is removed, m_docWidget->count() will decrease. So use icount() as the loop condition will cause the loop to be terminated early.
Here is where i get the crash.
Solved at Rev 1873.

It seems that it's because the old filename is not removed from the m_fileList in the editorwidget::saveas().
I didn't solve this one, but definetly can cause problems.
If you already have a solution, I will wait for your patch.
It seems that I forget the patch
Attachments
‘Saving as’ an ASM File then Exiting the Program Leads to a Crash Attachmentsaveas.zip
You don't have permission to download attachments.
(1 Kb) Downloaded 1 times

arcachofo and KerimF like this post

arcachofo

arcachofo

royqh1979 wrote:It seems that I forget the patch
Patch (partially) applied at Rev 1876.

royqh1979 wrote:And also an issue I found:
- Some codeeditors may not get closed in the editorwidget::close(). Because when a tab/codeeditor is removed, m_docWidget->count() will decrease. So use icount() as the loop condition will cause the loop to be terminated early.
I changed this a bit (R1873):
I will close all or nothing (if cancelled).



Last edited by arcachofo on Sat Sep 09, 2023 5:03 pm; edited 1 time in total

KerimF likes this post

royqh1979



arcachofo wrote:
royqh1979 wrote:It seems that I forget the patch
Ptach (partially) applied at Rev 1876.

royqh1979 wrote:And also an issue I found:
- Some codeeditors may not get closed in the editorwidget::close(). Because when a tab/codeeditor is removed, m_docWidget->count() will decrease. So use icount() as the loop condition will cause the loop to be terminated early.
I changed this a bit (R1873):
I will close all or nothing (if cancelled).

It seems that close() is still not correct.
The first loop still not correctly loop all the codeeditors.
And the second loop forcely close all lefted. This may cause some codeeditors not saved before close.
Code:

    for( int i=0; i<m_docWidget->count(); i++ )
    {
        m_docWidget->setCurrentIndex( i );
        if( !maybeSave() ) return false;
    }
    while( m_docWidget->count() )
    {
        m_docWidget->setCurrentIndex( 0 );
        closeTab( 0 );
    }

arcachofo

arcachofo

It seems that close() is still not correct.
The first loop still not correctly loop all the codeeditors.
And the second loop forcely close all lefted. This may cause some codeeditors not saved before close.
I don't see why the first loop still not correctly loop all the codeeditors.
And the second loop is reached only if everything was saved.

royqh1979



arcachofo wrote:
It seems that close() is still not correct.
The first loop still not correctly loop all the codeeditors.
And the second loop forcely close all lefted. This may cause some codeeditors not saved before close.
I don't see why the first loop still not correctly loop all the codeeditors.
And the second loop is reached only if everything was saved.

oh, I see. Codeeditors are not removed in the first loop.

arcachofo

arcachofo

oh, I see. Codeeditors are not removed in the first loop.
Exactly.
In any case is more efficient to read the size only once.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum