473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

wpf: XamlWriter and stack overflow

I'm trying to serialize some xaml elements using the XamlWriter and I'm
getting a stack overflow error because the elements have some public
properties which get called about a million ( a lot) times. As I step
through the code the only thing that executes is the getter in these
properties and I don't know what would be calling them. any ideas on how to
trouble shoot this?

--
mo*******@newsgroup.nospam
Jun 27 '08 #1
5 4007
I'm trying to serialize some xaml elements using the XamlWriter and I'm
getting a stack overflow error because the elements have some public
properties which get called about a million ( a lot) times. As I step
through the code the only thing that executes is the getter in these
properties and I don't know what would be calling them. any ideas on how
to trouble shoot this?
Just a guess - is there any chance that one of these properties is defined
in terms of itself, e.g.:

private int myInt;
public int MyInt { get { return MyInt; } } // note capital M in last word
instead of
public int MyInt { get { return myInt; } } // note small m

Chris Jobson
Jun 27 '08 #2
Here's one of them:

public object Child
{
get { return _child; }
set { _child = value; }
}

"Chris Jobson" <ch**********@btinternet.comwrote in message
news:OX**************@TK2MSFTNGP05.phx.gbl...
>I'm trying to serialize some xaml elements using the XamlWriter and I'm
getting a stack overflow error because the elements have some public
properties which get called about a million ( a lot) times. As I step
through the code the only thing that executes is the getter in these
properties and I don't know what would be calling them. any ideas on how
to trouble shoot this?

Just a guess - is there any chance that one of these properties is defined
in terms of itself, e.g.:

private int myInt;
public int MyInt { get { return MyInt; } } // note capital M in last
word
instead of
public int MyInt { get { return myInt; } } // note small m

Chris Jobson

Jun 27 '08 #3
On Jun 10, 10:33 pm, "moondaddy" <moonda...@newsgroup.nospamwrote:
I'm trying to serialize some xaml elements using the XamlWriter and I'm
getting a stack overflow error because the elements have some public
properties which get called about a million ( a lot) times.
You don't get a stack overflow error just because a property is called
millions of times. You get a stack overflow when you've got recursion
somewhere - one property calling itself (or A calling B calling A
etc).

Have you managed to recover a stack trace? It's not always possible
with stack overflows, but if you can get one it should show what's
going on.

Jon
Jun 27 '08 #4
Thanks Chris for your help!

Hi George,

Generally speaking, the overflow exception occurs in case of a very deep or
unbounded recursion.

Please check the code of the XAML elements you would serialize. After you
find them, make some modifications and the problem should be solved.

If you need our assistance, please show us the code of the XAML elements.

For more information on the XMLWriter class, please refer to the following
MSDN document:
http://msdn.microsoft.com/en-us/libr....xamlwriter(VS.
85).aspx

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #5
Here's one of them:
>
public object Child
{
get { return _child; }
set { _child = value; }
}
That looks fine. I've no other ideas at present - can you post a small code
sample that demonstrates the problem?

Chris
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ip4ram | last post by:
I am quite puzzled by the stack overflow which I am encountering.Here is the pseudocode //define stack structure //function operating on stack void my_stack_function( function parameters) {...
7
by: Aguilar, James | last post by:
Hello all, To begin, yes, this -is- a homework assignment. However, it is for my Algorithms class, and my instructor has given us explicit permission to use "expert" groups like newsgroups, so...
19
by: Jim | last post by:
I have spent the past few weeks designing a database for my company. The problem is I have started running into what I believe are stack overflow problems. There are two tab controls on the form...
4
by: Victor | last post by:
Hello, I've got a situation in which the number of (valid) recursive calls I make will cause stack overflow. I can use getrlimit (and setrlimit) to test (and set) my current stack size. ...
2
by: David W. Walker | last post by:
I am attempting to port a C code that runs OK on a number of Linux and Unix machines to Windows XP using Visual Studio C++. I have set the program up as a console application, but when I try to run...
2
by: Ali | last post by:
Hi, I got stack overflow errors while using an unmanaged dll from managed c# application. When i use editbin.exe to increase stack size of app , it works. Is there a way to increase stack size of...
6
by: Daz | last post by:
Hi everyone! It is indeed, once again time for me to ask another stupid question. I have been searching around on the net for quite a while, and can't find anything that explains 'exactly'...
7
by: amit.atray | last post by:
Environement : Sun OS + gnu tools + sun studio (dbx etc) having some Old C-Code (ansi + KR Style) and code inspection shows some big size variable (auto) allocated (on stack) say for ex. char...
23
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.