Comment on attachment 8626818
0001-Bug-833117-Replace-g_slice_set_config-with-G_SLICE-e.patch

>+    // Keep the original value of the G_SLICE env variable to restore it once
>+    // we're done.
>+    mGSlice = getenv("G_SLICE");

I don't think we should assume it is safe to use mGSlice later.

man 3p getenv
"The returned string pointer might be invalidated or the string content might
be overwritten by a subsequent call to getenv(), setenv(), unsetenv(), or (if
supported) putenv()"

>+    // Disable the slice allocator, since jemalloc already uses similar layout
>+    // algorithms, and using a sub-allocator tends to increase fragmentation.
>+    // This must be done before g_thread_init() is called.
>+    setenv("G_SLICE", "always-malloc", 1);

I had intentionally chosen not to override an existing G_SLICE environment
variable so that this could be overridden or debug-blocks could be used if
desired.  That's not a show-stopper, but avoiding overriding would avoid
having to copy the old value to restore.

I don't know why you are preferring setenv over putenv here.
I had chosen putenv to avoid the leak.

There is discussion about possible getenv optimizations if putenv is not used,
but I don't see this in glibc.

> +      void (*g_thread_init)(void*) = (void (*)(void*)) GetSymbol(

Declare with "auto" type, if you like.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1160569

Title:
  GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0'
  failed

To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1160569/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to