Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    The forum rollback caused push notifications and recent user data to malfunction. The problem will fix itself naturally within the next days. See the topic Broken Push Notifications for a more in detail explanation. You can fix this yourself by forcibly clearing your browser cache (for most browsers: CTRL + F5).

    Strange string addition crash

    Cinema 4D SDK
    r21 c++ windows
    2
    3
    357
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      ECHekman
      last edited by

      Im having a strange problem while trying to run our plugin on R21.207
      For some reason adding two string together crashes

      Crashes:

      String totalPath = ppath + ver;
      

      Doesnt Crash

      String totalPath = ppath;
      totalPath.Append(ver);
      

      debug output:

      ../../../frameworks/cinema_emulation.framework/source/maxon/stringencoding_c4demulation.h(33): CRITICAL: Stop
      A breakpoint instruction (__debugbreak() statement or a similar call) was executed in Cinema 4D.exe.
      
      Exception thrown at 0x00007FFA047D6820 (c4dplugin.xdl64) in Cinema 4D.exe: 0xC0000005: Access violation reading location 0x00000035456D34A0.
      
      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @ECHekman
        last edited by ferdinand

        Hello @ECHekman,

        Thank you for reaching out to us. This is rather tricky to answer with the given information. Let's split this into a 'what you should do' and a 'speculation' part.

        You marked this topic as R21and we only provide reduced legacy support for it. See Support Procedures - Scope of Support: Version Scope for details. We always try to find a solution where possible, but this might be a case where we can only provide very limited support.

        What you should do

        • Try to reproduce this in more recent versions of Cinema 4D, ideally 2024/2025.
        • Submit crashes to our bug tracker, as you (a) will see there the stack trace resolved, i.e., you get more than the offsets in 'Exception thrown at 0x00007FFA047D6820 (c4dplugin.xdl64) in Cinema 4D.exe: 0xC0000005' and (b) we can then also more easily look into the source. For very old versions such as R21 this could be tricky though, as I do not know if our bug tracker still resolves these stack traces.
        • When the two prior points fail, we will need the exact version of Cinema 4D you are using (open the 'About' dialog and copy the version with a right-click).
        • Check if this happens for adding for all string data, i.e., adding "foo"_s + "bar"_s. Which would strike me as quite unlikely that there is such a fundamental bug in the string template (but also not out of question since the Maxon API just had be introduced with R21). When it is not general, try to hunt down what is special about your data.

        Speculation

        There is quite little to go on here, except that an access violation happens, which of course implies that either ppath or ver is dangling garbage when you try to add them. So, I would try to do the most basic access possible right before adding them, e.g., just print both strings to the (debug) console, to see if they are at least generally accessible at that point or if you are already operating on broken data there.

        Looking at a recent day stringencoding_c4demulation.h(33) which is very likely not the same as the R21 file (did not check though), this region deals with string encodings, particularly variable bit-width encoding. This could have something to do with encoding non-English or otherwise special character strings or that you are trying to add strings with different encodings (heavily speculative).

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • E
          ECHekman
          last edited by

          Thanks for your response. We found the issue. Turns out we had to delay load our dlls for earlier versions of the plugin R21 etc

          1 Reply Last reply Reply Quote 1
          • First post
            Last post