View previous topic :: View next topic |
Author |
Message |
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sun Oct 27, 2019 2:54 pm Post subject: Crash using HELP facilities |
|
|
I have run into an intermittent error. I am running /CHECKMATE as I test the interfaces and coding.
I have incorporated HELP into my program, and am getting a crash message about the application running out of memory. It is occurring only when I click on my HELP menu item, and usually the third or fourth item clicked. That said, as a test, I opened HELP for 10 items, and didn't get a crash - thus the intermittent nature.
Looking at the task manager at the time of the crash, it indicates the program is consuming 864 MB. In my link step, my link options for memory are:
Quote: | /heap:12000000,6000000 /stack:9600000,4800000 |
Since it is only when I invoke HELP that the error is occurring, only a couple of options come to mind. One is that when HELP is decompressing the file, it might attempt allocate a great deal of memory, and the error occurs. Or, as I am building the windows, I have a temporary on the stack that I have included in a winio@() statement that shouldn't be there. (I have to watch out for that one!). I have known this to sometimes cause an issue with concurrent windows getting hammered at run-time.
Any insights one may have will be most appreciated. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sun Oct 27, 2019 5:07 pm Post subject: |
|
|
One other piece of information.
There seems to be an issue with the keyword sent to the HELP facility. For example, one of my keywords is "INDIVIDUAL LOG STRIP". This is a character constant supplied as an argument to the routine that builds the winio@() command to create the menu entry.
However, the string being processed by the HELP facility is:
Quote: | INDIVIDUAL LOG STRIPOption Selected=Q/st/sc=range= |
The "extra" stuff are character constants used elsewhere in the program.
Some of the keywords work fine; this one did not.
Perhaps this kind of problem might be the cause of the crashes? |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Sun Oct 27, 2019 5:57 pm Post subject: |
|
|
The text of the crash is preceded with a big red "X" in a circle. Text reads:
Quote: | There is not enough memory available for this task. Quit one or more programs to increase available memory, then try again. |
The Task Manager shows I'm using only 32% of my 32gb.
I think this is an OS message, not ClearWin+. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2818 Location: South Pole, Antarctica
|
Posted: Mon Oct 28, 2019 3:33 am Post subject: |
|
|
Bill,
1) Are you using 32bit FTN95 not 64bit one?
2) Are you using mixed language programming? |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Oct 28, 2019 5:19 am Post subject: |
|
|
Dan,
1. Yes, 32-bit.
2. Yes. Coordinate transformation/conversion, report generation (PDF creation) All are compiled using SCC.
Unasked:
a. Same problems occur with /CHECKMATE and /RELEASE.
b. Using /stack and /heap in the SLINK step can cause "odd behaviors". Thought it might be an issue.....
Insights? |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2818 Location: South Pole, Antarctica
|
Posted: Mon Oct 28, 2019 5:44 am Post subject: |
|
|
1) if you started playing game with the devil (stack) and his wife (heap) you are done. Just dump effing 32bs forever. Use 32 just temporally for debugging unknown for 64bit compiler bug or if SDBG64 shows wrong line.
2) never use two compilers in the same program |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Oct 28, 2019 9:13 am Post subject: |
|
|
Quote: | I have incorporated HELP into my program |
Can you expand on this statement?
The immediate ClearWin+ options are to use %ht or %wb. An alternative is to create a compiled html file (like ftn95.chm) and access it from your program. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Oct 28, 2019 3:40 pm Post subject: |
|
|
Paul, sorry I was not clear.
I have both the %th as well as the callback form Quote: | i.e. winio@('%mn[Help[Help]]','HELP_LOOKUP',HELP_FILE,TOKEN) |
I use HelpScribble to create the CHM file. After the compile of the help file, there are no errors listed.
The crash I get does not invoke the Salford traceback, either in /CHECKMATE or /RELEASE.
There are other symptoms that can occur when the help file is finally opened. But one step at a time! |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Oct 28, 2019 3:43 pm Post subject: |
|
|
All the problems are using the compiled .CHM file. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Mon Oct 28, 2019 4:52 pm Post subject: |
|
|
Is it possible to create a sample program and put a sample chm file on DropBox? |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Oct 28, 2019 5:15 pm Post subject: |
|
|
I'll see if I can get it to happen with a sample. When I was playing around to understand how it all worked, I did that, but only used a very small, extremely simple CHM file.
That said, will work on it and post the links here. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Oct 28, 2019 5:49 pm Post subject: |
|
|
I have a sample prepared. It does not exhibit all the symptoms I've seen, but it does show some of the most puzzling.
The link to DropBox is: https://www.dropbox.com/s/mpyrw85wzdqpeik/HTMLHELPCHM.zip?dl=0
I have included the entire Plato project file as well. In the small program, I've included some additional comments about the keyword lookup and what the CHM file has for matches.
There are 5 menu callbacks.
help1 will cause a dialog to be displayed that there are multiple topics available and ask that you choose one for display. This locks up, and I have to use the task manager to kill the program.
help2 will show bring up the help file, but the Index box will show the word "verify" a bunch of spaces and an undefined character string.
help3 will show "export verify " and the character string.
help4 will show "integrity export verify " and the character string.
help5 will display the CHM file from its beginning.
The CHM file is still in process of being edited and built, but does compile with no errors from its source. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Oct 29, 2019 5:17 pm Post subject: |
|
|
In this context the keyword strings must be null terminated. For example in your program...
Also strings containing spaces must be within quotes. For example in your program...
Code: | '"Catalog Search File"'//char(0) |
According to the Microsoft documentation, a list of keyworks may be used provided they are separated by semi-colons. |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Tue Oct 29, 2019 6:42 pm Post subject: |
|
|
Paul, this is awesome. I had stumbled onto the null-termination when I saw the multiple items problem, but was unaware of the quoting of a string with spaces.
One question: If the appending of the char(0) is done in a function/sub-routine, when does this "bind"? Stated another way, does this new string need to remain in statically allocated memory (not on the stack)?
I'm still puzzled by the "HELP_CONTENTS" lock-up.
More TBA, yes? |
|
Back to top |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Tue Oct 29, 2019 7:16 pm Post subject: |
|
|
Well, some success. I walked down through the menu selections one at a time, and here are the results.
help 1: Using double quotes shows (in the Index field) the string enclosed in double-quotes.
help2: Index field tab still shows the first selection, the Search tab shows the word export (my last manual search).
help3: Index field tab still shows the first selection, the Search tab shows the word export.
help4: Index tab shows the word integrity, and the index item installation is selected.
help 5: Goes to the Content tab and selects the first entry.
While the help file was open, I tried to do a Search using the double quoted term (without the double quotes). It found multiple topics as I expected.
In my application, however, the results after making the double-quote change are still not useful. No matter what I do, the display of the help file locks up, and the task has to be killed.
I am letting the stack and heap default during the link step. |
|
Back to top |
|
|
|