forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Property sheet crash
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Kenneth_Smith



Joined: 18 May 2012
Posts: 499
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Jan 31, 2021 11:28 am    Post subject: Reply with quote

Dan, I replicated your crash with 11 sheets. Removing the 11th sheet from the code and the crash is eliminated. I wonder if there may perhaps be a maximum of 10 permitted sheets with the coding of the DLL? Paul may have a view on that.
Ken
Back to top
View user's profile Send private message Visit poster's website
mecej4



Joined: 31 Oct 2006
Posts: 1556

PostPosted: Sun Jan 31, 2021 12:59 pm    Post subject: Reply with quote

I compiled and linked Dan's code using FTN95 8.70 with /opt /p6. I then ran the resulting program, then clicked on File->Settings; in the new tabbed window that popped up, I clicked the radio-button Selection->PrintScreen Density, then Ok.

At this point I received an Access Violation window, "The instruction at address 00000000 attempted to read from location 00000000".

I then repeated all the steps above, but with /64 instead of /p6. The resulting EXE did not crash this time.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2240
Location: Yateley, Hants, UK

PostPosted: Sun Jan 31, 2021 11:24 pm    Post subject: Reply with quote

Quote:
* Didn't I mention before that anyone who is not using property sheet is losing a lot and their programs most probably look like sh#t and are barely usable?
... Dan

I have never been able to make property sheets work, nor half a dozen other CW+ facilities, and have managed to work around without them. CW+ doesn't have some facilities that would be useful, and have managed to work around their absence. Windows evolution makes some things that looked great when developed, but a few years later look very dated. I've also managed to work round that.

None of the deficiencies of CW+, or of me as a programmer or application designer, stop the system being absolutely brilliant and usable to produce fully featured Windows applications - none of which need to use property sheets or for that matter, some of the other facilities.

Personally, I'd think that an application that crashes unexpectedly, thereby losing your work, isn't even barely usable, no matter how brilliant it looks up to that point. Now what was that epithet? Shot? Shut? Sheet?

Eddie
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2411
Location: South Pole, Antarctica

PostPosted: Mon Feb 01, 2021 12:15 am    Post subject: Reply with quote

Thank you all for trying.

Updated compiler and the %PS still crashes.

Eddie, the key words were "most probably". Of course you can recreate similar functionality and/or adopt it to fit specific device better and even make it look more modern, but even if it crashes in some cases (i have dozens working OK and one only can crash if i forgot to call it via workaround) the %PS is still so great that i can not live without it. Besides i found bearable workarounds till it will be fixed. I'd find more if it was really needed.
I'd even stress that almost no one with large codes can live without it and have manageable code. Recreation of similar functionality in house in such cases will not worth efforts. Also Microsoft and Paul slowly but steadily update look and feel of CWP. You also can do that so it will not look any boring or dated. As to crashing - Paul will fix it eventually. And will make new bugs possibly even in your workarounds Smile
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7068
Location: Salford, UK

PostPosted: Mon Feb 01, 2021 11:46 am    Post subject: Reply with quote

This failure arises because ClearWin+ is accessing the sheet control variables ish1, ish2, ish3... after the function MainSettings has gone out of scope.

You can give these variables the SAVE attribute or declare them at the top level of the module (for example).

I can't see anything about this in the documentation for %sh or %ps so I will add warnings at both places.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2411
Location: South Pole, Antarctica

PostPosted: Mon Feb 01, 2021 6:47 pm    Post subject: Reply with quote

Paul, the point is that no matter what is saved or not saved, in scope or out of scope, variables defined or undefined, the Clearwin does not have to crash, it must be rock stable, this is not the Fortran (where crash is the hint for the errors) but just additional facility, the graphics interface. Nothing bad will happen if Clearwin will have internal bugs but still not crash. Users just will inform the developers about odd behavior but will be able still to live with the bug. At least it is much better that property sheet will for example due to its bugs not start second time you call it than it will crash and take down with it the rest of Fortran code which ran simulation for 12 hours. With bad but not crashing GUI the Fortran code will continue its run and most probably will save the data in other forms besides GUI completing the run.

Users do not have to know about sources of errors in Clearwin, who cares that ish1 have to be in scope? 99.9% of Fortran users even do not know and will never interested what in scope means. Why %PS not doing this internally? Not enough memory for additional code to handle that inside %PS? Or additional code which handles all user insane moves torturing GUI will slow down the GUI? When the user interacts with the property sheet the GUIs human-to-computer input-output with the mouse and keyboard response time is approximately 0.1 second, enough for 1000 additional internal checks for anything bad programmer might do.

My larger code still crashes with SAVE. Adding SAVE is by the way counterintuitive

Fortranish approach to GUI development - one step aside and you got crash, abort, access violation - is hell wrong, currently it's like you got tiny scratch of your finger, or piece of dust got into your eye and this immediately causes the death of the entire human.


Last edited by DanRRight on Mon Feb 01, 2021 7:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7068
Location: Salford, UK

PostPosted: Mon Feb 01, 2021 7:45 pm    Post subject: Reply with quote

Dan

I thought that you wanted to know why it was crashing. I am now sorry that I wasted my time trying to help.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2411
Location: South Pole, Antarctica

PostPosted: Mon Feb 01, 2021 7:47 pm    Post subject: Reply with quote

We already discussed this, see above about your SAVE suggestion in 2009. This is not a workaround i was asking for. Sorry i was not clear though mentioned this several times
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7068
Location: Salford, UK

PostPosted: Mon Feb 01, 2021 10:22 pm    Post subject: Reply with quote

Dan

Using SAVE (or something similar) is not a work around. The designer of %ps/%sh would have stipulated this a requirement.

If I have read it correctly, the documentation is at fault and should have explained this (I can say this because I wrote that part and can take the blame).

Hopefully this issue can now be considered as closed.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2411
Location: South Pole, Antarctica

PostPosted: Mon Feb 01, 2021 10:34 pm    Post subject: Reply with quote

Paul, For the short demo reproducer above it might be considered closed, but the demo was just the ill model for clearly different reason of %ps crash. Because i use SAVE in other code and this does not help. And i can not scale larger code down to small reproducer.

The idea i tried to articulate was to give you an example of crashing %ps which you guys would try to fix without SAVE. There was a hope that this will fix other reasons of crash. Such other reasons of crash i saw in larger code - undefined variables. Could be also other reasons.

When such conflicts appear isn't it possible to deflect the %ps from crashing and complete closing windows more amicably with warning or without but just not crashing? This was another less desirable but possible resolution behind my post


Last edited by DanRRight on Tue Feb 02, 2021 12:50 am; edited 1 time in total
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2240
Location: Yateley, Hants, UK

PostPosted: Tue Feb 02, 2021 12:06 am    Post subject: Reply with quote

I dislike having to use SAVE because it goes against all my early experiences of Fortran where I was told repeatedly that you can't rely on a local variable holding its value after exitting a routine then re-entering it - even when the compiler was such that local variables did keep their values. It was something you just couldn't - or shouldn't - rely on.

The traditional alternative is to keep all those handles and return code variables in COMMON, or if you prefer, use MODULES to make the scope of those variables greater than just the routine where they are used.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7068
Location: Salford, UK

PostPosted: Sat Feb 06, 2021 12:00 pm    Post subject: Reply with quote

A new format %wt has been added to winio@. New DLLs that include this addition are available for users of FTN95 v8.70. Please make a request to me via a personal message.

%wt has no options. It provides a "wait" instruction when the window is being closed with the result that control is not returned to the user until after the closure has been completed.

This could prevent certain failures (for example with %ps or %lv) where ClearWin+ attempts to access user's "control variables" when they no longer exist in their code.

It would be nice if this safety factor could be added without using %wt but it is not possible to predict the resulting possible side effects on existing code that uses the ClearWin+ library.

In the case of Dan's failure, %wt provides a possible alternative to using SAVE (say) on the control variables. Using %wt "fixes" the failure for the sample provided above but the sample may not reveal all that is going wrong.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2411
Location: South Pole, Antarctica

PostPosted: Tue Feb 09, 2021 6:07 am    Post subject: Reply with quote

Thanks, Paul. Just the info for everyone -- the %wt has to be placed right after %ps like this

Code:
        i = winio@('%^`11ps%wt&',ish1, ish2, ish3, ish4, ish5, ish6,&
     &  ish7, ish8, ish9, ish10, ish11,   &
     &  n_CurrSheetSettings, cbupdateSettings)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7068
Location: Salford, UK

PostPosted: Tue Feb 09, 2021 10:19 am    Post subject: Reply with quote

Thanks Dan.

%wt can be placed anywhere within the winio@ sequence that creates the %ps. In other words, not within the %sh child sequences.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Feb 13, 2021 4:24 am    Post subject: Reply with quote

Quote:
New DLLs that include this addition are available for users of FTN95 v8.70. Please make a request to me via a personal message.


Have I missed something, some announcement recently ?
Are the interim 'fixes' not available no longer to everyone via linked modded dlls, etc ... ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group