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 204229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:26:56+00:00 2026-05-11T17:26:56+00:00

In a C# constructor, that ends up with a call to this(…) , the

  • 0

In a C# constructor, that ends up with a call to this(...), the actual call gets translated to this:

0000003d  call        dword ptr ds:[199B88E8h]

What is the DS register contents here? I know it’s the data-segment, but is this call through a VMT-table or similar? I doubt it though, since this(...) wouldn’t be a call to a virtual method, just another constructor.

I ask because the value at that location seems to be bad in some way, if I hit F11, trace into (Visual Studio 2008), on that call-instruction, the program crashes with an access violation.

The code is deep inside a 3rd party control library, where, though I have the source code, I don’t have the assemblies compiled with enough debug information that I can trace it through C# code, only through the disassembler, and then I have to match that back to the actual code.

The C# code in question is this:

public AxisRangeData(AxisRange range) : this(range, range.Axis) {
}

Reflector shows me this IL code:

.maxstack 8
L_0000: ldarg.0 
L_0001: ldarg.1 
L_0002: ldarg.1 
L_0003: callvirt instance class DevExpress.XtraCharts.AxisBase DevExpress.XtraCharts.AxisRange::get_Axis()
L_0008: call instance void DevExpress.XtraCharts.Native.AxisRangeData::.ctor(class DevExpress.XtraCharts.ChartElement, class DevExpress.XtraCharts.AxisBase)
L_000d: ret 

It’s that last call there, to the other constructor of the same class, that fails. The debugger never surfaces inside the other method, it just crashes.

The disassembly for the method after JITting is this:

00000000  push        ebp  
00000001  mov         ebp,esp 
00000003  sub         esp,14h 
00000006  mov         dword ptr [ebp-4],ecx 
00000009  mov         dword ptr [ebp-8],edx 
0000000c  cmp         dword ptr ds:[18890E24h],0 
00000013  je          0000001A 
00000015  call        61843511 
0000001a  mov         eax,dword ptr [ebp-4] 
0000001d  mov         dword ptr [ebp-0Ch],eax 
00000020  mov         eax,dword ptr [ebp-8] 
00000023  mov         dword ptr [ebp-10h],eax 
00000026  mov         ecx,dword ptr [ebp-8] 
00000029  cmp         dword ptr [ecx],ecx 
0000002b  call        dword ptr ds:[1889D0DCh]   // range.Axis
00000031  mov         dword ptr [ebp-14h],eax 
00000034  push        dword ptr [ebp-14h] 
00000037  mov         edx,dword ptr [ebp-10h] 
0000003a  mov         ecx,dword ptr [ebp-0Ch] 
0000003d  call        dword ptr ds:[199B88E8h]   // this(range, range.Axis)?
00000043  nop              
00000044  mov         esp,ebp 
00000046  pop         ebp  
00000047  ret              

Basically what I’m asking is this:

  • What the purpose of the ds:[ADDR] indirection here? VMT-table is only for virtual isn’t it? and this is constructor
  • Could the constructor have yet to be JITted, which could mean that the call would actually call through a JIT shim? I’m afraid I’m in deep water here, so anything might and could help.

Edit: Well, the problem just got worse, or better, or whatever.

We are developing the .NET feature in a C# project in a Visual Studio 2008 solution, and debugging and developing through Visual Studio.

However, in the end, this code will be loaded into a .NET runtime hosted by a Win32 Delphi application.

In order to facilitate easy experimentation of such features, we can also configure the Visual Studio project/solution/debugger to copy the produced dll’s to the Delphi app’s directory, and then execute the Delphi app, through the Visual Studio debugger.

Turns out, the problem goes away if I run the program outside of the debugger, but during debugging, it crops up, every time.

Not sure that helps, but since the code isn’t slated for production release for another 6 months or so, then it takes some of the pressure off of it for the test release that we have soon.

I’ll dive into the memory parts later, but probably not until over the weekend, and post a followup.

  • 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-11T17:26:56+00:00Added an answer on May 11, 2026 at 5:26 pm

    Data segment is where compilers usually put global variables in and where the Import Address Table resides.

    00000029  cmp         dword ptr [ecx],ecx 
    0000002b  call        dword ptr ds:[1889D0DCh]
    

    The first line is actually a null-check, which eventually raises a NullReferenceException if the pointer located in the ECX register is invalid.

    The callvirt MSIL instruction must do the null-check before invoking the actual method. That being said, we can safely assume that these two lines of assembly code have the following MSIL code representation:

    class DevExpress.XtraCharts.AxisBase DevExpress.XtraCharts.AxisRange::get_Axis()
    

    And the commented assembly code:

    00000026  mov         ecx,dword ptr [ebp-8]      // store the pointer to the 'range' in ECX
    00000029  cmp         dword ptr [ecx],ecx        // null-check
    0000002b  call        dword ptr ds:[1889D0DCh]   // range.get_Axis()
    00000031  mov         dword ptr [ebp-14h],eax    // store the result in a local variable
    00000034  push        dword ptr [ebp-14h]        // push the result onto a stack
    00000037  mov         edx,dword ptr [ebp-10h]    // this variable was previously loaded with the 'range' pointer
    0000003a  mov         ecx,dword ptr [ebp-0Ch]    // here seems to be stored the actual 'this' pointer
    0000003d  call        dword ptr ds:[199B88E8h]   // call the this(...) ctor
    

    It’s unclear to me why it’s crashing, have you tried looking up the contents of the memory location (DS:[199B88E8h])?

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

Sidebar

Ask A Question

Stats

  • Questions 138k
  • Answers 138k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer private static IEnumerable<Range<int>> GenerateRanges(int amount, int max, float density, int… May 12, 2026 at 7:32 am
  • Editorial Team
    Editorial Team added an answer I've heard that using WCF we're bound to use some… May 12, 2026 at 7:32 am
  • Editorial Team
    Editorial Team added an answer You want to give your elements unique id's. Then to… May 12, 2026 at 7:32 am

Related Questions

In a C# constructor, that ends up with a call to this(...) , the
I often find I want to write code something like this in C#, but
I have a question, and I'm going to tag this subjective since that's what
Does anyone know if it possible to define the equivalent of a java custom
my question is rather a design question. In Python, if code in your constructor

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.