heisenbug

why would an application acts differently after VS debugger is attached?

There is a desktop application written in c# trying to manage a socket connection and failing but being successful after same application is attached to visual studio. how can it be debugged? ...

Hardest javascript debugging problem ever

We have an ASP.NET application and when running on client site they often get null reference Javascript errors. As with all these errors the information IE6 displays is less than helpful. But the problem is as soon as I install IE script debugger and try and debug a bit more the error becomes non-reproducible.When script debugger is not ...

What is some advice for debugging really hard to track down bugs?

Most bugs are fairly simple, easily reproducible, and easy to debug. What do you do when you run into ones that are hard or impossible to repro under debugger, i.e.one of these? Our app is a multi-threaded app that is furthermore complicated by the fact that it communicates with multiple clients via remoting and sometimes there're bugs...

Does attaching to a process make it behave differently?

While I am aware of the differences between debug and release builds, I am curious if attaching the debugger to a process (built release or debug) changes that processes behaviour? For reference, I'm developing on HP 11.31 Itanium but still am curious for the general case. ...

What to do, if debug behaviour differs from normal execution?

I have a problem with debugging sessions. My program executes very well in a debug session but if I start a normal run, it behaves completely different. The problem is, that I cannot say, why it acts different. One possible reason is the slower execution time because you alway have to press F6 or so. I tried to insert Thread.sleep(1000)...

How to avoid failing test during Debug?

I have a test that passes if I am not debugging the test: Snippet: using (var reader = dbUtility.ExecuteReader(cmd)) { if (reader != null) { while (reader.Read()) { In my Arrange step, I set up a stub that will return one row's worth of information. The part that breaks during debug only is the reader.Read() c...

A random cross-thread operation exception for Winforms multithreaded UI operation

For some reason, this safe-looking method raises a classic exception. Cross-thread operation not valid: Control 'statusLabel' accessed from a thread other than the thread it was created on. This code obviously should call an anonymous method through Invoke when invoke is required. But the exception occurs every once in a whil...

Bizarre bug in C

So I have a C program. And I don't think I can post any code snippets due to complexity issues. But I'll outline my error, because it's weird, and see if anyone can give any insights. I set a pointer to NULL. If, in the same function where I set the pointer to NULL, I printf() the pointer (with "%p"), I get 0x0, and when I print that s...

Error activating more than one site's Publishing (Site) Feature concurrently

We have a custom self-service SharePoint solution that allows people to come to a provisioning SharePoint app, follow a 3-page wizard, answer a bunch of questions, and based on those questions, calls one of several web services around the world which in turn in the local farm creates a new site collection based on one of 3 site types (Te...

When program run correctly while debugging but otherwise not?

Possible Duplicate: Common reasons for bugs in release version not present in debug mode Sometimes I encouter such strange situations that the program run incorrectly while running normally and it will pop-up the termination dialog,but correctly while debugging.This do make me frustrated when I want to use debugger to find the...

C function changes behaviour depending on whether it has a call to printf in it

I have a function that processes some data and finds the threshold that classifies the data with the lowest error. It looks like this: void find_threshold(FeatureVal* fvals, sampledata* data, unsigned int num_samples, double* thresh, double* err, int* pol) { //code to calculate minThresh, minErr, minPol omitted printf("minThresh...

stdio's remove() not always deleting on time.

For a particular piece of homework, I'm implementing a basic data storage system using sequential files under standard C, which cannot load more than 1 record at a time. So, the basic part is creating a new file where the results of whatever we do with the original records are stored. The previous file's renamed, and a new one under the ...

Application settings do not allways save

I have a bit of a Heisenbug. I have a list of what was recently searched for sometimes it will save the history some times it does not. When I attach the debugger and step through StartFind() it works every time. public Form1() { oldClinicsBindingSource.DataSource = ContractFlowTool.Properties.Settings.Default.RecentClinics; } priva...

Mysterious heisenbug?

So I'm making a snake game with teleports and the usual mice. I had a loop running like this: while(snake.alive() && miceEaten < micePerLevel) { displayInfo(lives, score, level, micePerLevel - miceEaten); //some code if(miceEaten()) { //update score... } //more stuff... } The problem with the above code...

Why is Chrome dying on this page?

If I open this page in Chrome 6.0.472.62 or .63 for OSX, the Javascript interpreter hangs. If I open the developer console to debug the problem and then open the page, the page runs fine. Running with the developer console results in no logging statements, so I'm fairly sure that it's not a problem with console.log not being defined. I'v...

Unusual code bugs

I've been reading Wikipedia articles about unusual bugs. I'm particularly interested in Schrödinbugs and Heisenbugs: Schrödinbug A schrödinbug is a bug that manifests only after someone reading source code or using the program in an unusual way notices that it never should have worked in the first place, at which point the program p...

How do I track down a Heisenbug in some Python code?

Quick background: we have a large source base written in Python. It is a compiler for a domain specific language, and internally everything is represented as directed graphs. These digraphs are built up from sets, and so we use the builtin set type in Python. The problem is that we didn't originally realise that Python actively uses the...

What could be causing a deadlock or otherwise causing this concurrency test to inconsistently fail?

I've been fiddling around with CHESS, which seems like an incredibly useful tool. However, ironically, I seem to be dealing with a Heisenbug in one of my test methods. The results reported by CHESS when I run this test are unpredictable: Sometimes the test will pass Sometimes the test will fail, with no further description (simply: "Te...

Reading data from memcache sometimes fails

I've written a gevent-based program that allows its web clients to quickly exchange messages through it (so it works like a hub). Since I only support polling mechanism at this moment, I've written it to store messages that need to be delivered to a specific client in its 'inbox' at the server side. While the client list is stored in My...

Java: examples of very hard to track-down bugs

Hello All, Related to this question, http://stackoverflow.com/questions/570353/hardest-types-of-bugs-to-track, does anyone have any examples of real-world code that introduces extremely hard-to-identify bugs, e.g a Heisenbug? If you wanted to deliberately introduce a difficult bug, what would you do? ...