Hi,

I'm working on a C++ program that is using memory mapped files quite a lot.
It has been running for years on PPC2002 and 2003, but on Windows Mobile 5
I'm having trouble. I have only tested it on one device, and it seems to work
-- but in the Visual Studio 2005 Pro (release version) device emulator it
crash'es every 3rd time I start it.

Some debugging shows that it is a call to CreateFileMapping that overwrites
global data in the application. The call itself succeeds, the file being
mapped and all is good, but it has trashed the heap totally. This happends
with both a Pocket PC 2003 build (running in WM5 emulator) and with the WM5
build. It has never happened to us in any other emulator, or any device. The
emulator ram is set to 256 Mb, which is way more than the application needs.

I have tried reinstalling both VS2005 and the WM5 SDK without any luck.

My question is this: Is this a bug in the WM5 ROM, and is there an update of
it coming anytime soon?

Any ideas?

Thanks,
::Ludvig A. Norin

Re: CreateFileMapping on WM 5 in VS2005 Device Emulator by hel

hel
Wed Mar 15 12:12:18 CST 2006

Does it happen in a "Debug" build, too? There's
a nasty code generation bug in vs2005/arm in
release mode that causes writes to random memory
(memory located by whatever addr is in a particular
reg). It's not specific to any particular API;
it's just bad (as in wrong) code generation by the
compiler.

LAN- [Wed, 15 Mar 2006 07:46:01 -0800]:
> VS2005...

--
40th Floor - Software @ http://40th.com/
iPlay : the ultimate audio player for mobiles
parametric eq, xfeed, reverb; all on a mobile

Re: CreateFileMapping on WM 5 in VS2005 Device Emulator by LudvigANorin

LudvigANorin
Wed Mar 15 13:00:28 CST 2006

Yes, this is identical in both optimized and debug builds, and it only
happens in the WM5 emulator - not in the PPC2003 emu (which I also have
installed in VS2005). Also, the PPC2003 exe is compiled with target ARM,
while the WM5 exe is compiled with target THUMB. Does this code generation
bug affect all optimization levels? Does it affect both ARM and THUMB
targets? Do you know if there is a fix available (even through support)?

BIG thank you for taking your time and answering my previous question! :)

::Ludvig A. Norin

"hel@40th.com" wrote:

> Does it happen in a "Debug" build, too? There's
> a nasty code generation bug in vs2005/arm in
> release mode that causes writes to random memory
> (memory located by whatever addr is in a particular
> reg). It's not specific to any particular API;
> it's just bad (as in wrong) code generation by the
> compiler.
>
> LAN- [Wed, 15 Mar 2006 07:46:01 -0800]:
> > VS2005...
>
> --
> 40th Floor - Software @ http://40th.com/
> iPlay : the ultimate audio player for mobiles
> parametric eq, xfeed, reverb; all on a mobile
>

Re: CreateFileMapping on WM 5 in VS2005 Device Emulator by hel

hel
Wed Mar 15 15:48:28 CST 2006

LAN- [Wed, 15 Mar 2006 11:00:28 -0800]:
>targets? Do you know if there is a fix available (even through support)?

Tough calls. This is easy enough to post,
though:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=144007&SiteID=1

No news is good news? That's just plain wrong.
--
40th Floor - Software @ http://40th.com/
iPlay : the ultimate audio player for mobiles
parametric eq, xfeed, reverb; all on a mobile

Re: CreateFileMapping on WM 5 in VS2005 Device Emulator by Barry

Barry
Thu Mar 16 08:31:03 CST 2006

IMHO every compiler has at least one code-gen bug. I certainly hope the bug
fix described in this thread does appear in a release in the near future.

Rather than speculating about whether this memory-mapped file crash is or is
not related to the known code-gen bug, lets get the facts and work from
there. Ludvig, can you post more details about the crash? What is the
callstack, what are the values of registers, what are the relevant values
from memory, etc. The original post doesn't say whether the crash is access
violation, divide-by-zero, stack overflow, etc.

Barry

<hel@40th.com> wrote in message
news:Oql6yoHSGHA.1948@TK2MSFTNGP09.phx.gbl...
> LAN- [Wed, 15 Mar 2006 11:00:28 -0800]:
> >targets? Do you know if there is a fix available (even through support)?
>
> Tough calls. This is easy enough to post,
> though:
>
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=144007&SiteID=1
>
> No news is good news? That's just plain wrong.
> --
> 40th Floor - Software @ http://40th.com/
> iPlay : the ultimate audio player for mobiles
> parametric eq, xfeed, reverb; all on a mobile



Re: CreateFileMapping on WM 5 in VS2005 Device Emulator by hel

hel
Thu Mar 16 11:22:22 CST 2006

BB- [Thu, 16 Mar 2006 06:31:03 -0800]:
>IMHO every compiler has at least one code-gen bug

But not from a company that keeps this unfixed for more
than half a year, and counting. It's a very serious bug.

>fix described in this thread does appear in a release in the near future.

It's been there for a long time.

>Rather than speculating about whether this memory-mapped file crash is or is

No one is speculating anymore -- hHe already knows
it's not since it doesn't happen in a debug build.

--
40th Floor - Software @ http://40th.com/
iPlay : the ultimate audio player for mobiles
parametric eq, xfeed, reverb; all on a mobile