Application popup error


Recommended Posts

It's always the way, everything works fine at the office, then out in the field, crash.

My program runs ok for awhile, varies anywhere from 1min to 30min, then get a windows error, and have to close the program. Following details are from windows System log,

Error 26, Application Popup

Application popup: DAQFactory - application.ctl:DAQFactory.exe - Application Error: The instruction at 0x71daa354 referenced memory at 0x000000a0. The memory could not be read.

Click on OK to terminate program

Log Name: System

Source: Application Popup

Event ID: 26

Level: Information


Provider - Application Popup

EventID - 26, Qualifiers 16384

Level 4

Keywords 0x80000000000000

Channel - System

OS is Windows Embedded Standard 7, running on an Atom machine (FitPC2i), 1G ram, 30GB SSD.

I have liberal error handling within the program, which I have included, but have not been able to find the source of the error. I am onsite for a few more days and would appreciate any help, suggestions you can give.




Link to comment
Share on other sites

A few general comments first that I'm mentioning as I'm looking through your program:

1) you should have your two input channels on the same timing/offset since they are on the same comm port. Having them separated doesn't achieve much that wouldn't be handled better in a sequence

2) you use the CommPort array to hold your ports. Consider using a multidimensional array instead of a single dimensional array, where column 0 is your radio port and 1 is your comm_port. I'd still use the constants in the array, its just clearer to use a multidimensional array.

Actually that's about it, and they are pretty minor. You have some nice clean code. So, possible crash points:

1) what release of DF are you running? Older versions had an issue with running out of system handles if you constantly re-initialized an Ethernet port.

2) if you tested in the office on a regular version of Windows, but Windows Embedded is causing a crash, there is probably an issue with the OS, probably a missing driver or similar

3) how long does it take before it crashes? Is it completely random? Try disabling features and see if you can isolate what code is causing the crash. Also consider adding logging code in your loops so you can trace what is causing the crash

Link to comment
Share on other sites


Thanks for the positive comments. I tried to let go of ego a long time ago, so any (constructive) feedback is always greatly appreciated, but must admit i sat up a little straighter after reading your reply.

I'm using latest version, and have tried to verify if it's a Windows difference. Unfortunately it's completely random so haven't been able to track it down. Only clue so far is that when the remote TCP devices are not connected the fault dissappears. This doesn't realy help since the program continues to poll the devices, and I'm not using any 3rd party dll's that might behave differently with devices connected or not. Will keep trying to reliably replicate


Link to comment
Share on other sites

  • 1 month later...

Have found something,

I have data from TCP devices coming into a string buffer that is processed and messages removed as they are processed. For this I use Delete(strBuffer,Index, NumChars).

Since the messages come in async, and a valid message might be anywhere in the buffer, I have to delete only the message that has been processed and leave the rest of the buffer. During testing I found that if the num chars is > buffer then Delete crashes the system and causes Windows popup error.

To confirm I created new doc with only following

while (1)

strBuffer += "Test" + DoubleToStr(loopcnt)


strBuffer = Delete(strBuffer,0,20)

loopcnt += 1


Is Delete supposed to be safe from this?

Regardless it's not good practice and I will have to look at preventing the occurence.


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.