Open ghost opened 3 years ago
Thanks for the report, I had already seen a few of these errors but wasn't sure where they were coming from. I'll investigate what's going on.
https://github.com/romgrk/node-gtk/issues/213
The error does not occur as a result of trying "G_SLICE=always-malloc", the solution in the above article.
Got it. We can probably skip the issue by using malloc
directly rather than g_slice_alloc
.
Update on this, it seems that we had already migrated away from g_slice_alloc
to malloc
.
https://github.com/romgrk/node-gtk/blob/c3dc55d7a6242801187f83fc068c1f74d34fead8/src/boxed.cc#L186
This is bad news because it means the bug is upstream. After some debugging, it appears that GLib's slice allocator is choking at various points in this method, usually when handling the SlabInfo struct:
https://github.com/GNOME/glib/blob/c0b339372cf3cf29cc8fee212a2debc41ea93cd2/glib/gslice.c#L1386
Here is one place where it aborts:
https://github.com/GNOME/glib/blob/c0b339372cf3cf29cc8fee212a2debc41ea93cd2/glib/gslice.c#L1398
I'll see if I can get some feedback from GLib or I'll open an issue with them soon.
When I run the code below, I get an error about 70000 iterations.
Output 1: .... 76352 76353 76354 76355 76356 76357 Segmentation fault $
Output 2: .... 71441 71442 71443 71444 71445 71446 71447 71448
MEMORY-ERROR: [16117]: GSlice: assertion failed: sinfo->n_allocated > 0 Aborted $