[DUG] app terminating abruptly
Ross Levis
ross at stationplaylist.com
Mon Nov 28 16:48:56 NZDT 2005
I may have found the problem. I had to add a whole lot of text file
output debugging to see where the program was terminating. It took a
couple of days but I eventually tracked it down to one procedure. I'm
not convinced yet that it's fixed since as far as I can see the problem
shouldn't have caused an execution or error, let alone instant
termination, but the data returned could in rare cases be accessing old
data.
It is using an array pointer buffer. For example...
TBuffer[0..0] of char;
PBuffer := ^TBuffer;
GetMem(PBuffer,256);
I then ask for 256 bytes of data from the DLL, and generally it will
return exactly 256, but in some rare cases it will return less than
that. One part of the code was assuming it was always 256 bytes and
accessing data up to PBuffer[255]. This obviously should not cause an
execution problem, but somehow it seems to have resolved it since it's
been working for 36 hours now and previously it had not gone for longer
than 12.
Regards,
Ross.
----- Original Message -----
From: "Todd Martin" <toddm at kol.co.nz>
To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
Sent: Monday, November 28, 2005 11:32 AM
Subject: Re: [DUG] app terminating abruptly
It sounds like you need to put some assertions into your code, where the
DLL
routine is being called, to check that all input/output parameters are
valid.
Todd.
----- Original Message -----
From: "Ross Levis" <ross at stationplaylist.com>
To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
Sent: Friday, November 25, 2005 5:38 PM
Subject: Re: [DUG] app terminating abruptly
> I've only had the "too many exceptions" message once. I've have had
> MadExcept removed and either the app terminates with no message as
> usual, or 2 or 3 times now I've received an EInvalidOp "Invalid
> floating
> point operation". The address of this message is inside a 3rd party
> DLL
> which should not have any bugs in it.
>
> It's beginning to worry me that I may not be able to track this down.
>
> I'll have a further look at the threads.
>
> Thanks,
> Ross.
>
> ----- Original Message -----
> From: "Kyley Harris" <kyleyharris at gmail.com>
> To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
> Sent: Friday, November 25, 2005 5:10 PM
> Subject: Re: [DUG] app terminating abruptly
>
>
> Back to the basic issue. Forget what is causing an exception and look
> at the fact that you are getting too many exceptions. That means that
> your exception handling code, is actually causeing an exception, that
> is being trapped and causeing another exception. and so on. Take out
> your MadExcept, and you will probably take out that bug, then you will
> find the original exception causeing a problem.
>
> Guessing, but probably a threading issue.
>
>
>
> On 11/25/05, Ross Levis <ross at stationplaylist.com> wrote:
>> I have developed an audio player which works fine for several hours
>> and
>> then will permaturely terminate. It is terminating instantly without
>> shutting down correctly, leaving a system tray icon visible.
>>
>> It appears to happen when the CPU goes to 100% for a few seconds at
>> each
>> change of track, This is due to the fact that it's only a 950Mhz AMD
>> Duron and it's encoding an internet radio stream and running a
>> compressor/limiter at the same time. It usually sits at 50 to 60%
>> most
>> of the time but there are 2 or 3 threads executed with tplower
>> priorities at a change of track to update various things. The CPU
>> goes
>> to 100% for a few seconds but this works fine most of the time.
>> Suddenly after several hours it will terminate without any exceptions
>> or
>> anything. I have MadExcept installed and it doesn't popup at all.
>>
>> The PC has been working fine under load for a couple of years with a
>> previous version of my player which did not execute quite as many
>> threads at a change of track as it does now, but it's similar in
>> other
>> aspects.
>>
>> I ran a CPU torture test and a memory test on the PC some time ago
>> for
>> several hours and it passed. I'm worried that I may be doing
>> something
>> wrong in the software. It is moving audio around in several places
>> in
>> memory blocks using pointers, etc, so there is the slim possibility
>> that
>> a buffer is over running, but unlikely.
>>
>> Is it possible that Windows XP would terminate an app without notice
>> if
>> unallocated memory was written to? I would expect an AV error.
>>
>> As a side note, I did once get an error box appear saying something
>> like
>> "too many consecutive exceptions". This didn't make any sense since
>> I
>> have MadExcept installed which should trap any exceptions but it
>> didn't.
>>
>> Anyone have any ideas?
>>
>> Ross.
>>
>> _______________________________________________
>> Delphi mailing list
>> Delphi at ns3.123.co.nz
>> http://ns3.123.co.nz/mailman/listinfo/delphi
>>
>
>
> --
> Kyley Harris
> Harris Software
> +64-9-8455274
> +64-21-671-821
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.7/182 - Release Date:
> 24/11/2005
>
>
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
More information about the Delphi
mailing list