Stackoverflow Exception raising only without Visual Studio [closed] - multithreading

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have a difficult WPF application, which works with PTL, many third-party libraries and network. In developer workstation it works fine (in release mode too), but when I run it in client workstation - I got stackoverflow exception in same input data. Also app crashed always in different places.
So, my questions are:
I know, that its impossible to catch stackoverflow exception by try-catch-finally. But may be exists any workaround to understand which module generate this problem?
What different between client and developer environment, if all third-party libraries are equals?

I know, that its impossible to catch a StackOverflowError exception using try-catch-finally.
It is not impossible. Just highly inadvisable, and it probably won't fix the issue. (The best a handler could do would be to abandon what ever caused the problem and try to continue. But what if the application needed the result that was being computed? Or what if the application tries the same computation again?)
But may be exists any workaround to understand which module generate this problem?
Without knowing the real cause of the problem, there is no good workaround.
How do you find the real cause of the problem? Debug the application!
What different between client and developer environment, if all third-party libraries are equals?
In general it could be any of the following:
Different Java versions
Different OS versions
Containers and/or virtualization
Different networking environments
Different external tools installed
Different file system layouts
Different users or file permissions
Different Java application configs
Different input data / databases.
and probably a few more besides. In short there are potentially lots of things that could be different that could cause different behaviors. You might be able to discount some of these as not relevant, but it is also possible to be wrong about that.
IMO, looking for the differences is the wrong approach. A better idea is to debug your application in the client environment. Read the stacktrace, read the code, attach a debugger to the JVM and set breakpoints, etc to try and find out what is actually happening.

Related

is there any way of trasnfering a application running on one system to other system? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
i want to know is there any way of migrating a application ( say Firefox) from one system to other system ?
if so please let me know ...
example : suppose i have two systems say A ,B . and Firefox is running in A, now i want to transfer that running application (Firefox) to B as it is
im thinking like, we can migrate the our process stable of the application, why people dnt think in that way, and they simple down marking the question if they dont know the answer? its not the way that we should respond to problem that has been asked in our stack community ... any how people who are good at operating system pleas do think in way that is it possible to transfer our process state to other machine so we can get the same image there at other system .. if so please let me know. thanks in advance..
What you want is called process migration, and is not easily possible on Linux in general.
However, if you design your application carefully and use some application checkpointing mechanism, it might be possible (in some very limited way). Perhaps using Berkeley Lab Checkpoint Restart library could help.
Don't expect to migrate processes of applications as complex as Firefox.
Read also about continuation passing style & virtual machines. It is relevant. Reading Queinnec's Lisp in Small Pieces & the famous SICP should also help a lot. See also Continuation-Passing C.
And in practice, you might be able to get process migration for some of your own applications (using few external libraries, or using them "atomically" between checkpoints) if you design your application from the start with process migration in mind.
PS. Feel free to ask me more e.g. by email, by citing this question, explaining the actual application you want to migrate and what you have read and tried. This subject is surprisingly interesting and difficult (you probably could make a PhD on it).

Best way to start audio programming? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I want to start programming a synthesizer. I reckoned that I would need to use the sound card, so I started to google. After a while, discovered many options:
  - WaveOut API - I've heard that this one is outdated, so I scrapped this one.
  - WASAPI - Seemed a little bit too low level for what I wanted.
  - DirectSound, XAudio, XAudio2 - Seem reasonably fine, but I want to have as little latency as possible.
  - Asio - Seemed like exactly what I want!
I did find a couple of tutorials and source code to get me started on audio programming. Sadly, the only one I got to work uses the waveOpen API, which I don't want to use.
Then I found this tutorial, which seemed perfect for my needs.
This tutorial is, suprisingly, the only usable (well, not that usable since I can't get it to work) resource I can find on using ASIO. Thing is, I can't get it to work. When I run the demo I get a 'Application has stopped working'-error, followed by the console output:
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'BlueWave.Interop.Asio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'BlueWave.Interop.Asio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' at BlueWave.Interop.Asio.Test.TestConsole.Main(String[] args)
WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
When I try to compile, I got a whole lot of Rosie errors:
This is after I manually placed msvcr90.dll and msvcd90.dll in C:\Windows\System32 (I couldn't get them to install any other way). Ow yeah, and of course I installed ASIO4ALL before all this.
So, this is not really a question, but I'm merely asking for general advice. I think it shouldn't be THAT hard to get asio working, but at the same time a link to another resource for learning the ASIO API would be great, as well as any other advice. (Maybe it's easier to just go and try to get Xaudio2 working? I don't know...)
Thanks in advance, and sorry if you think my question is a long or boring read!
EDIT: Thanks for the reactions. I have come across the ASIOHost API by TropicalProgrammer. No idea if it's any good, but it looks promising. I'm looking into it currently. There may be better options, but I have to admit that I got my mind set on ASIO currently.
I suggest having a look at Juce which is a dual-licensed audio framework for writing both audio plug-ins and host applications. Quite a few commercial applications have been built using it.
Since your objective is to build a synthesiser, the path of least resistance is to build it as a VST plug-in. JUCE provides a host application that takes care of managing the OS's audio APIs, good documentation and numerous examples. All you will need to do is implement the render-callback for your synth.
As for ASIO, a great many pro-audio applications have been built with it, mainly because of the traditional shortcomings of the normal audio APIs on successive versions of Windows - particularly where latency or high channel-count is concerned. On Windows, ASIO uses dedicated drivers for the audio hardware and bypasses the host operating system's audio stack. I suspect Juce will take care of this for you.
Not a really helpful answer, but I decided to go with XAUDIO2. I wouldn't really say it's easy to use, but at least there are tutorials available (I use this one, but microsoft has a serie available as well).

Print exception stack trace in JavaME, for the Samsung JET

My research shows the general question is an exceptionally popular.
And in the main there is no one solution for all phones using CLDC/MIDP framework.
I have developed an app that works on all the phones I have tested so far (mostly nokia's) but it throws an IOException on the Samsung jet S8003.
Any ideas as to how can possibly obtain a trace on this specific phone?
I can't answer specifically for your platform, but over the years I've found that the best approach to these kinds of problems is to implement some kind of tracing facility in your code so that you can see the code path that led to the exception. See the answers to this SO question for some ideas on how to accomplish this: Logging in J2ME.
The nice thing about this approach is that it makes it a lot easier to debug customer problems when they run your app on a phone model you've never heard of, especially if there's an easy way for them to enable the tracelog and have it sent to you automatically.
After years of frustration I created a tool that does what you want: http://jarrut.sourceforge.net/
It's not as easy to setup as it could be, but it comes with a working example. After you get it working you will no longer do JME stuff without it.

How much time does a developer spend reviewing logs? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
PCI/DSS has a requirement indicating that an application's log should be reviewed AT LEAST daily for security events. Most network/infrastructure professionals can review network device logs but won't be familiar with actual applications. The same can be said for most security professionals.
So, are developers really stepping up to this requirement? If you had to write a job description for a developer whose sole job was to review logs, what would it contain?
Security/severe events should probably be logged separately so that they are noticed quicker. Possibly send them with email or use some other technique so that the appropriate people are automatically notified. No one should have to review application logs to look for security events. As a developer I periodically review production errors. I am working to get support to have access to the errors and I will teach them how to interpret the most common errors but I will still handle the less common errors. Also when I review the prod errors I evaluate the messages of the most common errors to improve them.
So I think development should periodically review prod errors, make sure that important (i.e. security) logs are automatically sent to the appropriate people, and transmission handling of the most common errors to other groups (support infrastructure, security, etc). If someone's sole responsibility was to review logs I wouldn't call them a developer.
I look at logs when I want to diagnose something that I already know has gone wrong (or might have gone wrong).
For other problems, I expect to be notified.
If the system has significant problems, I'd expect whoever is on call to get paged
If there are exceptions being thrown, I'd expect those to be logged, and a summary of them to be easily available, either on a web page or pushed to email
To me "a developer whose sole job was to review logs" is an oxymoron: if you're just reviewing logs, you're not developing, therefore you're not a developer.
I personally don't see developers stepping up to meet this requirement. Most developers are concerned with development work...not something that an expert on the application would deal with.
If I HAD to write a job description for a developer whose sole job was reviewing logs, it would contain something about studying the application architecture and becoming an expert in both the use and implementation of the software.
In my company, we have the requirement that an application needs to run so-and-so-long without giving serious trouble in order to get a release from QA.
Think of it as a post release beta phase.
So as long as we are in this the app is life; but not yet released by QA phase, I am reviewing the logs at least once per day. (Of course we have other ways to get notified on errors, but I learned a lot about my own bad assumptions on how the users would operate the software that way).
I would see this as a system administration task as opposed to one undertaken by a developer. Any issues from the logs would be flagged in an issue tracking system and then distributed to the development team by the development lead/product manager should changes to the codebase be required to resolve the defect/error.

IIS hang state

Any suggestion to detect flaws in VB6 components running under IIS. IIS becomes unstable and after some time enter in a state of hang. The problems occur in the most part only in the production environment. We have many modules running. Probably there are components with bugs and need to identify them.
Thanks in advance.
One thing to watch out for is multi-threading issues. VB6 components often don't play well when accessed by multiple threads.
If the client code is an ASP.NET application consider putting synchlocks around the calls to ensure that they are called sequentially.
Another sure-fire way to fubar IIS is to display a message box or initiate some other sort of user interaction. Get those MsgBox calls outa there.
Other than that... good logging helps. VB6 is pretty opaque when errors arise.
Use Debugging Tools for Windows to analyze a dump of IIS. Tess' blog is one of the best resources to learn to use WinDbg. Although she focuses on .NET debugging, most of the material is applicable to any Win32 process.

Resources