BBC BASIC
« BBCSDL error 192 on Windows »

Welcome Guest. Please Login or Register.
Jan 20th, 2018, 4:17pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: BBCSDL error 192 on Windows  (Read 1020 times)
mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx BBCSDL error 192 on Windows
« Thread started on: Feb 22nd, 2017, 4:11pm »

I have been using BBCSDL v0.16a on Windows for development, and I have seen a number of occasions an Internal Error 192 reported, followed by Too many open files, and I have to stop and restart the SDLIDE.

This seems to happen when it has been left idle for a while, and I *think* I have closed files when finished with them.

Is 192 == Too many open files?
If so, I will have to re-check my code more carefully!

ps Why is there no Windows sub-forum under Development?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #1 on: Feb 22nd, 2017, 8:08pm »

on Feb 22nd, 2017, 4:11pm, mavison wrote:
Is 192 == Too many open files?

Yes. You can find a list of error codes in the BB4W documentation; with perhaps a very few exceptions they are the same in BBCSDL.

If the error is being reported by SDLIDE, rather than your own BASIC program, then it would suggest it is failing to close a file when it should. I certainly can't rule out a bug of that kind, although I've never seen it happen here.

Quote:
ps Why is there no Windows sub-forum under Development?

The Windows edition of BBCSDL is flaky compared with the other platforms. For example on this laptop if I close and open the lid whilst BBCSDL is running it often crashes and has to be killed in Task Manager. I put this down to SDL itself being little used on Windows and therefore less effort being put by its developers into killing bugs.

In addition the compatibility between the Windows edition and the others is comparatively poor. For example Windows expects (or at least prefers) backslashes rather than forward-slashes in file paths; filenames are not case-sensitive whilst they are on the other platforms (except maybe Mac OS?); the OS routines available using SYS are different etc. etc.

What this rambling description is leading to is that - if you have a choice, which I know many people won't - Windows is not the best platform for developing BBCSDL programs. In addition - for obvious reasons - I don't want to give the impression that BBCSDL is a free alternative to BB4W!

So all in all I decided not to create a Windows section. Possibly it wasn't a sensible decision - many of my decisions these days don't withstand too much scrutiny - but there it is.

Richard.
« Last Edit: Feb 22nd, 2017, 8:40pm by Richard Russell » User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: BBCSDL error 192 on Windows
« Reply #2 on: Feb 22nd, 2017, 9:26pm »

Quote:
If the error is being reported by SDLIDE, rather than your own BASIC program, then it would suggest it is failing to close a file when it should.

The -192 is shown in a small window with an OK button. The 'Too many open files' message is shown in the BBCSDL window somewhere down the left of the program area.

So it would seem to me to be a problem with SDLIDE.
Is there any way I can list the files it has open?
I do have a main program plus 9 libraries, and tend to load several of them in succession into SDLIDE, or have several instances running at the same time (when the error affects all of them).
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #3 on: Feb 23rd, 2017, 08:33am »

on Feb 22nd, 2017, 9:26pm, mavison wrote:
or have several instances running at the same time (when the error affects all of them).

I'm confused by your description. When SDLIDE runs a BASIC program, that program is run in a separate process; it runs independently of SDLIDE. After all, you can close SDLIDE completely and your BASIC program keeps running!

It's not like BB4W, in which a BASIC program is run 'in process'; in that case a crashed BASIC program can (and usually will) bring down the IDE as well.

Therefore an error in SDLIDE cannot "affect" a running BASIC program, and neither can an error in a running program affect SDLIDE (always assuming you are not using the Debug or Profile options of course).

So when the error occurs is there a BASIC program running, and if so is the error being reported by SDLIDE or by your program?

Richard.
User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: BBCSDL error 192 on Windows
« Reply #4 on: Feb 23rd, 2017, 09:07am »

I do not think it is my program giving the error. From what I remember the small error box does not include the program name - I will check when it next happens - but the text 'Too many open files' certainly appears in the SDLIDE window. It is the SDLIDE window(s) that I have to close & re-start to resume normal operation.
User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: BBCSDL error 192 on Windows
« Reply #5 on: Feb 23rd, 2017, 11:42am »

I have just returned to my PC, having left it for about 30 minutes with 2 SDLIDE running (but doing nothing) ... and there are now two error boxes, although one was on top of the other.

The 'title' bars just say 'Line 0'.
The messages say 'Internal error 192'.
The buttons say 'OK'

When OK clicked, messages appear in both the SDLIDE windows, nearly at the top of the big white area, at the very left margin of the window (ie over the gray border), saying 'Too many open files' with a > underneath - obviously an immediate mode prompt. PRINT "xxx" works, but no buttons except Close works.

Note this is with v0.16a so is not quite the latest version.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #6 on: Feb 23rd, 2017, 4:40pm »

on Feb 23rd, 2017, 09:07am, mavison wrote:
It is the SDLIDE window(s) that I have to close & re-start to resume normal operation.

This may be reading too much into your comment, but the reference to "SDLIDE window(s)" prompts me to point out that SDLIDE is most definitely not compatible with having more than one instance running, so if you are ever tempted to start a second instance of SDLIDE, don't!

Hopefully you will be successful in tracing the fault in SDLIDE, if that turns out to be the explanation for the error 192. I will be happy to incorporate any required changes in the distribution version.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #7 on: Feb 23rd, 2017, 4:45pm »

on Feb 23rd, 2017, 11:42am, mavison wrote:
I have just returned to my PC, having left it for about 30 minutes with 2 SDLIDE running (but doing nothing)

Just to reiterate, SDLIDE is not compatible with having two instances running concurrently. I would not be in the least surprised if an error were to result from doing that. I wonder what would cause you to want to run two copies.

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #8 on: Feb 23rd, 2017, 5:16pm »

on Feb 23rd, 2017, 2:41pm, michael wrote:
Are you using the version of SDL provided by Google for android?

I don't understand the question. This thread is about the Windows edition of BBCSDL, not the Android edition. And what do you mean by "the version of SDL provided by Google"? Provided by Google how and where?

Richard.
User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: BBCSDL error 192 on Windows
« Reply #9 on: Feb 23rd, 2017, 5:47pm »

Quote:
I wonder what would cause you to want to run two copies.

Very simple. I have an application which consists of a main program and 9 libaries which are INSTALLed. During initial development I frequently want to look at or even edit more than one source at the same time.

I have never seen any indication that more than one copy should not be run, so I have run several copies rather than frequently switching the source member in one instance. I would have expected that if only one instance can be run, a second one would fail with a suitable message.

What causes the problems when more than one is run?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #10 on: Feb 23rd, 2017, 7:22pm »

on Feb 23rd, 2017, 5:47pm, mavison wrote:
What causes the problems when more than one is run?

Although I confidently stated that running multiple instances would cause problems, that was not based on any detailed knowledge of the code. Rather, it was because it never occurred to me that doing so might be useful so it won't have been allowed for in the design.

The sort of thing that might be responsible is creating temporary files. If two copies of the program are running, and both attempt to create a file with same name, only one will succeed. Or if both succeed in creating the file, only one may succeed in later deleting it.

If the problem is indeed related to the creation of temporary files, that could fit with the reporting of a 'too many files' error. But sadly this is really the blind leading the blind - your guess is as good as mine.

As with so many bugs, finding and fixing it is likely to depend on being able to reproduce it 'on demand'. A fault which happens erratically (and by the sound of it only when you're not looking!) is always going to be a real pain to debug.

Richard.

User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #11 on: Feb 23rd, 2017, 10:23pm »

on Feb 23rd, 2017, 11:42am, mavison wrote:
The 'title' bars just say 'Line 0'.

Stating the obvious, you should add line numbers so the title bar actually provides useful information when the program fails!

Richard.
User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: BBCSDL error 192 on Windows
« Reply #12 on: Feb 23rd, 2017, 10:47pm »

Quote:
you should add line numbers

I could not agree more! And all my programs do have line numbers.

However, SDLIDE does not!
... but my copy here now has.
I will report back if it shows anything! smiley
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: BBCSDL error 192 on Windows
« Reply #13 on: Feb 24th, 2017, 07:21am »

on Feb 23rd, 2017, 10:47pm, mavison wrote:
However, SDLIDE does not!

No, of course not. Deployed programs should never have line numbers, they are an anachronism and only have value, occasionally, for debugging.

My suggestion, if I wasn't clear, was that you should temporarily add line numbers to SDLIDE in order to assist with locating an intermittent fault.

Richard.
User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: BBCSDL error 192 on Windows
« Reply #14 on: Feb 24th, 2017, 08:50am »

on Feb 24th, 2017, 07:21am, Richard Russell wrote:
Deployed programs should never have line numbers, they are an anachronism and only have value, occasionally, for debugging.

Sorry, I have to disagree with you. I accept that any programs I release to others could (or even will) still have bugs, so if a problem is found I want as much information as possible from the user to help me resolve it.

Quote:
My suggestion, if I wasn't clear, was that you should temporarily add line numbers to SDLIDE in order to assist with locating an intermittent fault.

No, it was not clear ... but I think it only supports my case!

Martin
« Last Edit: Feb 24th, 2017, 08:51am by mavison » User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls