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

[GTK] [Pango] [Raspberry Pi] Background task is crashing #30

Open
ZeProgFactory opened this issue Feb 21, 2021 · 0 comments
Open

[GTK] [Pango] [Raspberry Pi] Background task is crashing #30

ZeProgFactory opened this issue Feb 21, 2021 · 0 comments

Comments

@ZeProgFactory
Copy link
Contributor

I made a simple program displaying the current time:

         Device.StartTimer(new TimeSpan(0, 0, 1), () =>
         {
            // do something every 1 seconds
            Device.BeginInvokeOnMainThread(() =>
            {
               // interact with UI elements
               label.Text = DateTime.Now.ToString("HH:mm:ss");

            });

            return true; // runs again, or false to stop
         });

The program is running for about 15 minutes without problems

before crushing:

free(): invalid pointer
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Pango.FontDescription.pango_font_description_free (intptr) <0x00037>
  at Pango.FontDescription.Free (intptr) [0x00000] in <b785bf3027ba4410ae7cbbd62d603584>:0
  at GLib.Opaque.set_Raw (intptr) [0x00033] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at GLib.Opaque.PerformQueuedFrees () [0x00054] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at GLib.Timeout/TimeoutProxy.Invoke (intptr) [0x00001] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at GLib.SourceProxy.HandlerInternal (intptr) [0x00002] in <d973ca9f8b494b789fba7fe0ad040b14>:0
  at (wrapper native-to-managed) GLib.SourceProxy.HandlerInternal (intptr) <0x00073>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00033>
  at Gtk.Application.Run () [0x00001] in <35293b6aa2744433b0e2f41f34e699d5>:0
  at Test.GTK.MainClass.Main (string[]) [0x00043] in <0cdcb7f5c60e423aa1e8a3b7f65e3344>:0
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x0004e] in <0cdcb7f5c60e423aa1e8a3b7f65e3344>:0
/proc/self/maps:
00010000-003d7000 r-xp 00000000 08:02 1456761    /usr/bin/mono-sgen
003e6000-003ea000 r--p 003c6000 08:02 1456761    /usr/bin/mono-sgen
003ea000-003ee000 rw-p 003ca000 08:02 1456761    /usr/bin/mono-sgen
003ee000-00474000 rw-p 00000000 00:00 0 
00e9e000-01527000 rw-p 00000000 00:00 0          [heap]
b248c000-b249c000 rwxp 00000000 00:00 0 
b249c000-b251c000 rw-p 00000000 00:00 0 
b2524000-b25a8000 rw-p 00000000 00:00 0 
b25ac000-b25b2000 rw-p 00000000 00:00 0 
b25b4000-b25d4000 rwxp 00000000 00:00 0 
b25d4000-b25d6000 rw-p 00000000 00:00 0 
b25d8000-b25dc000 rw-p 00000000 00:00 0 
b25dc000-b25ec000 rwxp 00000000 00:00 0 
b25ec000-b25f0000 r-xp 00000000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b25f0000-b25ff000 ---p 00004000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b25ff000-b2600000 r--p 00003000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b2600000-b2601000 rw-p 00004000 08:02 1709169    /usr/lib/cli/gdk-sharp-2.0/libgdksharpglue-2.so
b2601000-b2611000 rwxp 00000000 00:00 0 
b2611000-b2613000 r-xp 00000000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2613000-b2622000 ---p 00002000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2622000-b2623000 r--p 00001000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2623000-b2624000 rw-p 00002000 08:02 143130     /usr/lib/cli/pango-sharp-2.0/libpangosharpglue-2.so
b2624000-b2649000 r--p 00000000 08:02 269382     /usr/share/fonts/truetype/piboto/PibotoLt-Regular.ttf
b2649000-b2653000 r--s 00000000 08:02 915836     /var/cache/fontconfig/3e18a00a-59c6-4373-b1c9-32ba94e06564-le32d8.cache-7
b2653000-b2665000 r--s 00000000 08:02 915850     /var/cache/fontconfig/e193c6f4-6b1a-409f-86ed-d89899844414-le32d8.cache-7
Memory around native instruction pointer (0xb6ca6f24):
0xb6ca6f14  00 20 a0 e3 08 30 a0 e3 af 70 a0 e3 00 00 00 ef  . ...0...p......
0xb6ca6f24  04 21 9d e5 00 30 94 e5 0c 00 a0 e1 03 00 52 e1  .!...0........R.
0xb6ca6f34  08 00 00 1a 43 df 8d e2 f0 80 bd e8 24 30 9f e5  ....C.......$0..
0xb6ca6f44  00 20 60 e2 e8 ae ff eb 03 30 9f e7 00 c0 e0 e3  . `......0......

Native stacktrace:

Pkilling 0xb673f460 from 0xb6f21210
Entering thread summarizer pause from 0xb6f21210
Finished thread summarizer pause from 0xb6f21210.

Waiting for dumping threads to resume


Debug info from gdb:

[New LWP 3741]
[New LWP 3742]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
__waitpid (options=0, stat_loc=0xbee93b48, pid=3774) at ../sysdeps/unix/sysv/linux/waitpid.c:30
30	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id                                  Frame 
* 1    Thread 0xb6f21210 (LWP 3740) "mono"        __waitpid (options=0, stat_loc=0xbee93b48, pid=3774) at ../sysdeps/unix/sysv/linux/waitpid.c:30
  2    Thread 0xb5fff460 (LWP 3741) "SGen worker" futex_wait_cancelable (private=0, expected=0, futex_word=0x3f8c58) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  3    Thread 0xb673f460 (LWP 3742) "Finalizer"   0xb6e06088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0x3f0ee0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

Thread 3 (Thread 0xb673f460 (LWP 3742)):
#0  0xb6e06088 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=1, futex_word=0x3f0ee0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x3f0ee0, abstime=0x0) at sem_waitcommon.c:115
#2  0xb6e061f4 in __new_sem_wait_slow (sem=0x3f0ee0, abstime=0x0) at sem_waitcommon.c:282
#3  0x00281488 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xb5fff460 (LWP 3741)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x3f8c58) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x0, cond=0x3f8c30) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x3f8c30, mutex=0x0) at pthread_cond_wait.c:655
#3  0x002ed600 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xb6f21210 (LWP 3740)):
#0  __waitpid (options=0, stat_loc=0xbee93b48, pid=3774) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  __waitpid (pid=3774, stat_loc=0xbee93b48, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
#2  0x0010225c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
[Inferior 1 (process 3740) detached]

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted

Sample project:
XF.GTK.zip

ZeProgFactory added a commit to ZeProgFactory/RaspberryPi that referenced this issue Feb 22, 2021
@ZeProgFactory ZeProgFactory changed the title [GTK] [Pango] [Raspberry Pi] Problem with background tasks [GTK] [Pango] [Raspberry Pi] Background task is crashing Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant