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

Projects with custom versification crash the dotnet process #1371

Open
tjcouch-sil opened this issue Dec 4, 2024 · 1 comment
Open

Projects with custom versification crash the dotnet process #1371

tjcouch-sil opened this issue Dec 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@tjcouch-sil
Copy link
Member

Describe the bug
If you open a project or resource with custom versification, the dotnet process crashes with the following error:

[dotnet data provider error]
Process terminated. Assertion Failed
GetText called with incorrect versification
   at Paratext.Data.ScrText.GetText(VerseRef vref, Boolean singleChapter, Boolean doMapIn)
   at Paranext.DataProvider.Projects.ParatextProjectDataProvider.ConvertUsfmToUsx(ScrText scrText, VerseRef verseRef, Boolean chapterOnly) in C:\Users\tj_co\source\repos\paranext-core\c-sharp\Projects\ParatextProjectDataProvider.cs:line 622
   at Paranext.DataProvider.Projects.ParatextProjectDataProvider.<>c.<GetChapterUsx>b__28_0(ScrText scrText, VerseRef verseRef) in C:\Users\tj_co\source\repos\paranext-core\c-sharp\Projects\ParatextProjectDataProvider.cs:line 540
   at Paranext.DataProvider.Projects.ParatextProjectDataProvider.GetFromScrText(VerseRef verseRef, Func`3 getTextFromScrText) in C:\Users\tj_co\source\repos\paranext-core\c-sharp\Projects\ParatextProjectDataProvider.cs:line 609
   at Paranext.DataProvider.Projects.ParatextProjectDataProvider.GetChapterUsx(VerseRef verseRef) in C:\Users\tj_co\source\repos\paranext-core\c-sharp\Projects\ParatextProjectDataProvider.cs:line 538
   at InvokeStub_ParatextProjectDataProvider.GetChapterUsx(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at StreamJsonRpc.TargetMethod.InvokeAsync(CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at StreamJsonRpc.AwaitExtensions.SynchronizationContextAwaiter.<>c.<OnCompleted>b__5_0(Object action)
   at Microsoft.VisualStudio.Threading.NonConcurrentSynchronizationContext.ProcessQueueAsync()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecuteFromThreadPool(Thread threadPoolThread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
[/dotnet data provider error]

Then the frontend sees the following in its console:

data-provider.service.ts:232 13:03:02.203 › Tried to retrieve data immediately for ChapterUSJ with selector {"book":"JHN","chapterNum":19,"verseNum":2,"versificationStr":"English"}, but it threw. Error: Web socket 4 has closed

This did NOT occur when I tried this on Platform.Bible release version 0.3.0. I opened a resource (NLT07 unzipped and Editable set to F), and it displayed on the screen just fine with no apparent problems.

To Reproduce
Steps to reproduce the behavior:

  1. Install a project or resource with custom versification (I used NLT07 unzipped and Editable set to F, but I imagine this would probably work with any project with custom versification)
  2. Open it in the scripture editor or resource viewer
  3. See error

Expected behavior
Opening projects and resources with custom versification could reasonably cause some issues in some cases for now since we haven't done anything with versifications, but they should do something and should not crash the dotnet process.

Note: Following is a sample custom.vrs file (a small excerpt from NLT07's custom.vrs file) you could add to the root folder of a project to make it considered to have a custom versification:

custom.vrs

#! -ACT 24:7 
#! -ACT 28:29 
#! -ROM 16:24 

I tried removing this file from my local NLT07, and Platform.Bible opened it with no apparent problems.

@tjcouch-sil tjcouch-sil added the bug Something isn't working label Dec 4, 2024
@tjcouch-sil tjcouch-sil moved this to 📥 For Consideration in Paranext Dec 4, 2024
@katherinejensen00 katherinejensen00 moved this from 📥 For Consideration to 🔖 ToDo in Paranext Dec 11, 2024
@lyonsil lyonsil self-assigned this Dec 11, 2024
@lyonsil lyonsil moved this from 🔖 ToDo to 🏗 In progress in Paranext Dec 11, 2024
@lyonsil
Copy link
Member

lyonsil commented Dec 12, 2024

The error TJ included comes from this in ParatextData:

            Debug.Assert(!singleChapter || vref.Versification == null || vref.Versification == Settings.Versification,
                "GetText called with incorrect versification");

This can only happen if you have a custom build of ParatextData.dll on your computer that was compiled with debug symbols. TJ has a private, debug build of ParatextData.dll that he was running at the time. That's why this was hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants