OutOfBoundsException memoryGetString

Can anyone tell me why I am getting this error? My app was working last night. Saved it, went to bed, started in on it this morning and am now receiving this error before I have made any changes. What’s up?

Xojo doesn’t break on any module, line, container, nothing. I have no way of telling what is going on here.

Unhandled OutOfBoundsException
Message:

Stack:
rbframework.dylib$1895
memoryGetString
MemoryBlock.StringValue%s%oi4i4o
WebSession._HandleRequest%i4%oso<HTTPServer.HTTPRequestContext>
WebApplication.HandleHTTPRequest%%oo<HTTPServer.HTTPRequestContext>
HTTPServer.HTTPRequestThread.Event_Run%%o<HTTPServer.HTTPRequestThread>
rbframework.dylib$1086
_pthread_body

Did you restart browser?
Web apps can how bad behavior if old and new code mix in browser cache.

I repaired my HDD, ran Onyx, cleared browser cache and still get the error. I have been dealing with a usageCount issue in REALstring.cpp(204) since before 2014 (Bug #31927). This has just been an annoyance and has made programming a slow go since I have to stop, start, stop, start, … several times before the web app will run. I don’t think the 2 are related but…

see my comments on your case

Norman - did as you requested

I was able to isolate it down to the Xojo HTML Viewer control. I removed the CSS from within the tags and did a ReplaceAll on the HTML string Chr(13) =

That seemed to have fixed the exception. Funny thing is, the 1-liner CSS hasn’t changed since I began the project a few months ago.

[code] HTML = ReplaceAll(HTML, Chr(13), “
”)

PageCode = “” + CSSStyleSheet + “” + HTML + “”

me.hvPage.LoadPage PageCode[/code]

I get these errors all the time.

It’s a bug in Xojo IMO. A major pain. Xojo’s framework should not throw exception errors like this as we have no way to fix them. Even if there’s an issue with our code, the framework should handle it more gracefully.

Can you please post a link to your case? I would like to read Norman’s comments but I can’t figure out how to have Feedback search for a case number.

just type in the case # in the search bar

Tried that. I put 31927 in the search bar. No results found.

Maybe it’s private? If so could you tell us what you posted there?

It is private and relates specifically to his submitted project and is not generally useful beyond his app

Ah. OK. That makes sense then that I got no results when I searched by the case number. Intuitively that is what I thought would have happened. It just appeared not to work.

OK. I was hoping you had some bits of wisdom you wrote in there that would help the rest of us with this error.

Sorry
I cannot even reproduce the problem Scott’s having so far

Got the error again and can’t shake it without removing the WebHTMLViewer from the Container.

Created feedback case #33420 which is publicly viewable.

Jon, have you found a work around?

What causes the error is passing an empty string or “” to the LoadPage method.

Workaround:

if Len(mHTML) > 0 then hvPage.LoadPage(mHTML) else hvPage.LoadPage(kBlankHTML) end if

Where kBlankHTML = “”

[quote=85413:@Scott Rich]Got the error again and can’t shake it without removing the WebHTMLViewer from the Container.

Created feedback case #33420 which is publicly viewable.

Jon, have you found a work around?[/quote]

Scott,

I get the sometimes error when using the DelayMBS method on the server side to add some delays to some device connect code. I have a bit of an “abnormal” web app in that it is a control interface for some LAN side devices and the server makes a number of connections to these devices and parses them for some data. During that process I sometimes need to add in waits for the device to respond with specific data I am looking for. DelayMBS will sometimes cause this error to be thrown. I just have it caught in an error trap that e-mails me when the error occurs. That’s it. Everything continues to work fine.

It seems like I see DoEvents in some of the Xojo stack in there and it seems like this is what appears to throw the error - anything trying to add a delay in processing.

Now, I’ve gotten around this by actually using DoEvents for my web app. Hey - a web app is really a console app with a web interface. And we all know that DoEvents is not a bad thing in console apps.

Since moving to DoEvents, I have not had an issue at all.

Sorry I can’t help more, but it looks like you might be onto something…

Jon