ANTLR “Cannot launch the debugger. Time-out waiting to connect to the remote parser.” - debugging

One of my ANTLR grammars running in AntlrWorks throws:
“Cannot launch the debugger. Time-out waiting to connect to the remote parser.”
In the past this message usually goes away but this one is persistent. On searching the ANTLR lists (e.g. http://www.antlr.org/pipermail/antlr-interest/2009-June/034659.html) there are hints that the error message is nothing to do with what it seems but could be a grammar error.
Has anyone got tips as to how to "reboot" or find the bugs in this situation?

I've found that the Windows firewall rules can really interfere with the debugger, so make sure you haven't set it to block the Java VM.
Also, try waiting a bit and then choosing the "Debug Remote" option, often the debugger just takes a little while and the main process times out, but the debugger does still come up.

It may or may not relate - but we got rid of the problem as follows:
On a UNIX box it didn't occur. On Windows it did. There were two parser rules that differed by case (e.g. myfoo and myFOO). When they were resolved the error went away.
I updated the ANTLRworks but the error persisted until we "solved" it as above.

Related

VS Codespaces bash shell failed to initiate

I'm using VS codespaces to complete the current CS50X course.
I've been getting on very well with it but have hit a snag where the Terminal doesn't seem to be loading correctly. I think i'm missing a couple of options at the top of the Terminal section - Debug and Port. I'm trying to complete the Finance section of the course which involves connecting to a development server but when i try i get the following erroe message:
{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.4","title":"Not Found","status":404,"traceId":"00-76b8a3e0c4eaccf805373ec05e5ec917-dccabf0efd4cf681-00"}
I've tried to Google what might be going on but i'm very new to programming and don't understand a lot of what i'm reading!!
I did notice that the shell has failed to initiate, but again, i don't really know what that means.
I've tried re-loading the window repeatedly but still get the same situation.
Any ideas would be much appreciated!!

PyCharm has failed to load the environment from '/bin/zsh'

I wrote a program about a month ago, and it worked fine. I haven't touched it since than, until today.
All of a sudden, I get the warning when opening Pycharm: "PyCharm has failed to load the environment from '/bin/zsh'. Integration with tools that rely on environment variables may work incorrectly." I couldn't find a good explanation and solution to this warning, without leaning out of my comfort zone of altering files on my computer.
When running the program I got the error message "Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)". I have read that this error is related to a memory problem or, that a file needs to be closed.
I have cleaned the memory of my mac so far I know how to and all files are closed. The program reads from one file, but this is only one line, which has worked before and I don´t see how this could cause the error. Otherwise, I did write few other scripts in the same project over the last month, but that shouldn't be a cause of a memory issue, right?
Restarting Pycharm and my computer didn´t change anything.
The only other thing I can think of is, that I have updated my mac to Monterey version 12.2.1.
Could that be the cause for this behaviour? Did anyone else have a similar experience after this update?
And is it possible for the error message and Pycharms warning to be related?
I am thankful for any tip, that may help me understand this behaviour.
I was able to fix this issue through the following steps:
Updating PyCharm to the latest version
Within PyCharm going to File -> Invalidate Caches -> Checking all boxes -> Clicking "Invalidate and Restart"
(Previous attempts to Invalidate Caches with only the default boxes checked did not work for me, but checking all the boxes fixed the issue.)

A program caused the program to stop working correctly

I've developed a software using National Instruments LabWindows/CVI and installed the .exe in a Windows 7 32 bit PC with 4GB RAM.
When I run my software, sometimes I get the following error.
"A program caused the program to stop working correctly. Windows will close the program and notify you if a solution is available"
This is very random and sometimes this error never comes.
Can anyone help me to understand this issue please. I've reviewed my software code many times and I am sure that I am not doing anything wrong in the software which causes this error to come up.
Is this anything related to windows and how can I resolve this? Help is much appreciated.
Thanks
Sujith Rajan
I have encountered similar problems several times.
This may happen even with simple programs like a console application used to get input from user and display some data on screen after processing it.
Usually, this is an indication that your computer is unable to provide enough resources to this program or that there is a bug in your code.
It might be random due to the following reasons:
The Processor might already be busy with several demanding tasks and your program needs to be closed due to this. At other times, when it works well, the resources might be available.
Your program might have a certain logical error that appears at runtime only when certain conditions are fulfilled. (such as an erroneous conditional statement)
Your program might have an infinite loop.
Windows suspects your file to be harmful to the system (for some reason).
There are youtube videos that tell you to go set DATA EXECUTION PROTECTION to resolve. This is a red herring. Its also potentially harmful, especially if you are running old dos apps (because you have to for some reason).
If the program throws a unhandled exception , of any sort , you will get this error message.
If you launched it with this code paragraph...
Dim psi As New ProcessStartInfo(pathToTarget)
Dim p As Process = Process.Start(psi)
Dim bIfinished As Boolean = p.WaitForExit(itimeout)
If bIfinished = False Then
p.Kill()
End If
iretVal = p.ExitCode
pathToTarget is the full path to your target exe/bat (TARGET) file
timeout is an integer that represents milliseconds. 2 minutes would be 2*60*1000
bfinished will be true if the program ended by itself. NOTE- this is not the return code. If it failed to finish in (2 minutes in this example) bFinished will be false.
p.ExitCode can be checked to see what the TARGET returned. Typically a 0 is success and anything else is an error code.
This is the message box mentioned by OP, (autoAging happens to be the exe I used to demonstrate this) . It also says 'XYZ has stopped working'. Google needs to know that!
Note that code will continue running in YOUR app so you can do clean up if you like. Clicking or not clicking "Close Program" has no effect on HOST that I have been able to tell.
If you own the code to the TARGET, make sure you handle all errors and return an appropriate code. That way your calling app (HOST) can know how to react.
You also avoid this msgbox.
If you don't own the code to TARGET, you just have to do the best you can. If there is some output you can readily check, do that. Otherwise I'd assume failure and proceed on that assumption.
This message box does consume resources. Although its not a huge issue, enough of them will run your box out of memory.

Visual Studio 2010 debugger locks up until debugged program is killed

So in a C# .NET v4 project in VS2010, I've got a debugging issue. Frequently, if not most of the time, the debugger freezes when you try to use it - typically on exceptions, it's usually OK if you try to manually break.
The only way I've discovered to fix this is to kill the debugged program ([projectname].vshost.exe), which unlocks the IDE and executes all the mouse presses and things that happened in its absence.
The main Windows GUI is not affected. There is minimal CPU load. Waiting does nothing. The output window (full of "Loaded xxx, symbols loaded") is uneventful. I've read about symbol servers deadlocks, or deadlocks in the GUI, but neither of those are the issue here (the symbol servers are disabled).
Anyone have any ideas? This is giving me a big problem, because I can't effectively debug the program.
Unfortunately, this could be any number of things.
Most often, I've had this type of thing happen when the program is caught in an infinite loop... but since yours is breaking on exceptions, maybe you could add some exception handling?
Never did figure this out. Oh well. Limped by with task manager open all summer, but made it through OK.

What is the "Cannot set allocations" error, who emits it and what can I do about it?

We've been plagued for several years by occasional reports from customers about a non-descript error message "Cannot set allocations" that appears on startup of our app. We have never been able to reproduce the problem in our own test environments so far. I have now run out of ideas for attempting to track this down. Here's a collection of observations that have accumulated over time:
Error message text reads "Cannot set allocations" (note absence of punctuation).
The window title simply reads "Error" (or the localized equivalent).
The "Cannot set allocations" text is always in English regardless of OS locale.
I have so far not been able to locate the DLL or EXE containing the message text.
Google is chock full of reports of this error for a variety of different products - but no solutions.
The only unifying aspect between the affected products I could make out so far was that they all appear to come in the form of DLLs that load into third-party processes (such as addins for Visual Studio or Windows Explorer shell extensions).
Our app is actually a shareware COM-addin for MS Outlook, written in Delphi (i.e. native code - no .NET).
The prime suspect in our case is the third-party licensing wrapper that we're using which decrypts and uncompresses our DLL into memory on the fly. Obviously I couldn't simply give an unprotected version of our app to the affected customers to verify this suspicion. Maybe the other vendors that this has been reported against are using similar products.
Debug versions of the protection wrapper supplied to us by the licensing vendor yielded no results: The log files looked exactly the same as from sessions where the error did not occur. Apparently the "inner" DLL gets decrypted and uncompressed all right but for some reason still fails to get loaded by the host process.
By creating an unprotected "loader" DLL we have been able to pinpoint the occurrence of the error somewhere behind the LoadLibrary call that is supposed to load our DLL into memory.
Extensive logging and global exception hooks in our own code (both the unprotected loader and the protected "core"-DLL) yielded no results at all. The error is obviously raised somewhere else.
The problem described in this earlier question of mine was very probably prompted by the same issue. This was before we created the unprotected loader stub.
The error only occurs at about 1-2% of our customers - whereas typically all installations at any affected customer's site are affected the same.
Sometimes the error goes away after we release a new version but often it will come back again after a couple of weeks or months.
Once the error has started to occur on a machine it does so consistently.
The error never occurs while connected to the affected machine via remote access (e.g. VNC, RDP, TeamViewer, etc.) and none of the affected customers are within travel distance from us so all we have to go by is log files and "eye-witness reports".
One customer reported that the error message dialog apparently was non-modal, i.e. he was able to simply move the dialog box to the side and continue working with the application (minus the functionality that our DLL would have provided). Not sure whether this is universally true in all other occurrences, too.
In some cases customers have been able to permanently rid themselves of the error by disabling or uninstalling other addins from other vendors that were sharing the host application with our own product.
The error has so far been observed on Windows XP, Vista and 7.
During the last few weeks we had a surge of reports from Outlook 2003 / Windows 7 users. Could the situation have been made worse by a recent Windows/Office-update?
Does anyone have any experience with this error at all?
Or any more ideas for investigating this?
I have only recently had this happen, which prompted my search and I ended up here. I can tell you that with me for sure it is in windows 7 home premium BUT ONLY WITH IE9 (which I hate by the way) it reduces the user back to the dummy stage and assumes that we have to be repeated flagged about everything.It will keep asking you if you want to disable add ons to speed up load times but usually on things that aren't really the things slowing the browser down in the first place,it is there is too much garbage loading in the first place.But back to the "Cannot set allocations", I for one have never expirianced it in any other browser which is not to say it doesn't happen with them.
This is going to be pure guess-work, but it sounds like maybe your third-party licensing software is trying to load your DLL at a particular location in memory, which - on these failing systems - happens to already be occupied by something else, perhaps a global hook DLL.
If you have a customer who is willing to work with you a bit, it might shed some light on the situation to get a crash dump (e.g., with ADPlus or maybe simpler with Sysinternals' ProcDump) when the error message is showing. That would show what modules are loaded and possibly the callstack (if it is from a message box at the time of the error as opposed to one that is catching an exception after the problem).
I also have experienced the "Cannot set allocations" issue. Royal pain. I had disabled Java, since I did not seem to need it, I used add/remove programs to remove Java from my system. Then I stated to get those errors. I have reinstalled, but disabled Java in IE explorer. Now I do not get the error anymore. Not a programmer, don't know why this happened. Maybe a clue for someone.
Win 7 - 64bit OS IE Explorer 10. Hope this helps someone figure this out. John
I've seen this happen. In my case a global hook dll created a large memory file mapping, perhaps to the memory the licensing dll was counting on.
I see "Cannot set Allocations" when I open google chrome only. Also after that, chrome closes with a msg saying "Whoa chrome has crashed..."
Still no solution :(
Also not a programmer, but it always happens when I open Chrome. It opens second window with error message 'cannot set allocation'. I usually close it and go on my way. if i don't it usually causes a crash. doesnt happen on any other browsers.

Resources