stack corruption with form_alert

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

stack corruption with form_alert

Postby exxos » Fri Jan 08, 2016 1:51 pm

I basically have something simple like this..

Code: Select all

SUB AAA
STATIC junk
junk=form_alert(1,"[2][ Running all tests will | benchmark your machine and | save  the results as | your default values. | Do you wish to continue ?][ NO | YES ]")

open "debugFA.txt" for output as #1
print #1,junk
close #1
END SUB


My problem is, while the form_alert shows the box, and the file returns a number relating to what button was clicked (YES/NO) then it just goes crazy and my program crashes with "stack overflow". But I think that isn't the issues exactly as the error line numbers are random, like mostly if my code is 2,000 lines long, it will report a error at line 2,200, or even report errors on blank lines in my program.

I have increased the stack sizes, but had no effect. What seems to be happening is when the form_alert is called, it seems to corrupt the stack somehow. My code never returns from that subroutine and just seems to run random stuff after that which then leads to the stack overflow and then crashes.

If I REM out that form_alert line, then everything works fine. No crashes, no problems. But as soon as I put back in form_alert, it just goes mental. It is like the "END SUB" is being ignored and the program just carrys on running what ever code comes next and leads to the crash. Though it isn't the sub routine calls or returns as they work fine without form_alert.

So my question is, has anyone any idea why/how that could even happen ??
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: stack corruption with form_alert

Postby exxos » Fri Jan 08, 2016 2:30 pm

Well this is interesting..

Code: Select all


junk=form_alert(1,"[2][ Running all tests will | benchmark your machine and | save  the results as | your default values. | Do you wish to continue ? ][ NO | YES ]")

junk=form_alert(1,"[2][ Running all tests will | benchmark your machine and | save  the results as | your default values. ][ NO | YES ]")



First line fails, second line does not. Only difference is the length of the message in total :?

According to http://toshyp.atari.org/en/00800b.html#form_alert

The component lines describes the individual text lines that are to appear in the alert box. There can be up to five text lines, each with a maximum of 30 characters, which are separated from each other by a '|' character.

AFAIK I've not violated that with my first code line, unless its classing "5 lines" inclusive of the buttons, which actually makes the text 4 lines long not 5 ?!
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: stack corruption with form_alert

Postby Mikefulton » Wed Jan 13, 2016 12:17 am

Silly question... what BASIC is this? Still HISOFT?

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: stack corruption with form_alert

Postby exxos » Wed Jan 13, 2016 9:33 am

Mikefulton wrote:Silly question... what BASIC is this? Still HISOFT?

Yep.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator


Social Media

     

Return to “Other BASIC”

Who is online

Users browsing this forum: No registered users and 2 guests