Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7034847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:14:05+00:00 2026-05-28T01:14:05+00:00

This question might or might not solve my problem – but I hope to

  • 0

This question might or might not solve my problem – but I hope to learn how Delphi/Windows can behave in a way which can cause this.

I have an application which uses a 3rd party component to load an Outlook .msg file.

In some cases (specific mails) the application freezes when calling SetLength (inside of the component, I have the source code).
This happens sometimes when setLength is called inside of a procedure which loads the properties from the file (stream). It happens the exact same place on the same mail – and can be reproduced every time.

Obviously the component does a lot of stuff and it is probably a sideeffect of some of this. However, the mails contains confidential data which I cannot send to the developer of the 3rd party component, so I cannot send it to him to debug it.

The program is running under windows XP on a domain.
The curious thing is that it only happens when the user running the program is not set to be administrator on the local machine.

ms := TMemoryStream.Create;
try
  WriteStorageToStream(SubStorage, ms);
  ApplyValue(ms, ms.Size)
finally
  ms.Free;
end;

procedure ApplyValue(Stream: TStream; brLen: Integer);
var
  s: AnsiString;
begin
  SetLength(s, brLen);          // this freezes it all. brLen=3512
  FillChar(s[1], brLen, #0);
  Stream.Read(s[1], brLen);
  Value := s;
end;

What WriteStorageToStream does exactly is unknown to me, but since we are not manipulating the stream and brLen has an integer value, I assume it’s irrelevant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:14:06+00:00Added an answer on May 28, 2026 at 1:14 am

    I’d say it was simple memory overwrite, causing a failure of the memory manager when the SetLength is called which then tries to use the memory management structures. The problem is in WriteStorageToStream(SubStorage, ms);

    To find it, use the FastMM debug version with the memory overwrite detection options turned on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a simple problem but I can't manage to solve it. I've
This question might not seem programming related at first, but let me explain. I'm
This might be a stupid question, but I was wondering whether or not you
I know this might seem a controversial question but it really is not meant
I know, this might be a very basic question but I am not 100%
Unfortunately I am not writing this question from my Developing PC so I might
This question might be kind of elementary, but here goes: I have a SQL
This question might belong on one of the other trilogies, but it sorta seemed
I know this question might sound a little cheesy but this is the first
This might be a stupid question, but I inserted a webview in a scroll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.