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

Crash when opening a file and exiting it without any modification #2427

Closed
4 tasks done
elyahw opened this issue Sep 28, 2024 · 5 comments · Fixed by #2428
Closed
4 tasks done

Crash when opening a file and exiting it without any modification #2427

elyahw opened this issue Sep 28, 2024 · 5 comments · Fixed by #2428
Assignees
Milestone

Comments

@elyahw
Copy link
Contributor

elyahw commented Sep 28, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a bug. Not a question or feature request.
  • The topic is not already reported at Issues. (I've searched it).
  • Markor is up to date. See Releases for the latest version. Updates are available from F-Droid and GitHub.
  • The bug is still present in the latest development version (git master). (Please download and try the test version of Markor, named Marder. Don't worry; Markor and Marder appear as completely separate applications. You can install both side-by-side, and Markor settings are not touched. In case the issue is resolved there, you don't need to create a bug report. The change will be part of the next Markor update.)

Description

Opening a file and quitting it (without modification) should take us back to the notes list. Instead it crashes under certain condition.

Steps to reproduce

  1. Create a folder containing 100+ .txt notes
  2. Open one of the notes.
  3. Do not modify it, quit the note editing view.
  4. The app will crash

LOGCAT:

2024-09-28 09:30:07.632 18658-18658 MultiDex                net.gsantner.markor_test             I  Installing application
2024-09-28 09:30:07.632 18658-18658 MultiDex                net.gsantner.markor_test             I  VM has multidex support, MultiDex support library is disabled.
2024-09-28 09:30:07.775 18658-18658 WebViewFactory          net.gsantner.markor_test             I  Loading com.google.android.webview version 103.0.5060.71 (code 506007137)
2024-09-28 09:30:07.849 18658-18658 nativeloader            net.gsantner.markor_test             D  Configuring vendor-classloader-namespace for unbundled product apk /product/app/TrichromeLibrary/TrichromeLibrary.apk. target_sdk_version=33, uses_libraries=ALL, library_path=/product/app/WebViewGoogle/lib/x86_64:/product/app/WebViewGoogle/WebViewGoogle.apk!/lib/x86_64:/product/app/TrichromeLibrary/TrichromeLibrary.apk!/lib/x86_64:/product/lib64:/system/product/lib64, permitted_path=/data:/mnt/expand:/product/lib64:/system/product/lib64
2024-09-28 09:30:07.860 18658-18658 ner.markor_test         net.gsantner.markor_test             W  ClassLoaderContext shared library size mismatch. Expected=0, found=1 (PCL[] | PCL[]{PCL[/product/app/TrichromeLibrary/TrichromeLibrary.apk*3197987500]})
2024-09-28 09:30:07.863 18658-18658 nativeloader            net.gsantner.markor_test             D  Configuring vendor-classloader-namespace for unbundled product apk /product/app/WebViewGoogle/WebViewGoogle.apk. target_sdk_version=33, uses_libraries=, library_path=/product/app/WebViewGoogle/lib/x86_64:/product/app/WebViewGoogle/WebViewGoogle.apk!/lib/x86_64:/product/app/TrichromeLibrary/TrichromeLibrary.apk!/lib/x86_64:/product/lib64:/system/product/lib64, permitted_path=/data:/mnt/expand:/product/lib64:/system/product/lib64
2024-09-28 09:30:07.946 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (unsupported, reflection, allowed)
2024-09-28 09:30:07.946 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (unsupported, reflection, allowed)
2024-09-28 09:30:07.946 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (unsupported, reflection, allowed)
2024-09-28 09:30:07.946 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (unsupported, reflection, allowed)
2024-09-28 09:30:07.946 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (unsupported, reflection, allowed)
2024-09-28 09:30:07.950 18658-18658 cr_WVCFactoryProvider   net.gsantner.markor_test             I  Loaded version=103.0.5060.71 minSdkVersion=29 isBundle=false multiprocess=true packageId=2
2024-09-28 09:30:07.961 18658-18771 cr_VariationsUtils      net.gsantner.markor_test             I  Failed reading seed file "/data/user/0/net.gsantner.markor_test/app_webview/variations_seed_new"
2024-09-28 09:30:07.962 18658-18771 cr_VariationsUtils      net.gsantner.markor_test             I  Failed reading seed file "/data/user/0/net.gsantner.markor_test/app_webview/variations_seed"
2024-09-28 09:30:07.991 18658-18658 cr_LibraryLoader        net.gsantner.markor_test             I  Successfully loaded native library
2024-09-28 09:30:07.994 18658-18658 cr_CachingUmaRecorder   net.gsantner.markor_test             I  Flushed 9 samples from 9 histograms.
2024-09-28 09:30:08.073 18658-18658 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 183155436; UID 10176; state: ENABLED
2024-09-28 09:30:08.167 18658-18790 chromium                net.gsantner.markor_test             W  [WARNING:dns_config_service_android.cc(115)] Failed to read DnsConfig.
2024-09-28 09:30:08.249 18795-18795 ocessService0:0         net.gsantner.markor_test             W  Unexpected CPU variant for x86: x86_64.
                                                                                                    Known variants: atom, sandybridge, silvermont, kabylake, default
2024-09-28 09:30:08.469 18658-18658 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 214741472; UID 10176; state: ENABLED
2024-09-28 09:30:08.594 18658-18658 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 171228096; UID 10176; state: ENABLED
2024-09-28 09:30:08.840 18795-18795 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 171979766; UID 99129; state: ENABLED
2024-09-28 09:30:08.873 18658-18852 libEGL                  net.gsantner.markor_test             D  loaded /vendor/lib64/egl/libEGL_emulation.so
2024-09-28 09:30:08.927 18658-18852 libEGL                  net.gsantner.markor_test             D  loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2024-09-28 09:30:08.960 18658-18852 libEGL                  net.gsantner.markor_test             D  loaded /vendor/lib64/egl/libGLESv2_emulation.so
2024-09-28 09:30:09.058 18658-18658 AppCompatDelegate       net.gsantner.markor_test             D  Checking for metadata for AppLocalesMetadataHolderService : Service not found
2024-09-28 09:30:09.095 18795-18795 NetworkSecurityConfig   net.gsantner.markor_test             D  No Network Security Config specified, using platform default
2024-09-28 09:30:09.096 18795-18795 NetworkSecurityConfig   net.gsantner.markor_test             D  No Network Security Config specified, using platform default
2024-09-28 09:30:09.117 18795-18795 cr_WebViewApkApp        net.gsantner.markor_test             I  Launched version=103.0.5060.71 minSdkVersion=29 isBundle=false processName=com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0
2024-09-28 09:30:09.119 18795-18795 cr_ChildProcessService  net.gsantner.markor_test             I  Creating new ChildProcessService pid=18795
2024-09-28 09:30:09.157 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
2024-09-28 09:30:09.157 18658-18658 ner.markor_test         net.gsantner.markor_test             W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
2024-09-28 09:30:09.201 18658-18658 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 210923482; UID 10176; state: ENABLED
2024-09-28 09:30:09.718 18658-18849 HostConnection          net.gsantner.markor_test             D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 
2024-09-28 09:30:09.720 18658-18849 OpenGLRenderer          net.gsantner.markor_test             W  Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2024-09-28 09:30:09.720 18658-18849 OpenGLRenderer          net.gsantner.markor_test             W  Failed to initialize 101010-2 format, error = EGL_SUCCESS
2024-09-28 09:30:09.740 18658-18849 EGL_emulation           net.gsantner.markor_test             D  eglCreateContext: 0x79eb532eb650: maj 3 min 1 rcv 4
2024-09-28 09:30:09.742 18658-18849 EGL_emulation           net.gsantner.markor_test             D  eglMakeCurrent: 0x79eb532eb650: ver 3 1 (tinfo 0x79ed74bf9080) (first time)
2024-09-28 09:30:09.771 18658-18849 Gralloc4                net.gsantner.markor_test             I  mapper 4.x is not supported
2024-09-28 09:30:09.870 18658-18849 Gralloc4                net.gsantner.markor_test             W  allocator 4.x is not supported
2024-09-28 09:30:09.893 18658-18849 HostConnection          net.gsantner.markor_test             D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 
2024-09-28 09:30:10.452 18658-18658 AutofillManager         net.gsantner.markor_test             D  Fill dialog is enabled:false, hints=[password, passwordAuto, creditCardNumber, creditCardSecurityCode, creditCardExpirationDate]
2024-09-28 09:30:10.672 18658-18658 System.err              net.gsantner.markor_test             W  readTextFileFast: File /storage/emulated/0/Documents/marder/todo.txt not found.
2024-09-28 09:30:10.722 18658-18658 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 193247900; UID 10176; state: ENABLED
2024-09-28 09:30:10.962 18658-18658 System.err              net.gsantner.markor_test             W  readTextFileFast: File /storage/emulated/0/Documents/marder/QuickNote.md not found.
2024-09-28 09:30:11.264 18658-18658 View                    net.gsantner.markor_test             W  requestLayout() improperly called by android.widget.FrameLayout{cd367f8 V.E...... ......ID 1080,0-2160,1764 #3} during layout: running second layout pass
2024-09-28 09:30:11.264 18658-18658 View                    net.gsantner.markor_test             W  requestLayout() improperly called by android.widget.FrameLayout{18104d1 VFE...... ......ID 0,0-1080,1764} during layout: running second layout pass
2024-09-28 09:30:11.264 18658-18658 View                    net.gsantner.markor_test             W  requestLayout() improperly called by net.gsantner.markor.frontend.DraggableScrollbarScrollView{e0ceb36 VFED.V... ......ID 0,0-1080,1637 #7f0900fa app:id/document__fragment__edit__content_editor__scrolling_parent} during layout: running second layout pass
2024-09-28 09:30:11.264 18658-18658 View                    net.gsantner.markor_test             W  requestLayout() improperly called by androidx.appcompat.widget.AppCompatTextView{ceeca37 V.ED..... ......ID 44,40-220,114} during layout: running second layout pass
2024-09-28 09:30:11.503 18658-18849 Parcel                  net.gsantner.markor_test             W  Expecting binder but got null!
2024-09-28 09:30:11.505 18658-18658 Choreographer           net.gsantner.markor_test             I  Skipped 111 frames!  The application may be doing too much work on its main thread.
2024-09-28 09:30:11.526 18658-18688 OpenGLRenderer          net.gsantner.markor_test             I  Davey! duration=1873ms; Flags=1, FrameTimelineVsyncId=395103, IntendedVsync=9725057528089, Vsync=9725057528089, InputEventId=0, HandleInputStart=9725070965433, AnimationStart=9725070969823, PerformTraversalsStart=9725070972059, DrawStart=9726782853291, FrameDeadline=9725074194755, FrameInterval=9725070926933, FrameStartTime=16666666, SyncQueued=9726826573956, SyncStart=9726840215935, IssueDrawCommandsStart=9726844528756, SwapBuffers=9726928834556, FrameCompleted=9726944672279, DequeueBufferDuration=8840, QueueBufferDuration=3681482, GpuCompleted=9726944572570, SwapBuffersCompleted=9726944672279, DisplayPresentTime=0, CommandSubmissionCompleted=9726928834556, 
2024-09-28 09:30:11.618 18658-18679 ner.markor_test         net.gsantner.markor_test             I  Compiler allocated 4160KB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
2024-09-28 09:30:11.737 18658-18688 OpenGLRenderer          net.gsantner.markor_test             I  Davey! duration=2050ms; Flags=0, FrameTimelineVsyncId=395118, IntendedVsync=9725090861421, Vsync=9726940861347, InputEventId=0, HandleInputStart=9726951863731, AnimationStart=9726951866684, PerformTraversalsStart=9727101815438, DrawStart=9727108825338, FrameDeadline=9726974194679, FrameInterval=9726951722298, FrameStartTime=16666666, SyncQueued=9727128622818, SyncStart=9727144535382, IssueDrawCommandsStart=9727144701613, SwapBuffers=9727147004985, FrameCompleted=9727157704862, DequeueBufferDuration=6815, QueueBufferDuration=580594, GpuCompleted=9727157704862, SwapBuffersCompleted=9727148410718, DisplayPresentTime=0, CommandSubmissionCompleted=9727147004985, 
2024-09-28 09:30:13.120 18658-18849 EGL_emulation           net.gsantner.markor_test             D  app_time_stats: avg=231.74ms min=19.38ms max=895.80ms count=7
2024-09-28 09:30:13.246 18658-18658 AutofillManager         net.gsantner.markor_test             D  Fill dialog is enabled:false, hints=[password, passwordAuto, creditCardNumber, creditCardSecurityCode, creditCardExpirationDate]
2024-09-28 09:30:13.324 18658-18849 Parcel                  net.gsantner.markor_test             W  Expecting binder but got null!
2024-09-28 09:30:13.440 18658-18658 Compatibil...geReporter net.gsantner.markor_test             D  Compat change id reported: 163400105; UID 10176; state: ENABLED
2024-09-28 09:30:13.445 18658-18658 AssistStructure         net.gsantner.markor_test             I  Flattened final assist data: 3064 bytes, containing 1 windows, 17 views
2024-09-28 09:30:13.985 18658-18902 AndroidRuntime          net.gsantner.markor_test             E  FATAL EXCEPTION: pool-2-thread-1
                                                                                                    Process: net.gsantner.markor_test, PID: 18658
                                                                                                    android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
                                                                                                    	at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:9758)
                                                                                                    	at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1959)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at androidx.recyclerview.widget.RecyclerView.requestLayout(RecyclerView.java:4586)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at android.view.View.requestLayout(View.java:26281)
                                                                                                    	at androidx.recyclerview.widget.RecyclerView.requestLayout(RecyclerView.java:4586)
                                                                                                    	at androidx.recyclerview.widget.RecyclerView$LayoutManager.requestLayout(RecyclerView.java:8158)
                                                                                                    	at androidx.recyclerview.widget.LinearLayoutManager.scrollToPosition(LinearLayoutManager.java:1083)
                                                                                                    	at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.scrollToAndFlash(GsFileBrowserListAdapter.java:636)
                                                                                                    	at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter._loadFolder(GsFileBrowserListAdapter.java:785)
                                                                                                    	at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter.lambda$loadFolder$5$net-gsantner-opoc-frontend-filebrowser-GsFileBrowserListAdapter(GsFileBrowserListAdapter.java:689)
                                                                                                    	at net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter$$ExternalSyntheticLambda7.run(D8$$SyntheticClass:0)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2024-09-28 09:30:14.005 18658-18902 Process                 net.gsantner.markor_test             I  Sending signal. PID: 18658 SIG: 9

Information

Android version: 13
Device: Pixel 4a
App Version: master as of 26th Sep 2024

Source

git master branch

Format / File type

Not specific

Additional info / Log

-
@elyahw
Copy link
Contributor Author

elyahw commented Sep 28, 2024

It can be solved by disabling this line:

https://github.com/gsantner/markor/blob/master/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java#L777

I'm still unsure yet how to properly fix it..

@gsantner
Copy link
Owner

gsantner commented Sep 29, 2024 via email

@harshad1
Copy link
Collaborator

Does this happen every time?

How do you open the file? File browser or shortcut?

@elyahw
Copy link
Contributor Author

elyahw commented Sep 30, 2024

Yes, this is reproducible every time. I open the file by tapping on it from the files browser. I think the try catch guard suggestion by gsantner would work.. I will attempt it soon..

@harshad1
Copy link
Collaborator

harshad1 commented Oct 1, 2024

I have a PR for this. It was due to missing a post()

I think a try / catch would have still caused a crash or resulted in a bad state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants