|
microsoft.public.smartphone.developer - Developing software for MS Smartphone? This is your group!
|
|
|
|
|
Posted by The PocketTV Team on August 27, 2005, 6:38 pm
Please log in for more thread options
i'm still strugling to find what causes the memory corruption problem that
we observe in our app on WM5.
even when I use GetOpenFileNameEx and OPENFILENAMEEX, I see the memory
corruption happening right after GetOpenFileNameEx returns (right before,
the memory is fine).
apparently, contrary to what i thought earlier, it's the heap which gets
corrupted (i.e. some block malloc'ed by an other thread get trashed by
GetOpenFileName and GetOpenFileNameEx).
But I noticed similar issues of trashed heap in our code, that are just
caused by calling malloc.
basically a malloc trashes a bloc that was previously malloc'ed by another
thread. I could trace this happening by looking just before and after the
malloc.
our code uses a wrapper around all the malloc and free calls to check that
we don't do any buffer overwriting (i.e. we have dynamic buffer bound
checking by adding "fences" around our malloc'ed buffers), so i am quite
confident that we don't overwrite any of our malloc'ed buffer.
and strangely we observe this problem only on WM5.
so, maybe that's because we don't link with a thread-safe version of the
malloc library...
is there something special to do in order to use a thread-safe malloc?
i.e. in some cases we have a thread the frees a block that was malloc'ed by
another thread, this sort of things.
|
|
Posted by Michael J. Salamone on August 27, 2005, 8:01 pm
Please log in for more thread options
malloc is thread-safe. It just internally calls LocalAlloc, which
serializes heap requests.
You could have corruption that goes undetected by your wrapper if the
corrupted block isn't freed before the problem is manifested (in a crash or
hang).
Why don't you call HeapValidate(GetProcessHeap()) before calling
GetOpenFileNameEx? See if that indicates any problems. If it does, try
moving the call to HeapValidate earlier in your code.
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
show/hide quoted text
> i'm still strugling to find what causes the memory corruption problem that
> we observe in our app on WM5.
> even when I use GetOpenFileNameEx and OPENFILENAMEEX, I see the memory
> corruption happening right after GetOpenFileNameEx returns (right before,
> the memory is fine).
> apparently, contrary to what i thought earlier, it's the heap which gets
> corrupted (i.e. some block malloc'ed by an other thread get trashed by
> GetOpenFileName and GetOpenFileNameEx).
> But I noticed similar issues of trashed heap in our code, that are just
> caused by calling malloc.
> basically a malloc trashes a bloc that was previously malloc'ed by another
> thread. I could trace this happening by looking just before and after the
> malloc.
> our code uses a wrapper around all the malloc and free calls to check that
> we don't do any buffer overwriting (i.e. we have dynamic buffer bound
> checking by adding "fences" around our malloc'ed buffers), so i am quite
> confident that we don't overwrite any of our malloc'ed buffer.
> and strangely we observe this problem only on WM5.
> so, maybe that's because we don't link with a thread-safe version of the
> malloc library...
> is there something special to do in order to use a thread-safe malloc?
> i.e. in some cases we have a thread the frees a block that was malloc'ed
> by another thread, this sort of things.
>
|
|
Posted by The PocketTV Team on August 27, 2005, 8:12 pm
Please log in for more thread options never mind, i found the problem (in our code). it was a nasty case of one
malloc'ed block still being used by a thread while it had been freed by
another thread.
this bug was here but undetected for years, funny it never triggered before
WM5!
well, 3 frustrating days on that one... but finally mailed it :)
|
|
Posted by WebIS on August 29, 2005, 7:07 pm
Please log in for more thread options I've found that WM5 has triggered MANY previously undetected bugs.
Microsoft told me that previously, WM would not report some bugs, but
in WM5 it now does.
|
|
Posted by Xiaomaùxš¢fŠÇ.²È¨žÉ¢rº,¡û\¢ on August 30, 2005, 1:35 am
Please log in for more thread options Dear all,
I have a question now also about the WM5 heap corruption.
I found that when we using the application verify tools to vertify
the wmplayer.exe that WM5 provided,there are so many heap corruptions.I don't
know why they come out and wot do they mean.Can some body give some
instructions? Thanks a lot!
Best Regards,
siwlyfe
"WebIS" wrote:
show/hide quoted text
> I've found that WM5 has triggered MANY previously undetected bugs.
> Microsoft told me that previously, WM would not report some bugs, but
> in WM5 it now does.
>
>
|
| Similar Threads | Posted | | Free access to several paysites! Free movies - games - software - mp3 - and more! | January 17, 2006, 4:31 pm |
| Is it safe to change some registry to turn on wi-fi | October 22, 2009, 7:08 am |
| What Drawing objects are thread-safe/cacheable? | May 11, 2007, 10:42 am |
| FREE() Crashing | December 15, 2005, 7:04 pm |
| Free Hot Phone Sex | January 21, 2006, 11:01 am |
| Free Hot Phone Sex | January 21, 2006, 11:01 am |
| SEX HOT LINE FREE TRIAL! | July 30, 2006, 8:27 am |
| Free WAV 2 MP3 encoder / PPC2003 / WM5 / WM6 | October 21, 2008, 12:59 am |
| Web Hosting and Free Domain Name Registration | September 16, 2005, 2:33 pm |
| Re: Magic Indian Oil for MEN! Free Trial | August 11, 2006, 10:57 am |
|
|
> we observe in our app on WM5.
> even when I use GetOpenFileNameEx and OPENFILENAMEEX, I see the memory
> corruption happening right after GetOpenFileNameEx returns (right before,
> the memory is fine).
> apparently, contrary to what i thought earlier, it's the heap which gets
> corrupted (i.e. some block malloc'ed by an other thread get trashed by
> GetOpenFileName and GetOpenFileNameEx).
> But I noticed similar issues of trashed heap in our code, that are just
> caused by calling malloc.
> basically a malloc trashes a bloc that was previously malloc'ed by another
> thread. I could trace this happening by looking just before and after the
> malloc.
> our code uses a wrapper around all the malloc and free calls to check that
> we don't do any buffer overwriting (i.e. we have dynamic buffer bound
> checking by adding "fences" around our malloc'ed buffers), so i am quite
> confident that we don't overwrite any of our malloc'ed buffer.
> and strangely we observe this problem only on WM5.
> so, maybe that's because we don't link with a thread-safe version of the
> malloc library...
> is there something special to do in order to use a thread-safe malloc?
> i.e. in some cases we have a thread the frees a block that was malloc'ed
> by another thread, this sort of things.
>