Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revit crashes if i snoop a Bending Detail Schematic #225

Open
maartendebeuf opened this issue Apr 30, 2024 · 32 comments
Open

Revit crashes if i snoop a Bending Detail Schematic #225

maartendebeuf opened this issue Apr 30, 2024 · 32 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior external ⤴️ Something related to or caused by an external project

Comments

@maartendebeuf
Copy link

When i select a Bending Detail Schematic and preform a Snoop Selection Revit crashes.

Below a fragment of the journal where i think the crash hapens. (if needed i can send the full journal).

'<>
'E 30-Apr-2024 08:43:38.642; 0:<
Jrn.MouseMove 0 , 580 , 24
'E 30-Apr-2024 08:43:38.642; 0:<
Jrn.RibbonEvent "Execute external command:CustomCtrl_%Revit Lookup%RevitLookup.Commands.SnoopSelectionCommand:RevitLookup.Commands.SnoopSelectionCommand"
' 0.193117 1:<<<API External Command Time
'H 30-Apr-2024 08:43:38.835; 0:<
Jrn.Data _
"APIStringStringMapJournalData" , 0
'H 30-Apr-2024 08:43:38.884; 0:<
Jrn.Data _
"Restricted Propagation" , 2, 93
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< Exception caught from managed method RevitDBAPI::Void _CxxThrowException(Void*, _s__ThrowInfo*) <System.Runtime.InteropServices.SEHException>
' 0:< <>
'
'Edit mode: IDR_COMMON
'Command: ID_BUTTON_SELECT
'Category: 1
'Bar list:
' Dialog_Revit_DynamicLabelDBar
' Dialog_Essentials_FilterSelectionNew
'Provider list:
' PP_BendingDetailLeaders_ModScope
' PP_MultiAlign_ModScope
' PP_SchematicBendingDetails_ModScope
'Product: Revit

@Nice3point Nice3point added the bug 🐛 An unexpected issue that highlights incorrect behavior label Apr 30, 2024
@Nice3point
Copy link
Collaborator

Nice3point commented Apr 30, 2024

Initial investigation

Property: TagText
Exception: System.AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

@Nice3point
Copy link
Collaborator

Nice3point commented Apr 30, 2024

@jeremytammik hi Jeremy. Issue for Revit Development team


Bug ticket

Revit version: 2025 only
Class: Autodesk.Revit.DB.IndependentTag
Property: TagText
Category: OST_RebarBendingDetails
Property access: IExternalEventHandler
Exception: System.AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Issue level: Critical

Description: getting the tag text for "Structural Rebar Bending Details" results in an AccessViolationException. The problem is relevant in 2025 and is not observed in later Revit versions. Another problem is that this type of exception cannot be handled by a catch block since .Net Core, as it is considered unique and requires the application to be terminated.

Revit API fixes required

image

@Nice3point Nice3point added the external ⤴️ Something related to or caused by an external project label Apr 30, 2024
@Nice3point
Copy link
Collaborator

Nice3point commented Apr 30, 2024

For now, we can just disable this property in RevitLookup until we see a fix in the API

@maartendebeuf
Copy link
Author

maartendebeuf commented Apr 30, 2024

Thanks for investigating!
I would also like to report that I discovered that it was successful via the "Revit DB Explorer' tool (https://github.com/NeVeSpl/RevitDBExplorer)

@Nice3point
Copy link
Collaborator

Nice3point commented Apr 30, 2024

@maartendebeuf this property also disabled manually in RevitDbExplorer https://github.com/NeVeSpl/RevitDBExplorer/blob/main/sources%2FRevitDBExplorer%2FDomain%2FDataModel%2FMemberAccessors%2FIndependentTag%2FIndependentTag_TagText.cs

I have alreade done it for RevitLookup. Wait for a new release.

But revit api issue still exists

@jeremytammik
Copy link
Owner

Dear Roman and Maarten,

Thank you both for reporting and analysing this. Sorry to hear about it.

I logged the issue REVIT-221696 [IndependentTag TagText throws AccessViolationException] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

This issue is important to me. What can I do to help?

This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

This information is crucial. Our engineering team has limited resources and must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

Best regards,

Jeremy

@Nice3point
Copy link
Collaborator

@jeremytammik

Impact on your application and/or your development.

Critical. This bug causes the domain to be terminated, without possibility to catch it.
Normal behaviour: Autodesk.Revit.Exceptions.InvalidOperationException
Current behaviour: System.AccessViolationException

The number of users affected.
All add-in developers. No impact on engineers, as the bug can only be detected by an API call

The potential revenue impact to you.
Negative impact on the structural developers

The potential revenue impact to Autodesk.
The Revit crash is having a negative impact

Realistic timescale over which a fix would help you.
Nearest hotfix

@Nice3point
Copy link
Collaborator

Nice3point commented Apr 30, 2024

@jeremytammik

Addin solution with example:
TagTextBug.zip

Select Debug R25 configuration and run debug.

Only Revit 2025. Bundled Snowdon Towers Structural project

@jeremytammik
Copy link
Owner

thank you very much!

the development team do indeed insist on a complete minimal reproducible case, saying: I do not see a code snippet or a dataset to reproduce this issue. Would the customer provide this information?

I assume that TagTextBug.zip includes all they need?

@Nice3point
Copy link
Collaborator

@jeremytammik yes, TagTextBug.zip contains a C# project with a full reproduction of this issue

@Nice3point
Copy link
Collaborator

Nice3point commented May 8, 2024

@jeremytammik hi Jeremy. The same exception with DatumPlane class. Revit 2025 only #232
изображение

Revit 2024 and lower works fine
изображение

Any updates?

@jeremytammik
Copy link
Owner

They are still looking at REVIT-221696 [IndependentTag TagText throws AccessViolationException]. i added your note on DatumPlane. Thank you!

@jeremytammik
Copy link
Owner

The development team ask: can you provide a sample Revit project that has the category etc. setup? I have nothing handy and would be a big help. Thank you.

@Nice3point
Copy link
Collaborator

@jeremytammik for Bending Detail you can use dafault revit project
изображение

Plan L1_43_High
изображение

and after placing Bending Detail try to get TagText property using api
изображение

@Nice3point
Copy link
Collaborator

@jeremytammik as for DatumPlane you can select any Grid and call CanBeVisibleInView using the API
изображение

@jeremytammik
Copy link
Owner

jeremytammik commented May 31, 2024

I created a separate Jira issue for the access violation caused by datum plane: REVIT-222687 [DatumPlane.CanBeVisibleInView throws AccessViolationException].

@jeremytammik
Copy link
Owner

thank you for the detailed instructions to reproduce.

@jeremytammik
Copy link
Owner

the development team confirmed the issue reported in REVIT-221696 [IndependentTag TagText throws AccessViolationException], closed it, and will address it in the separate new code fix ticket REVIT-223068 [IndependentTag TagText throws AccessViolationException].

@Nice3point
Copy link
Collaborator

great news, thanks

@jeremytammik
Copy link
Owner

they confirm: The issue is on our end. We have identified a fix and are working on releasing it in the next update. The problem is that the system is attempting to use the Bending Detail type to access the tag data instead of the correct tag type. As a workaround, the customer can temporarily create a regular tag type instance to access the text data.

@jeremytammik
Copy link
Owner

Dear Roman and Maarten,

Thank you for your patience with this. The development team are analysing the code fix issue REVIT-222687 [DatumPlane.CanBeVisibleInView throws AccessViolationException] that was created to address the original ticket REVIT-221696 [IndependentTag TagText throws AccessViolationException]. However, they are having trouble reproducing this issue for Grids. They tried calling CanBeVisibleInView on every Grid for every View in the sample project and haven't had any issues. Can you provide the exact Revit version used, the exact RVT file, and the element IDs of the grids that are throwing an exception? Thank you.

Best regards,

Jeremy

@Nice3point
Copy link
Collaborator

@jeremytammik hi Jeremy.
FIle: "C:\Program Files\Autodesk\Revit 2025\Samples\Snowdon Towers Sample Architectural.rvt"
ElementID: 1275291
Revit version: 25.1.0.44 | 20240516_1515(x64)

The project ships with Revit. I found that this error does not appear in all projects. But it is present in this one. If the bug is not reproduced on this element, it may be that it has been fixed by a fix for IndependentTag

@jeremytammik
Copy link
Owner

thank you for the details. i passed them on.

@jeremytammik
Copy link
Owner

problem reported in REVIT-222687 [DatumPlane.CanBeVisibleInView throws AccessViolationException] was confirmed.

new code fix issue created: REVIT-223580 [DatumPlane.CanBeVisibleInView throws AccessViolationException].

@Nice3point
Copy link
Collaborator

Great 🎉 Then we are waiting for details, I wonder if the reason was the same or not. After all, if different, there are probably other properties/methods that throw AccessViolationException.

@jeremytammik
Copy link
Owner

work on REVIT-223580 [DatumPlane.CanBeVisibleInView throws AccessViolationException] is in progress. As a temporary workaround, you can check views for the IsTemplate property. If the value is true, then assume CanBeVisibleInView is false without making the call on that view.

@jeremytammik
Copy link
Owner

REVIT-223068 [IndependentTag TagText throws AccessViolationException] has been resolved and scheduled for inclusion in the next update release.

@Nice3point
Copy link
Collaborator

@jeremytammik thanks Jeremy, happy to hear it 🙂

@Nice3point
Copy link
Collaborator

I'll disable the restrictions in RevitLookup as soon as this patch comes out for Revit

@maartendebeuf
Copy link
Author

Thanks Roman and Jeremy for the updates and especially the great work you put into this!

@jeremytammik
Copy link
Owner

REVIT-223580 [DatumPlane.CanBeVisibleInView throws AccessViolationException] has been closed now; Resolution: Fixed,
Submitted Version: next major release of Revit.

@jeremytammik
Copy link
Owner

REVIT-223068 [IndependentTag TagText throws AccessViolationException] has been closed now; Resolution: Fixed,
Submitted Versions: next major release of Revit + next update release of Revit 2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior external ⤴️ Something related to or caused by an external project
Projects
None yet
Development

No branches or pull requests

3 participants