Print Page | Close Window

RenderToStream crash application

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2919
Printed Date: 13 Jun 25 at 8:42PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: RenderToStream crash application
Posted By: Ihor.Karalash
Subject: RenderToStream crash application
Date Posted: 10 Jun 14 at 2:35PM
I have many threads that use RenderToStream for writing document data to stream, very often i get access violation here, sometimes i get error message with link to ntdll.dll, sometimes "System error. Code 5".

function TPdfDocument.RenderPageToStream(dpi, page: integer; output: TRenderOutput; target: TStream): boolean;
var
    res: Integer;
begin
    try
        res := fLib.RenderPageToStream(dpi, page, Ord(output), target);
    except
        Exit(False);
    end;
    Result := res = ERR_Ok;
end;

And after some time, application crash and close without errors. Any ideas? Windows 7, x64



Replies:
Posted By: Ihor.Karalash
Date Posted: 10 Jun 14 at 2:44PM
From event viewer:
Faulting application name: xxx.exe, version: 0.0.0.3, time stamp: 0x53970a6b
Faulting module name: ntdll.dll, version: 6.1.7601.18247, time stamp: 0x521ea8e7
Exception code: 0xc0000029
Fault offset: 0x00090892
Faulting process id: 0x674
Faulting application start time: 0x01cf84b15adc7035
Faulting application path: ...\exe\xxx.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: 35db0165-f0a5-11e3-8c36-7071bcb0fcec


Posted By: tfrost
Date Posted: 10 Jun 14 at 3:28PM
What type of stream are you passing to the function?  Have you checked that the stream has been created and has not been closed or modified by one of your other threads?  If you are writing direct to a filestream have you tried instead changing to a memorystream and then writing that to file later?  When you run the application under the debugger what does the stack trace tell you when the exception occurs?  What version of Delphi and Debenu are you using?  Google indicates that c000029 may be related to a stack corruption issue: so can you reproduce the issue if you single-thread your application?


Posted By: Ingo
Date Posted: 10 Jun 14 at 9:29PM
Hi Igor,

like TFROST told already...
You should check where you're doing the CREATEs and FREEs.

Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk