Is the CLR or metro buggy? - microsoft-metro

I am getting the following error when running my metro app:
The runtime has encountered a fatal error. The address of the error
was at 0x6e6b9a68, on thread 0x279c. The error code is 0x80131506.
This error may be a bug in the CLR or in the unsafe or non-verifiable
portions of user code. Common sources of this bug include user
marshaling errors for COM-interop or PInvoke, which may corrupt the
stack.
I have a hard time thinking the CLR is buggy.
The app is pure C#, no C++.
I don't use interop.
What should I be looking at?

If you're building a Metro app, be prepared for this exception to lead to a severe loss of sleep. In the Microsoft forums, there was a thread a while back where we seemed to isolate the problem to occurring when you are binding with custom value converters. Really simple converters are fine but interesting ones will yield this exception at seemingly random times. Good luck.

Every software has bugs. If this problem is reproducible, you should do this: 1) narrow down the problem to a test-case. This will also ensure that the problem is not on your side, and is really in the runtime. 2) search whether there isn't any already posted bug reports or KB articles 3) submit a bug report to Microsoft.
If the crash is reproducible, I am sure Microsoft will try their best to find and fix the bug.

Windows 8 is still in beta. I am not sure "buggy" is a fair adjective for software that hasn't been shipped. To your question - they are probably both buggy at this stage.

Even if your app is pure c#, any call to WinRT API is an interop between c# and c++. The interop layer between them is a responsibility of CLR, and that's why the exception said it could be CLR bug.

Related

Are RecordSet Objects Deprecated In .Net 4.5?

Are RecordSet objects deprecated in the .Net 4.5 Framework? If so, is it possible to include them in a .Net 4.5 Framework project by referencing them?
From my reading, I understand them to be deprecated. I also understand that if your "target" framework is higher than that of the desired reference, the reference cannot be included in your solution (the IDE, e.g. Visual Studio 2013, will not allow the inclusion).
I am looking for a definitive, simple answer as none seem to be available elsewhere (though there are certainly troves of information on the web about RecordSet and DataSet). Again, my question is not how to use RecordSet, but rather whether it is deprecated and - if so - how to include in a .Net 4.5 Framework solution (which I am under the impression is not possible).
If you are able to attach any references, that would be awesome. I am either trying to prove me "wrong" or someone else "wrong".
Here is one of the references I have found that seems to suggest RecordSets aren't really a part of the .Net piece.
There has never been a type named "RecordSet" in the .NET Framework. That name was taken, a COM type that had its hay days in the 1990s. Part of DAO and ADO, COM object models that made it easy to access data. And found its way into plenty of .NET programs, stuck on data providers of the 1990s or injected by code originally written in VB6 or VBA, the most popular programming tools in the 90s.
No, it is alive and well, ADO is not deprecated. DAO got the axe 13 years ago when Jet was removed from the standard distribution. Albeit that it seems to be not quite dead, it is still included with every current Windows version. Microsoft code never dies. COM interop in .NET 4.5, what you use under the covers to consume the ADODB type library, has not changed at all.
There was an ill-fated attempt to make ADO more compatible with 64-bit code, fixing a bug in the type library. Released in Windows 7 SP1, it caused wide-spread dismay and misery so was canceled again. Hopefully you don't have that viral problem.
Otherwise typical of software, it is not like fine wine, it does not age gracefully. Still using Recordset today does not make sense, you'd at least consider uplifting to the System.Data.Oledb namespace. Which is the managed .NET wrapper around ADO.

Method = "OST"?

We have some clients who, upon attempting to submit a form, are recieving the error - "HTTP Status 501 Method OST is not defined in RFC 2068 and is not supported by the Servlet API" being thrown by Apache Tomcat/6.0.29.. Apparently, this error is only being received by users running Firefox on Windows 7.
After a lot of digging, the vast majority of examples of Method = "OST" that I can find are on Chinese language websites.. Like here.. In This discussion (English language) "Quoted Printable Transfer Encoding" was mentioned as the possible cause of a similar problem, but it does not involve Apache Tomcat, or any particular browser/operating system combination.
I have a feeling that this issue is something to do with encoding, but have little experience relating to this.. Has anyone experienced a similar issue, or perhaps have some suggestions as to how I might go about solving it?
Thanks
It may be useful to have a look at the following known and recorded defect in Mozilla Firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=723805
This seems relevant to your problem, and it may shed some light on how you could do things a bit differently to avoid it.

Play not answering HTTP requests

I'm currently exploring similar alternatives to Ruby on Rails, and have been considering Playframework using Scala (cuz I'm not fond of Java).
Problem is, even if the default sample of application works very fine, everytime I try doing actual work with Playframework, it end up with it not answering HTTP requests.
It compiles after the first request, but doesn't answer it.
Then it ignores every other request (not even re-compiling when I changed stuff).
It does kick out an user typing an incorrect request, but it never times you out if the request is correct.
What is this ?
I'm using Playframework 1.2.3 with the Scala module. Is there any way to get a better insight at what's happening ?
So it never times out, isn't it? as if it was compiling forever?
If yes, maybe you have problems with the Scala compiler which is slower than Java compiler and requires more stack. Generally if you don't have enough stack, it should crash with a StackOverflow.
YOu can try to run play with "play run -Xss1024k" for example to increase the stack size.
If you get empty answer, it means the problem is somewhere else like routes or bad object returned from your controller.
Anyway, Play-Scala is still young and in evolution so it's not a reliable solution for an entreprise solution if you're not yet an expert in Scala and don't already know Play IMO. It's already robust and stable but not well documented and as complete as Java version.
Finally, you say you're not found of Java and it's something I can understand but you should really give a try to Play/Java since it's completely different from any other Java stuff. I can say that because I'm an old Java developer and find the language getting a bit outdated in its syntax and basic features. I don't really like Java EE web frameworks in general because they are not really productive and user-friendly. When I found Play more than one year ago, it was like a breath of air for me. You get the best of modern web frameworks and the best of the Java world which are all the robust and approved entreprise tools coming from opensource. I've never been deceived by it since this time.

Call REST Webservice from Blackberry

I am new to Blackberry app development. I need to call REST webservice from blackberry application using JDE 4.7. I searched but not got any solution. Anyone help pls?
sri
You have to make an HttpConnection request and read the data as an InputStream... have a look at this tutorial Calling REST based web services
I appreciate this an old post - but it has been updated so someone is looking at it, so I thought it appropriate to contribute.
I am sorry, but I can not recommend the code supplied the link from another answer called "Calling REST based web services".
I have made a comment explaining this on the site, along the following lines:
"In my opinion this code is flawed because it does not consider the different connection methods, nor does it consider different encodings. More over it does not consider the Event Thread or provide reasonable error checking and logging. I appreciate that this is just a sample, but I think the author has a responsibility to make people who might use this code aware of how it should be used properly. And this code will cause more problems that it solves. Refer to the supported BlackBerry documentation and web sites for better samples."
Sorry, I am not as familiar as I should be of the questions asked on stackoverflow, but questions like this come up regularly on the BBRY forum here:
http://supportforums.blackberry.com/t5/Java-Development/bd-p/java_dev
I recommend that you go on that forum and type network in the Search box on that site and you be presented with a range of tutorials and KB articles that discuss all aspects of networking. In this particular case I would recommend this:
http://supportforums.blackberry.com/t5/Java-Development/What-Is-Network-API-alternative-for-legacy-OS/ta-p/614822
Networking is not trivial on the BlackBerry, do not expect a cut and paste of the code supplied to work for you. Specifically you should be aware of:
a) The various connection methods, the costs associated with each and the impact that using each might have (e.g. transcoders or caching)
b) The Event Thread, how to get off it and back on when processing a response
c) Logging and reporting so that you can investigate problems when they occur (and they will).
Personally, given that all OS 4.7 devices can be upgraded to OS 5.0 and should be, since OS 5.0 is better, I would forget supporting OS 4.7. Instead look at OS 5.0 and above support and use ConnectionFactory.

Executing prolog code on an iPhone

I currently have the need to execute prolog code in an application I am making. I am aware that Apple probably never would allow something like this in the App Store, but that is not the intention either. This is more a private project that will never reach the App Store.
Purpose
In this case prolog is used to describe an object (like for example a telephone) and its properties. The object will be drawn with OpenGL using coordinates specified in the prolog script. The reason for using prolog is that I need the ability to query the program about some of the features this object has, and prolog eases this a lot. Bottom line: I "need" to query a prolog script from my app.
Possible solutions
Embed an already existing implementation written in C. I am unsure if this will even work.
Execute the prolog code on another machine and use the network to query prolog.
It seems that it is possible to run some sort Ruby VM inside the app (shinycocos uses this as far as I understand), could this be used to run one of the Ruby Prolog implementations?
Find some alternative to Prolog. This needs to give me some of the same possibilities I get with prolog.
Sadly, google gives me close to no results at all, so I have a feeling that I might be quite alone on this project. If anyone have any experience or clue at all, I would be very thankful.
Having faced similar difficulties calling prolog code, albeit in a different situation, I'd recommend checking out the castor c++ library. This allows you to write logic paradigm code in native c++ without needing to extend the language at all. As castor is a header only library it is easy to compile wherever c++ is available.
Castor website: http://www.mpprogramming.com/cpp/default.aspx
Half a year later, I would just like to provide some insight on this. I ended up writing a server with an interface to prolog in Java, accepting prolog calls through TCP. It works almost exactly like the live prolog interpreter SWI-prolog (among others) provides, and mostly works quite well. However, it is far from an optimal solution, as you can't call functions from inside prolog. You lose the possibility of having two-way communication.
If I were to start all over again, I would certainly have tried harder to compile one of the pure C implementations for iOS. I gave it a quick go, but my lack of experience stopped me from even removing all of the errors I got. Judging by the fact that you cannot have prolog running as a background process on a unmodified version of iOS as well, some major rewriting would have to be done. Because of this, one might just have to write a new implementation (perhaps inspired by some of the more lightweight ones out there) from scratch to get the perfect solution.
You can download SWI-Prolog's source code and compile it with XCODE for iOS platform. I've never done that, but it's certainly technically possible.
Once you do that, there are a lot of examples on how to run prolog code from C/C++, hence, you will be able to run prolog from Objective-C.
FYI, you can quite easily bi-directionally make calls between Java and SWI-Prolog if you use JPL:
http://www.swi-prolog.org/packages/jpl/
It is also fully re-entrant, so you can instantiate prolog code from java, which in turn instantiates java code etc...
I did this for a number of commercial projects a few years ago when I was required to connect a Prolog based Reasoning Engine to a lot of Java code.
It does use JNI (the Java Native Interface), so you need to be careful about how you compile and link to the native api. Though if you compile it appropriately for each platform you can make it work cross platform. I had it working on OS-X, Windows, Linux & Solaris.
I do not know if this has been tried but there is the possibility to use the combination of NodeJS for Mobile Apps & TauProlog:
https://code.janeasystems.com/nodejs-mobile
https://github.com/JaneaSystems/nodejs-mobile
and
http://tau-prolog.org/