Segfault with matplotlib and pyroot


Please read tips for efficient and successful posting and posting code

Describe the bug

Running the below snippet with any root file I’ve tried so far produces a segfault (see below for terminal output).

Expected behavior

Script runs and a histogram is produced

To Reproduce

import ROOT
import matplotlib.pyplot as plt
import numpy as np

df = ROOT.RDataFrame("DataRaw/DataPixel", "Readout_1885.root")
col, row = df.AsNumpy(["col","row"]).values()

plt.hist2d(col,row)

Setup

ROOT v6.40.02
Built for linuxx8664gcc on Jun 14 2026, 18:41:12
From tags/6-40-02@6-40-02
With c++ (GCC) 16.1.1 20260430 std202002
Binary directory: /usr/bin

Root installed from Arch Linux repositories, python 3.14.6 also from said repos

Additional context

Our Readout_xxxx.root files have a TTree with the data in TBranches, reading it out into an RDataFrame is just easier for plotting using native python.

Plotting in “pure” pyroot (ROOT.TFile, TFile.Get() all that jazz) works fine

This only started being an issue after I reinstalled my system a couple weeks back, before that I had no issue running my above code, even though afaict it should be the same versions of everything (didn’t switch linux distro, just reinstalled it). It is not an issue on our lab computers with Ubuntu 24.04 and Python 3.12, just my personal laptop.

I checked which Python version ROOT was compiled for (3.14.5), but reverting to that version did not resolve the issue. Downgrading to ROOT v6.40.00 also does not help. I asked two weeks ago in Newbie (Segfault with pyroot and matplotlib), where I got that advice, but thought I’d ask here as well.

Terminal output when running the above segment
Python 3.14.6 (main, Jun 15 2026, 11:36:54) [GCC 16.1.1 20260430] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> df = ROOT.RDataFrame("DataRaw/DataPixel", "Readout_1885.root")
>>> col,row = df.AsNumpy(["col","row"]).values()
>>> plt.hist2d(col,row)
 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 6 (Thread 0x7fdb50fff6c0 (LWP 233410) "pool-spawner"):
#0  0x00007fdb77919c5d in syscall () at /usr/lib/libc.so.6
#1  0x00007fdb578310de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2  0x00007fdb577c654d in ??? () at /usr/lib/libglib-2.0.so.0
#3  0x00007fdb5783afd7 in ??? () at /usr/lib/libglib-2.0.so.0
#4  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#6  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7fdb507fe6c0 (LWP 233411) "gmain"):
#0  0x00007fdb7789fff2 in ??? () at /usr/lib/libc.so.6
#1  0x00007fdb7789403c in ??? () at /usr/lib/libc.so.6
#2  0x00007fdb77894084 in ??? () at /usr/lib/libc.so.6
#3  0x00007fdb7790ecb6 in ppoll () at /usr/lib/libc.so.6
#4  0x00007fdb57803edf in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb57803fe5 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb57804032 in ??? () at /usr/lib/libglib-2.0.so.0
#7  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#9  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fdb4fffd6c0 (LWP 233412) "gdbus"):
#0  0x00007fdb7789fff2 in ??? () at /usr/lib/libc.so.6
#1  0x00007fdb7789403c in ??? () at /usr/lib/libc.so.6
#2  0x00007fdb77894084 in ??? () at /usr/lib/libc.so.6
#3  0x00007fdb7790ecb6 in ppoll () at /usr/lib/libc.so.6
#4  0x00007fdb57803edf in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb578041a7 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb56269974 in ??? () at /usr/lib/libgio-2.0.so.0
#7  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#9  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7fdb4f7fc6c0 (LWP 233413) "[pango] fontcon"):
#0  0x00007fdb77919c5d in syscall () at /usr/lib/libc.so.6
#1  0x00007fdb578310de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2  0x00007fdb577c654d in ??? () at /usr/lib/libglib-2.0.so.0
#3  0x00007fdb577c65c6 in g_async_queue_pop () at /usr/lib/libglib-2.0.so.0
#4  0x00007fdb5578d661 in ??? () at /usr/lib/libpangoft2-1.0.so.0
#5  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#7  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7fdb4eee36c0 (LWP 233415) "pool-0"):
#0  0x00007fdb77919c5d in syscall () at /usr/lib/libc.so.6
#1  0x00007fdb57831f1c in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
#2  0x00007fdb577c6517 in ??? () at /usr/lib/libglib-2.0.so.0
#3  0x00007fdb5783bebb in ??? () at /usr/lib/libglib-2.0.so.0
#4  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#6  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7fdb78298bc0 (LWP 232962) "python"):
#0  0x00007fdb7789fff2 in ??? () at /usr/lib/libc.so.6
#1  0x00007fdb7789403c in ??? () at /usr/lib/libc.so.6
#2  0x00007fdb77894084 in ??? () at /usr/lib/libc.so.6
#3  0x00007fdb7790494f in wait4 () at /usr/lib/libc.so.6
#4  0x00007fdb77853f6d in ??? () at /usr/lib/libc.so.6
#5  0x00007fdb71fb1f06 in TUnixSystem::StackTrace() () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#6  0x00007fdb7228ff68 in ??? () at /usr/lib/python3.14/site-packages/cppyy/../libCPyCppyy.so
#7  0x00007fdb71fb12c9 in TUnixSystem::DispatchSignals(ESignals) () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#8  0x00007fdb7783e270 in <signal handler called> () at /usr/lib/libc.so.6
#9  0x00005557154bebc0 in ??? ()
#10 0x00007fdb738f999b in hb_face_reference_table () at /usr/lib/python3.14/site-packages/matplotlib/ft2font.cpython-314-x86_64-linux-gnu.so
#11 0x00007fdb55d753da in ??? () at /usr/lib/libharfbuzz.so.0
#12 0x00007fdb55d75c64 in hb_ot_color_has_paint () at /usr/lib/libharfbuzz.so.0
#13 0x00007fdb55eaa132 in ??? () at /usr/lib/libpango-1.0.so.0
#14 0x00007fdb55eaadf8 in ??? () at /usr/lib/libpango-1.0.so.0
#15 0x00007fdb55eab6b5 in pango_shape_item () at /usr/lib/libpango-1.0.so.0
#16 0x00007fdb55e92436 in ??? () at /usr/lib/libpango-1.0.so.0
#17 0x00007fdb55e93a02 in ??? () at /usr/lib/libpango-1.0.so.0
#18 0x00007fdb55e96052 in ??? () at /usr/lib/libpango-1.0.so.0
#19 0x00007fdb55e99a67 in ??? () at /usr/lib/libpango-1.0.so.0
#20 0x00007fdb55c05e92 in ??? () at /usr/lib/libpangocairo-1.0.so.0
#21 0x00007fdb55e80456 in ??? () at /usr/lib/libpango-1.0.so.0
#22 0x00007fdb55795b2c in ??? () at /usr/lib/libpangoft2-1.0.so.0
#23 0x00007fdb55e8c010 in pango_context_get_metrics () at /usr/lib/libpango-1.0.so.0
#24 0x00007fdb54d691a9 in ??? () at /usr/lib/libgtk-4.so.1
#25 0x00007fdb54d6dd94 in ??? () at /usr/lib/libgtk-4.so.1
#26 0x00007fdb54e138be in ??? () at /usr/lib/libgtk-4.so.1
#27 0x00007fdb54cbd429 in ??? () at /usr/lib/libgtk-4.so.1
#28 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#29 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#30 0x00007fdb54ccc797 in ??? () at /usr/lib/libgtk-4.so.1
#31 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#32 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#33 0x00007fdb54e14124 in gtk_widget_get_preferred_size () at /usr/lib/libgtk-4.so.1
#34 0x00007fdb770cb1d6 in ??? () at /usr/lib/libffi.so.8
#35 0x00007fdb770c79ad in ??? () at /usr/lib/libffi.so.8
#36 0x00007fdb770ca7ce in ffi_call () at /usr/lib/libffi.so.8
#37 0x00007fdb710edbd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#38 0x00007fdb710e33ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#39 0x00007fdb77c5dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#40 0x00007fdb77dee47f in ??? () at /usr/lib/libpython3.14.so.1.0
#41 0x00007fdb77da4d8a in ??? () at /usr/lib/libpython3.14.so.1.0
#42 0x00007fdb77c5e496 in ??? () at /usr/lib/libpython3.14.so.1.0
#43 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#44 0x00007fdb77e34e3e in ??? () at /usr/lib/libpython3.14.so.1.0
#45 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#46 0x00007fdb77c652f2 in ??? () at /usr/lib/libpython3.14.so.1.0
#47 0x00007fdb77db7952 in ??? () at /usr/lib/libpython3.14.so.1.0
#48 0x00007fdb77eba2c4 in PyEval_EvalCode () at /usr/lib/libpython3.14.so.1.0
#49 0x00007fdb77edd976 in ??? () at /usr/lib/libpython3.14.so.1.0
#50 0x00007fdb77c6844a in ??? () at /usr/lib/libpython3.14.so.1.0
#51 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#52 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#53 0x00007fdb77d6bbea in ??? () at /usr/lib/libpython3.14.so.1.0
#54 0x00007fdb77c41cea in ??? () at /usr/lib/libpython3.14.so.1.0
#55 0x00007fdb77ea1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#56 0x00007fdb77827741 in ??? () at /usr/lib/libc.so.6
#57 0x00007fdb77827879 in __libc_start_main () at /usr/lib/libc.so.6
#58 0x00005556cd15a045 in _start ()
===========================================================


The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#9  0x00005557154bebc0 in ??? ()
#10 0x00007fdb738f999b in hb_face_reference_table () at /usr/lib/python3.14/site-packages/matplotlib/ft2font.cpython-314-x86_64-linux-gnu.so
#11 0x00007fdb55d753da in ??? () at /usr/lib/libharfbuzz.so.0
#12 0x00007fdb55d75c64 in hb_ot_color_has_paint () at /usr/lib/libharfbuzz.so.0
#13 0x00007fdb55eaa132 in ??? () at /usr/lib/libpango-1.0.so.0
#14 0x00007fdb55eaadf8 in ??? () at /usr/lib/libpango-1.0.so.0
#15 0x00007fdb55eab6b5 in pango_shape_item () at /usr/lib/libpango-1.0.so.0
#16 0x00007fdb55e92436 in ??? () at /usr/lib/libpango-1.0.so.0
#17 0x00007fdb55e93a02 in ??? () at /usr/lib/libpango-1.0.so.0
#18 0x00007fdb55e96052 in ??? () at /usr/lib/libpango-1.0.so.0
#19 0x00007fdb55e99a67 in ??? () at /usr/lib/libpango-1.0.so.0
#20 0x00007fdb55c05e92 in ??? () at /usr/lib/libpangocairo-1.0.so.0
#21 0x00007fdb55e80456 in ??? () at /usr/lib/libpango-1.0.so.0
#22 0x00007fdb55795b2c in ??? () at /usr/lib/libpangoft2-1.0.so.0
#23 0x00007fdb55e8c010 in pango_context_get_metrics () at /usr/lib/libpango-1.0.so.0
#24 0x00007fdb54d691a9 in ??? () at /usr/lib/libgtk-4.so.1
#25 0x00007fdb54d6dd94 in ??? () at /usr/lib/libgtk-4.so.1
#26 0x00007fdb54e138be in ??? () at /usr/lib/libgtk-4.so.1
#27 0x00007fdb54cbd429 in ??? () at /usr/lib/libgtk-4.so.1
#28 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#29 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#30 0x00007fdb54ccc797 in ??? () at /usr/lib/libgtk-4.so.1
#31 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#32 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#33 0x00007fdb54e14124 in gtk_widget_get_preferred_size () at /usr/lib/libgtk-4.so.1
#34 0x00007fdb770cb1d6 in ??? () at /usr/lib/libffi.so.8
#35 0x00007fdb770c79ad in ??? () at /usr/lib/libffi.so.8
#36 0x00007fdb770ca7ce in ffi_call () at /usr/lib/libffi.so.8
#37 0x00007fdb710edbd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#38 0x00007fdb710e33ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#39 0x00007fdb77c5dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#40 0x00007fdb77dee47f in ??? () at /usr/lib/libpython3.14.so.1.0
#41 0x00007fdb77da4d8a in ??? () at /usr/lib/libpython3.14.so.1.0
#42 0x00007fdb77c5e496 in ??? () at /usr/lib/libpython3.14.so.1.0
#43 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#44 0x00007fdb77e34e3e in ??? () at /usr/lib/libpython3.14.so.1.0
#45 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#46 0x00007fdb77c652f2 in ??? () at /usr/lib/libpython3.14.so.1.0
#47 0x00007fdb77db7952 in ??? () at /usr/lib/libpython3.14.so.1.0
#48 0x00007fdb77eba2c4 in PyEval_EvalCode () at /usr/lib/libpython3.14.so.1.0
#49 0x00007fdb77edd976 in ??? () at /usr/lib/libpython3.14.so.1.0
#50 0x00007fdb77c6844a in ??? () at /usr/lib/libpython3.14.so.1.0
#51 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#52 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#53 0x00007fdb77d6bbea in ??? () at /usr/lib/libpython3.14.so.1.0
#54 0x00007fdb77c41cea in ??? () at /usr/lib/libpython3.14.so.1.0
#55 0x00007fdb77ea1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#56 0x00007fdb77827741 in ??? () at /usr/lib/libc.so.6
#57 0x00007fdb77827879 in __libc_start_main () at /usr/lib/libc.so.6
#58 0x00005556cd15a045 in _start ()
===========================================================


 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

Thread 6 (Thread 0x7fdb50fff6c0 (LWP 233410) "pool-spawner"):
#0  0x00007fdb77919c5d in syscall () at /usr/lib/libc.so.6
#1  0x00007fdb578310de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2  0x00007fdb577c654d in ??? () at /usr/lib/libglib-2.0.so.0
#3  0x00007fdb5783afd7 in ??? () at /usr/lib/libglib-2.0.so.0
#4  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#6  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7fdb507fe6c0 (LWP 233411) "gmain"):
#0  0x00007fdb7789fff2 in ??? () at /usr/lib/libc.so.6
#1  0x00007fdb7789403c in ??? () at /usr/lib/libc.so.6
#2  0x00007fdb77894084 in ??? () at /usr/lib/libc.so.6
#3  0x00007fdb7790ecb6 in ppoll () at /usr/lib/libc.so.6
#4  0x00007fdb57803edf in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb57803fe5 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb57804032 in ??? () at /usr/lib/libglib-2.0.so.0
#7  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#9  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fdb4fffd6c0 (LWP 233412) "gdbus"):
#0  0x00007fdb7789fff2 in ??? () at /usr/lib/libc.so.6
#1  0x00007fdb7789403c in ??? () at /usr/lib/libc.so.6
#2  0x00007fdb77894084 in ??? () at /usr/lib/libc.so.6
#3  0x00007fdb7790ecb6 in ppoll () at /usr/lib/libc.so.6
#4  0x00007fdb57803edf in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb578041a7 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb56269974 in ??? () at /usr/lib/libgio-2.0.so.0
#7  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#9  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7fdb4f7fc6c0 (LWP 233413) "[pango] fontcon"):
#0  0x00007fdb77919c5d in syscall () at /usr/lib/libc.so.6
#1  0x00007fdb578310de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2  0x00007fdb577c654d in ??? () at /usr/lib/libglib-2.0.so.0
#3  0x00007fdb577c65c6 in g_async_queue_pop () at /usr/lib/libglib-2.0.so.0
#4  0x00007fdb5578d661 in ??? () at /usr/lib/libpangoft2-1.0.so.0
#5  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#7  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7fdb4eee36c0 (LWP 233415) "pool-0"):
#0  0x00007fdb77919c5d in syscall () at /usr/lib/libc.so.6
#1  0x00007fdb57831f1c in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
#2  0x00007fdb577c6517 in ??? () at /usr/lib/libglib-2.0.so.0
#3  0x00007fdb577c668f in g_async_queue_timeout_pop () at /usr/lib/libglib-2.0.so.0
#4  0x00007fdb5783bdf1 in ??? () at /usr/lib/libglib-2.0.so.0
#5  0x00007fdb5783aad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6  0x00007fdb77897739 in ??? () at /usr/lib/libc.so.6
#7  0x00007fdb7791bedc in ??? () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7fdb78298bc0 (LWP 232962) "python"):
#0  0x00007fdb7789fff2 in ??? () at /usr/lib/libc.so.6
#1  0x00007fdb7789403c in ??? () at /usr/lib/libc.so.6
#2  0x00007fdb77894084 in ??? () at /usr/lib/libc.so.6
#3  0x00007fdb7790494f in wait4 () at /usr/lib/libc.so.6
#4  0x00007fdb77853f6d in ??? () at /usr/lib/libc.so.6
#5  0x00007fdb71fb1f06 in TUnixSystem::StackTrace() () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#6  0x00007fdb7228fe23 in ??? () at /usr/lib/python3.14/site-packages/cppyy/../libCPyCppyy.so
#7  0x00007fdb71fb12c9 in TUnixSystem::DispatchSignals(ESignals) () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#8  0x00007fdb7783e270 in <signal handler called> () at /usr/lib/libc.so.6
#9  0x00005557154bebc0 in ??? ()
#10 0x00007fdb738f999b in hb_face_reference_table () at /usr/lib/python3.14/site-packages/matplotlib/ft2font.cpython-314-x86_64-linux-gnu.so
#11 0x00007fdb55d753da in ??? () at /usr/lib/libharfbuzz.so.0
#12 0x00007fdb55d75c64 in hb_ot_color_has_paint () at /usr/lib/libharfbuzz.so.0
#13 0x00007fdb55eaa132 in ??? () at /usr/lib/libpango-1.0.so.0
#14 0x00007fdb55eaadf8 in ??? () at /usr/lib/libpango-1.0.so.0
#15 0x00007fdb55eab6b5 in pango_shape_item () at /usr/lib/libpango-1.0.so.0
#16 0x00007fdb55e92436 in ??? () at /usr/lib/libpango-1.0.so.0
#17 0x00007fdb55e93a02 in ??? () at /usr/lib/libpango-1.0.so.0
#18 0x00007fdb55e96052 in ??? () at /usr/lib/libpango-1.0.so.0
#19 0x00007fdb55e99a67 in ??? () at /usr/lib/libpango-1.0.so.0
#20 0x00007fdb55c05e92 in ??? () at /usr/lib/libpangocairo-1.0.so.0
#21 0x00007fdb55e80456 in ??? () at /usr/lib/libpango-1.0.so.0
#22 0x00007fdb55795b2c in ??? () at /usr/lib/libpangoft2-1.0.so.0
#23 0x00007fdb55e8c010 in pango_context_get_metrics () at /usr/lib/libpango-1.0.so.0
#24 0x00007fdb54d691a9 in ??? () at /usr/lib/libgtk-4.so.1
#25 0x00007fdb54d6dd94 in ??? () at /usr/lib/libgtk-4.so.1
#26 0x00007fdb54e138be in ??? () at /usr/lib/libgtk-4.so.1
#27 0x00007fdb54cbd429 in ??? () at /usr/lib/libgtk-4.so.1
#28 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#29 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#30 0x00007fdb54ccc797 in ??? () at /usr/lib/libgtk-4.so.1
#31 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#32 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#33 0x00007fdb54e14124 in gtk_widget_get_preferred_size () at /usr/lib/libgtk-4.so.1
#34 0x00007fdb770cb1d6 in ??? () at /usr/lib/libffi.so.8
#35 0x00007fdb770c79ad in ??? () at /usr/lib/libffi.so.8
#36 0x00007fdb770ca7ce in ffi_call () at /usr/lib/libffi.so.8
#37 0x00007fdb710edbd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#38 0x00007fdb710e33ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#39 0x00007fdb77c5dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#40 0x00007fdb77dee47f in ??? () at /usr/lib/libpython3.14.so.1.0
#41 0x00007fdb77da4d8a in ??? () at /usr/lib/libpython3.14.so.1.0
#42 0x00007fdb77c5e496 in ??? () at /usr/lib/libpython3.14.so.1.0
#43 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#44 0x00007fdb77e34e3e in ??? () at /usr/lib/libpython3.14.so.1.0
#45 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#46 0x00007fdb77c652f2 in ??? () at /usr/lib/libpython3.14.so.1.0
#47 0x00007fdb77db7952 in ??? () at /usr/lib/libpython3.14.so.1.0
#48 0x00007fdb77eba2c4 in PyEval_EvalCode () at /usr/lib/libpython3.14.so.1.0
#49 0x00007fdb77edd976 in ??? () at /usr/lib/libpython3.14.so.1.0
#50 0x00007fdb77c6844a in ??? () at /usr/lib/libpython3.14.so.1.0
#51 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#52 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#53 0x00007fdb77d6bbea in ??? () at /usr/lib/libpython3.14.so.1.0
#54 0x00007fdb77c41cea in ??? () at /usr/lib/libpython3.14.so.1.0
#55 0x00007fdb77ea1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#56 0x00007fdb77827741 in ??? () at /usr/lib/libc.so.6
#57 0x00007fdb77827879 in __libc_start_main () at /usr/lib/libc.so.6
#58 0x00005556cd15a045 in _start ()
===========================================================


The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#9  0x00005557154bebc0 in ??? ()
#10 0x00007fdb738f999b in hb_face_reference_table () at /usr/lib/python3.14/site-packages/matplotlib/ft2font.cpython-314-x86_64-linux-gnu.so
#11 0x00007fdb55d753da in ??? () at /usr/lib/libharfbuzz.so.0
#12 0x00007fdb55d75c64 in hb_ot_color_has_paint () at /usr/lib/libharfbuzz.so.0
#13 0x00007fdb55eaa132 in ??? () at /usr/lib/libpango-1.0.so.0
#14 0x00007fdb55eaadf8 in ??? () at /usr/lib/libpango-1.0.so.0
#15 0x00007fdb55eab6b5 in pango_shape_item () at /usr/lib/libpango-1.0.so.0
#16 0x00007fdb55e92436 in ??? () at /usr/lib/libpango-1.0.so.0
#17 0x00007fdb55e93a02 in ??? () at /usr/lib/libpango-1.0.so.0
#18 0x00007fdb55e96052 in ??? () at /usr/lib/libpango-1.0.so.0
#19 0x00007fdb55e99a67 in ??? () at /usr/lib/libpango-1.0.so.0
#20 0x00007fdb55c05e92 in ??? () at /usr/lib/libpangocairo-1.0.so.0
#21 0x00007fdb55e80456 in ??? () at /usr/lib/libpango-1.0.so.0
#22 0x00007fdb55795b2c in ??? () at /usr/lib/libpangoft2-1.0.so.0
#23 0x00007fdb55e8c010 in pango_context_get_metrics () at /usr/lib/libpango-1.0.so.0
#24 0x00007fdb54d691a9 in ??? () at /usr/lib/libgtk-4.so.1
#25 0x00007fdb54d6dd94 in ??? () at /usr/lib/libgtk-4.so.1
#26 0x00007fdb54e138be in ??? () at /usr/lib/libgtk-4.so.1
#27 0x00007fdb54cbd429 in ??? () at /usr/lib/libgtk-4.so.1
#28 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#29 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#30 0x00007fdb54ccc797 in ??? () at /usr/lib/libgtk-4.so.1
#31 0x00007fdb54d79981 in gtk_layout_manager_measure () at /usr/lib/libgtk-4.so.1
#32 0x00007fdb54e13a86 in ??? () at /usr/lib/libgtk-4.so.1
#33 0x00007fdb54e14124 in gtk_widget_get_preferred_size () at /usr/lib/libgtk-4.so.1
#34 0x00007fdb770cb1d6 in ??? () at /usr/lib/libffi.so.8
#35 0x00007fdb770c79ad in ??? () at /usr/lib/libffi.so.8
#36 0x00007fdb770ca7ce in ffi_call () at /usr/lib/libffi.so.8
#37 0x00007fdb710edbd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#38 0x00007fdb710e33ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#39 0x00007fdb77c5dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#40 0x00007fdb77dee47f in ??? () at /usr/lib/libpython3.14.so.1.0
#41 0x00007fdb77da4d8a in ??? () at /usr/lib/libpython3.14.so.1.0
#42 0x00007fdb77c5e496 in ??? () at /usr/lib/libpython3.14.so.1.0
#43 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#44 0x00007fdb77e34e3e in ??? () at /usr/lib/libpython3.14.so.1.0
#45 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#46 0x00007fdb77c652f2 in ??? () at /usr/lib/libpython3.14.so.1.0
#47 0x00007fdb77db7952 in ??? () at /usr/lib/libpython3.14.so.1.0
#48 0x00007fdb77eba2c4 in PyEval_EvalCode () at /usr/lib/libpython3.14.so.1.0
#49 0x00007fdb77edd976 in ??? () at /usr/lib/libpython3.14.so.1.0
#50 0x00007fdb77c6844a in ??? () at /usr/lib/libpython3.14.so.1.0
#51 0x00007fdb77de346b in ??? () at /usr/lib/libpython3.14.so.1.0
#52 0x00007fdb77dfe2a9 in ??? () at /usr/lib/libpython3.14.so.1.0
#53 0x00007fdb77d6bbea in ??? () at /usr/lib/libpython3.14.so.1.0
#54 0x00007fdb77c41cea in ??? () at /usr/lib/libpython3.14.so.1.0
#55 0x00007fdb77ea1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#56 0x00007fdb77827741 in ??? () at /usr/lib/libc.so.6
#57 0x00007fdb77827879 in __libc_start_main () at /usr/lib/libc.so.6
#58 0x00005556cd15a045 in _start ()
===========================================================

Maybe @vpadulan can take a look?

Dear @nwin ,

Thanks for reaching out to the forum! Let me try and see if I can help.

First, would you be able to share the input file? That way I can try to reproduce your problem on my side.

If that’s not possible, could I ask you to report some more information, i.e.:

  • df.GetColumnType("col") and df.GetColumnType("row")?
  • type(col) and type(row)
  • Calling print(col) and print(row) before passing them to hist2d, and checking that the values make sense, e.g. the arrays have the right length, the values are not random or somehow wrong etc.

Cheers,
Vincenzo

Dear Vincenzo,

Thank you for helping out :slight_smile:
I sadly cannae send you the input file, but I can share the info you asked for:

>>> df.GetColumnType("col")
'UShort_t'
>>> df.GetColumnType("row")
'UShort_t'
>>> type(col)
<class 'ROOT._pythonization._rdf_utils.ndarray'>
>>> type(row)
<class 'ROOT._pythonization._rdf_utils.ndarray'>
>>> print(row)
[17 17 21 ...  1 21 19]
>>> print(col)
[26  4 24 ... 23 14  1]
>>> len(row)
2416278
>>> len(col)
2416278
>>> max(row)
np.uint16(22)
>>> max(col)
np.uint16(27)

The shape of the data seems to be exactly as expected, no random values, all within the bounds expected. (This file did also used to work just fine and I get the issue with any of my files)

Trying around again just now, I forgot to import numpy and pyplot before extracting the data, and didn’t get the segfault immediately on running plt.hist2d(col,row), only on exiting the python environment, and it only appears to happen then if I don’t plt.show() afterwards, I can plt.savefig() all I want, but plt.show() seems to be needed.

Edit: let me try to put that in a more useful way.
When the import statement for pyplot is placed behind the df.AsNumpy statement, running plt.hist2d no longer immediately segfaults, but segfaults when exit is run. If plt.show() is run before ending the pyplot session, no segfault occurs.

None of this makes sense to me why it would be like that…

Output on segfault this time ```python adMesh object at 0x7fdf32d6c2f0>) >>> exit

(process:306406): Gdk-CRITICAL **: 18:38:14.978: gdk_surface_get_display: assertion ‘GDK_IS_SURFACE (surface)’ failed
*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

Thread 6 (Thread 0x7fdf32cff6c0 (LWP 306848) “pool-spawner”):
#0 0x00007fdf59519c5d in syscall () at /usr/lib/libc.so.6
#1 0x00007fdf388270de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2 0x00007fdf387bc54d in ??? () at /usr/lib/libglib-2.0.so.0
#3 0x00007fdf38830fd7 in ??? () at /usr/lib/libglib-2.0.so.0
#4 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#6 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7fdf324fe6c0 (LWP 306849) “gmain”):
#0 0x00007fdf5949fff2 in ??? () at /usr/lib/libc.so.6
#1 0x00007fdf5949403c in ??? () at /usr/lib/libc.so.6
#2 0x00007fdf59494084 in ??? () at /usr/lib/libc.so.6
#3 0x00007fdf5950ecb6 in ppoll () at /usr/lib/libc.so.6
#4 0x00007fdf387f9edf in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf387f9fe5 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf387fa032 in ??? () at /usr/lib/libglib-2.0.so.0
#7 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#9 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fdf31cfd6c0 (LWP 306850) “gdbus”):
#0 0x00007fdf5949fff2 in ??? () at /usr/lib/libc.so.6
#1 0x00007fdf5949403c in ??? () at /usr/lib/libc.so.6
#2 0x00007fdf59494084 in ??? () at /usr/lib/libc.so.6
#3 0x00007fdf5950ecb6 in ppoll () at /usr/lib/libc.so.6
#4 0x00007fdf387f9edf in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf387fa1a7 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf37f7e974 in ??? () at /usr/lib/libgio-2.0.so.0
#7 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#9 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7fdf314fc6c0 (LWP 306851) “[pango] fontcon”):
#0 0x00007fdf59519c5d in syscall () at /usr/lib/libc.so.6
#1 0x00007fdf388270de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2 0x00007fdf387bc54d in ??? () at /usr/lib/libglib-2.0.so.0
#3 0x00007fdf387bc5c6 in g_async_queue_pop () at /usr/lib/libglib-2.0.so.0
#4 0x00007fdf37814661 in ??? () at /usr/lib/libpangoft2-1.0.so.0
#5 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#7 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7fdf30b756c0 (LWP 306853) “pool-0”):
#0 0x00007fdf59519c5d in syscall () at /usr/lib/libc.so.6
#1 0x00007fdf38827f1c in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
#2 0x00007fdf387bc517 in ??? () at /usr/lib/libglib-2.0.so.0
#3 0x00007fdf387bc68f in g_async_queue_timeout_pop () at /usr/lib/libglib-2.0.so.0
#4 0x00007fdf38831df1 in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#7 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7fdf59e88bc0 (LWP 306406) “python”):
#0 0x00007fdf5949fff2 in ??? () at /usr/lib/libc.so.6
#1 0x00007fdf5949403c in ??? () at /usr/lib/libc.so.6
#2 0x00007fdf59494084 in ??? () at /usr/lib/libc.so.6
#3 0x00007fdf5950494f in wait4 () at /usr/lib/libc.so.6
#4 0x00007fdf59453f6d in ??? () at /usr/lib/libc.so.6
#5 0x00007fdf55fb1f06 in TUnixSystem::StackTrace() () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#6 0x00007fdf563a7f68 in ??? () at /usr/lib/python3.14/site-packages/cppyy/../libCPyCppyy.so
#7 0x00007fdf55fb12c9 in TUnixSystem::DispatchSignals(ESignals) () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#8 0x00007fdf5943e270 in () at /usr/lib/libc.so.6
#9 0x00007fdf36bcab92 in ??? () at /usr/lib/libgtk-4.so.1
#10 0x00007fdf368adff4 in ??? () at /usr/lib/libgtk-4.so.1
#11 0x00007fdf3871966b in g_cclosure_marshal_VOID__OBJECTv () at /usr/lib/libgobject-2.0.so.0
#12 0x00007fdf3873cb7a in ??? () at /usr/lib/libgobject-2.0.so.0
#13 0x00007fdf3873ccd9 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#14 0x00007fdf3873cd94 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#15 0x00007fdf36af770a in gtk_window_destroy () at /usr/lib/libgtk-4.so.1
#16 0x00007fdf5967f1d6 in ??? () at /usr/lib/libffi.so.8
#17 0x00007fdf5967b9ad in ??? () at /usr/lib/libffi.so.8
#18 0x00007fdf5967e7ce in ffi_call () at /usr/lib/libffi.so.8
#19 0x00007fdf38926bd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#20 0x00007fdf3891c3ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#21 0x00007fdf5985dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#22 0x00007fdf599e346b in ??? () at /usr/lib/libpython3.14.so.1.0
#23 0x00007fdf59a34eae in ??? () at /usr/lib/libpython3.14.so.1.0
#24 0x00007fdf59b07450 in ??? () at /usr/lib/libpython3.14.so.1.0
#25 0x00007fdf59ae1232 in ??? () at /usr/lib/libpython3.14.so.1.0
#26 0x00007fdf59aa7f2a in Py_RunMain () at /usr/lib/libpython3.14.so.1.0
#27 0x00007fdf59aa1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#28 0x00007fdf59427741 in ??? () at /usr/lib/libc.so.6
#29 0x00007fdf59427879 in __libc_start_main () at /usr/lib/libc.so.6
#30 0x0000560ee5c11045 in _start ()

The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#9 0x00007fdf36bcab92 in ??? () at /usr/lib/libgtk-4.so.1
#10 0x00007fdf368adff4 in ??? () at /usr/lib/libgtk-4.so.1
#11 0x00007fdf3871966b in g_cclosure_marshal_VOID__OBJECTv () at /usr/lib/libgobject-2.0.so.0
#12 0x00007fdf3873cb7a in ??? () at /usr/lib/libgobject-2.0.so.0
#13 0x00007fdf3873ccd9 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#14 0x00007fdf3873cd94 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#15 0x00007fdf36af770a in gtk_window_destroy () at /usr/lib/libgtk-4.so.1
#16 0x00007fdf5967f1d6 in ??? () at /usr/lib/libffi.so.8
#17 0x00007fdf5967b9ad in ??? () at /usr/lib/libffi.so.8
#18 0x00007fdf5967e7ce in ffi_call () at /usr/lib/libffi.so.8
#19 0x00007fdf38926bd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#20 0x00007fdf3891c3ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#21 0x00007fdf5985dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#22 0x00007fdf599e346b in ??? () at /usr/lib/libpython3.14.so.1.0
#23 0x00007fdf59a34eae in ??? () at /usr/lib/libpython3.14.so.1.0
#24 0x00007fdf59b07450 in ??? () at /usr/lib/libpython3.14.so.1.0
#25 0x00007fdf59ae1232 in ??? () at /usr/lib/libpython3.14.so.1.0
#26 0x00007fdf59aa7f2a in Py_RunMain () at /usr/lib/libpython3.14.so.1.0
#27 0x00007fdf59aa1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#28 0x00007fdf59427741 in ??? () at /usr/lib/libc.so.6
#29 0x00007fdf59427879 in __libc_start_main () at /usr/lib/libc.so.6
#30 0x0000560ee5c11045 in _start ()

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

Thread 6 (Thread 0x7fdf32cff6c0 (LWP 306848) “pool-spawner”):
#0 0x00007fdf59519c5d in syscall () at /usr/lib/libc.so.6
#1 0x00007fdf388270de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2 0x00007fdf387bc54d in ??? () at /usr/lib/libglib-2.0.so.0
#3 0x00007fdf38830fd7 in ??? () at /usr/lib/libglib-2.0.so.0
#4 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#6 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7fdf324fe6c0 (LWP 306849) “gmain”):
#0 0x00007fdf5949fff2 in ??? () at /usr/lib/libc.so.6
#1 0x00007fdf5949403c in ??? () at /usr/lib/libc.so.6
#2 0x00007fdf59494084 in ??? () at /usr/lib/libc.so.6
#3 0x00007fdf5950ecb6 in ppoll () at /usr/lib/libc.so.6
#4 0x00007fdf387f9edf in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf387f9fe5 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf387fa032 in ??? () at /usr/lib/libglib-2.0.so.0
#7 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#9 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fdf31cfd6c0 (LWP 306850) “gdbus”):
#0 0x00007fdf5949fff2 in ??? () at /usr/lib/libc.so.6
#1 0x00007fdf5949403c in ??? () at /usr/lib/libc.so.6
#2 0x00007fdf59494084 in ??? () at /usr/lib/libc.so.6
#3 0x00007fdf5950ecb6 in ppoll () at /usr/lib/libc.so.6
#4 0x00007fdf387f9edf in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf387fa1a7 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf37f7e974 in ??? () at /usr/lib/libgio-2.0.so.0
#7 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#8 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#9 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7fdf314fc6c0 (LWP 306851) “[pango] fontcon”):
#0 0x00007fdf59519c5d in syscall () at /usr/lib/libc.so.6
#1 0x00007fdf388270de in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2 0x00007fdf387bc54d in ??? () at /usr/lib/libglib-2.0.so.0
#3 0x00007fdf387bc5c6 in g_async_queue_pop () at /usr/lib/libglib-2.0.so.0
#4 0x00007fdf37814661 in ??? () at /usr/lib/libpangoft2-1.0.so.0
#5 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#7 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7fdf30b756c0 (LWP 306853) “pool-0”):
#0 0x00007fdf59519c5d in syscall () at /usr/lib/libc.so.6
#1 0x00007fdf38827f1c in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
#2 0x00007fdf387bc517 in ??? () at /usr/lib/libglib-2.0.so.0
#3 0x00007fdf387bc68f in g_async_queue_timeout_pop () at /usr/lib/libglib-2.0.so.0
#4 0x00007fdf38831df1 in ??? () at /usr/lib/libglib-2.0.so.0
#5 0x00007fdf38830ad4 in ??? () at /usr/lib/libglib-2.0.so.0
#6 0x00007fdf59497739 in ??? () at /usr/lib/libc.so.6
#7 0x00007fdf5951bedc in ??? () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7fdf59e88bc0 (LWP 306406) “python”):
#0 0x00007fdf5949fff2 in ??? () at /usr/lib/libc.so.6
#1 0x00007fdf5949403c in ??? () at /usr/lib/libc.so.6
#2 0x00007fdf59494084 in ??? () at /usr/lib/libc.so.6
#3 0x00007fdf5950494f in wait4 () at /usr/lib/libc.so.6
#4 0x00007fdf59453f6d in ??? () at /usr/lib/libc.so.6
#5 0x00007fdf55fb1f06 in TUnixSystem::StackTrace() () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#6 0x00007fdf563a7e23 in ??? () at /usr/lib/python3.14/site-packages/cppyy/../libCPyCppyy.so
#7 0x00007fdf55fb12c9 in TUnixSystem::DispatchSignals(ESignals) () at /usr/lib/python3.14/site-packages/cppyy/.././libCore.so
#8 0x00007fdf5943e270 in () at /usr/lib/libc.so.6
#9 0x00007fdf36bcab92 in ??? () at /usr/lib/libgtk-4.so.1
#10 0x00007fdf368adff4 in ??? () at /usr/lib/libgtk-4.so.1
#11 0x00007fdf3871966b in g_cclosure_marshal_VOID__OBJECTv () at /usr/lib/libgobject-2.0.so.0
#12 0x00007fdf3873cb7a in ??? () at /usr/lib/libgobject-2.0.so.0
#13 0x00007fdf3873ccd9 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#14 0x00007fdf3873cd94 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#15 0x00007fdf36af770a in gtk_window_destroy () at /usr/lib/libgtk-4.so.1
#16 0x00007fdf5967f1d6 in ??? () at /usr/lib/libffi.so.8
#17 0x00007fdf5967b9ad in ??? () at /usr/lib/libffi.so.8
#18 0x00007fdf5967e7ce in ffi_call () at /usr/lib/libffi.so.8
#19 0x00007fdf38926bd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#20 0x00007fdf3891c3ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#21 0x00007fdf5985dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#22 0x00007fdf599e346b in ??? () at /usr/lib/libpython3.14.so.1.0
#23 0x00007fdf59a34eae in ??? () at /usr/lib/libpython3.14.so.1.0
#24 0x00007fdf59b07450 in ??? () at /usr/lib/libpython3.14.so.1.0
#25 0x00007fdf59ae1232 in ??? () at /usr/lib/libpython3.14.so.1.0
#26 0x00007fdf59aa7f2a in Py_RunMain () at /usr/lib/libpython3.14.so.1.0
#27 0x00007fdf59aa1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#28 0x00007fdf59427741 in ??? () at /usr/lib/libc.so.6
#29 0x00007fdf59427879 in __libc_start_main () at /usr/lib/libc.so.6
#30 0x0000560ee5c11045 in _start ()

The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#9 0x00007fdf36bcab92 in ??? () at /usr/lib/libgtk-4.so.1
#10 0x00007fdf368adff4 in ??? () at /usr/lib/libgtk-4.so.1
#11 0x00007fdf3871966b in g_cclosure_marshal_VOID__OBJECTv () at /usr/lib/libgobject-2.0.so.0
#12 0x00007fdf3873cb7a in ??? () at /usr/lib/libgobject-2.0.so.0
#13 0x00007fdf3873ccd9 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#14 0x00007fdf3873cd94 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#15 0x00007fdf36af770a in gtk_window_destroy () at /usr/lib/libgtk-4.so.1
#16 0x00007fdf5967f1d6 in ??? () at /usr/lib/libffi.so.8
#17 0x00007fdf5967b9ad in ??? () at /usr/lib/libffi.so.8
#18 0x00007fdf5967e7ce in ffi_call () at /usr/lib/libffi.so.8
#19 0x00007fdf38926bd2 in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#20 0x00007fdf3891c3ec in ??? () at /usr/lib/python3.14/site-packages/gi/_gi.cpython-314-x86_64-linux-gnu.so
#21 0x00007fdf5985dcc3 in ??? () at /usr/lib/libpython3.14.so.1.0
#22 0x00007fdf599e346b in ??? () at /usr/lib/libpython3.14.so.1.0
#23 0x00007fdf59a34eae in ??? () at /usr/lib/libpython3.14.so.1.0
#24 0x00007fdf59b07450 in ??? () at /usr/lib/libpython3.14.so.1.0
#25 0x00007fdf59ae1232 in ??? () at /usr/lib/libpython3.14.so.1.0
#26 0x00007fdf59aa7f2a in Py_RunMain () at /usr/lib/libpython3.14.so.1.0
#27 0x00007fdf59aa1cfc in Py_BytesMain () at /usr/lib/libpython3.14.so.1.0
#28 0x00007fdf59427741 in ??? () at /usr/lib/libc.so.6
#29 0x00007fdf59427879 in __libc_start_main () at /usr/lib/libc.so.6
#30 0x0000560ee5c11045 in _start ()

</details>

Dear @nwin ,

I have created the following reproducer based on my understanding of the situation

import ROOT
import matplotlib.pyplot as plt


def create_data(dataset_name, file_name):
    (
        ROOT.RDataFrame(2416278)
        .Define("col", "(UShort_t)gRandom->Integer(27)")
        .Define("row", "(UShort_t)gRandom->Integer(22)")
        .Snapshot(dataset_name, file_name)
    )


def main():
    dataset_name = "mytree"
    file_name = "myfile.root"
    create_data(dataset_name, file_name)
    df = ROOT.RDataFrame(dataset_name, file_name)
    col, row = df.AsNumpy(["col", "row"]).values()
    plt.hist2d(col, row)
    # Uncomment to actually stop and see the plot
    # plt.show()

if __name__ == "__main__":
    raise SystemExit(main())

I have then run it on my machine (Fedora Linux 43) as well as on lxplus using the latest LCG_110 software stack. In both cases, I also used the same ROOT version as you (6.40.02). In both cases, I don’t get a segfault, the program procedes fine (I can also see the plot if I uncomment plt.show() in my snippet).

Can I ask you to run my program in your environment?

If it crashes, then the next step would be understanding if your environment is the issue. For that, I could suggest you try installing ROOT via conda, i.e. conda install -c conda-forge root matplotlib and see if the program does not crash there.

If it does not crash, then I would guess there may be some issue with your dataset specifically, but it would be hard to understand without having it.

Cheers,
Vincenzo

Running this snippet produces the same crash as with the actual dataset, with the same workaround also functioning. I’m now installing (mini)conda, I’ll let you know when I have a functioning environment and have seen if I can reproduce it there. (I have never used anaconda before, sorry this might take a second)

Ok, got conda working. Running the snippet inside a conda container makes it work, so it appears to be something with my environment? Any ideas on what I could do to find out what is specifically wrong with the environment?
I’m now also seeing if it works in a virtual machine on my distro, see if I configured something wrongly.

Thanks so much for your help so far @vpadulan!

Dear @nwin ,

I am happy that you have at least one environment where the application is working now!

As for the environment using the ROOT package from the Arch Linux channel, I can only guess, but let’s see if I can be helpful. I looked again at your stack trace, I noticed that the starting point of the segfault is a series of calls into PyGObject (_gi.cpython-314-x86_64-linux-gnu.so) and then libgtk-4.so.1, so I’m not even sure if the cause of the problem is ROOT itself. If it isn’t too much trouble, could you try the following?

  1. Completely remove any presence of ROOT from your system, i.e. uninstall the ROOT package you installed from the Arch Linux channel. Then, reinstall ROOT.
  2. Create a new and clean Python virtual environment using your system Python, i.e. the same one you can install via the official Arch Linux channel Arch Linux - python 3.14.6-1 (x86_64). This should be done via python -m venv ~/myenv && . ~/myenv/bin/activate
  3. Now in the activated clean Python virtual environment you run pip install matplotlib
  4. Try to rerun the reproducer I sent above.

I had to copy over the site-packages symlinks for ROOT, but after that the reproducer runs fine in the clean virtual environment. Does this mean that the issue is with matplotlib (or rather its packaging on archlinux)?

Edit: downgrading matplotlib to 3.10.9 does seem to partially resolve the issue, though in the venv it was matplotlib 3.11 being used…

I do however still get the segfault on exit there if I don’t plt.show(), which wasn’t an issue in the virtual environment

Dear @nwin ,

I am not sure what this means, in principle once you have ROOT installed via the package manager of your distro you shouldn’t need to add any simlinks.

Does this mean that the issue is with matplotlib (or rather its packaging on archlinux)?

To be honest I don’t know, I cannot neither confirm nor discard this option as I don’t have access to your precise environment.

In general, do I understand correctly that in the clean virtual environment you could get your code running? Can we do anything else to help?

Cheers,
Vincenzo

What I mean by that is that the clean environment did not have access to the system installation of ROOT, I had to copy the symlinks (cppyy and ROOT) that the package manager puts in /usr/lib/python3.14/site-packages over to ~/myenv/lib/python3.14/site-packages/ to be able to use import ROOT.

Yes, running within the clean virtual environment does get my code running, I have not had a segfault there so far.

It’d be interesting to find out exactly what is happening here, maybe get it fixed in the packaging, but that’s an issue I can see if I can resolve elsewhere. Thank you very much for your help!

Cheers,
nwin