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

julia core constructor destructor #53

Closed
Qualenritter opened this issue Aug 17, 2019 · 13 comments
Closed

julia core constructor destructor #53

Qualenritter opened this issue Aug 17, 2019 · 13 comments
Assignees

Comments

@Qualenritter
Copy link
Contributor

Qualenritter commented Aug 17, 2019

Irgendwas mit dem julea constructor/destructor code ist merkwürdig.

Für die folgenden logs/stack-traces wurde in der julea-config wurde überall component=server angegeben.
Bei component=client crasht das Programm während des initialisierens - durch eine andere Reihenfolge von j_init / j_fini.

Zunächst 'nur' die gekürzten log Ausgaben:

"j_init 1" wird beim Betreten der j_init Funktion geloggt.
"j_init 2" NACHDEM j_is_initialized() überprüft wurde -> j_init erkennt also nie, dass bereits init ausgeführt worden ist.
"j_fini" wird beim Betreten der j_fini Funktion geloggt.
"H5PLget_plugin_type" und "H5PLget_plugin_info" werden jeweils in der julea-hdf5-implementation geloggt.

** (process:1384): DEBUG: 13:19:57.819: j_init 1
** (process:1384): DEBUG: 13:19:57.820: j_init 2
** (process:1384): DEBUG: 13:20:05.011: j_fini
** (process:1384): DEBUG: 13:20:07.689: j_init 1
** (process:1384): DEBUG: 13:20:07.689: j_init 2
** (process:1384): DEBUG: 13:20:09.971: j_fini
** (process:1384): DEBUG: 13:20:12.928: j_init 1
** (process:1384): DEBUG: 13:20:12.929: j_init 2
** (process:1384): DEBUG: 13:20:15.651: j_fini
** (process:1384): DEBUG: 13:20:17.261: j_init 1
** (process:1384): DEBUG: 13:20:17.261: j_init 2
** (process:1384): DEBUG: 13:20:17.262: H5PLget_plugin_type
** (process:1384): DEBUG: 13:20:17.262: H5PLget_plugin_info

Anschließend auch ein paar Stacktraces mit den obigen log Ausgaben dazwischen, um die zeitlichen Zusammenhänge zu sehen. Hierbei ist zu beachten, dass alle stacktraces innerhalb der selben "H5VLregister_connector_by_name" ausgegeben wurden.

Es werden mehrfach Threads initialisiert - und auch wieder beendet.

(gdb) break j_init
Function "j_init" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (j_init) pending.
(gdb) break j_fini
Function "j_fini" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (j_fini) pending.
(gdb) r

...

Breakpoint 1, j_init () at ../lib/core/jcommon.c:131
131	{
(gdb) bt
#0  j_init () at ../lib/core/jcommon.c:131
#1  0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff74185cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#5  0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff729b256 in dlopen_doit (a=a@entry=0x7fffffff0400) at dlopen.c:66
#7  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03a0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#8  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#9  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b200 <dlopen_doit>, args=args@entry=0x7fffffff0400) at dlerror.c:163
#10 0x00007ffff729b2e6 in __dlopen (file=<optimized out>, mode=mode@entry=1) at dlopen.c:87
#11 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x55555acbffc0 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:332
#12 0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#13 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#14 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#15 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#16 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#17 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#18 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:19:57.819: j_init 1
** (process:1384): DEBUG: 13:19:57.820: j_init 2
[New Thread 0x7ffff66f9700 (LWP 1389)]

Thread 1 "enzo.exe" hit Breakpoint 2, j_fini () at ../lib/core/jcommon.c:243
243	{
(gdb) bt
#0  j_fini () at ../lib/core/jcommon.c:243
#1  0x00007ffff7fe796d in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe8541 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03c0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#4  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#5  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b330 <dlclose_doit>, args=0x55555acc0070) at dlerror.c:163
#6  0x00007ffff729b364 in __dlclose (handle=<optimized out>) at dlclose.c:46
#7  0x00007ffff7df12d1 in H5PL__close (handle=handle@entry=0x55555acc0070) at H5PLint.c:437
#8  0x00007ffff7df1460 in H5PL__open (path=path@entry=0x55555acbffc0 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:415
#9  0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#10 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#11 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#12 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#13 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#14 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#15 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:20:05.011: j_fini
[Thread 0x7ffff66f9700 (LWP 1389) exited]
warning: Temporarily disabling breakpoints for unloaded shared library "/src/julea/prefix-hdf-julea/lib/libjulea.so"

Thread 1 "enzo.exe" hit Breakpoint 1, j_init () at ../lib/core/jcommon.c:131
131	{
(gdb) bt
#0  j_init () at ../lib/core/jcommon.c:131
#1  0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff74185cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#5  0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff729b256 in dlopen_doit (a=a@entry=0x7fffffff0400) at dlopen.c:66
#7  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03a0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#8  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#9  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b200 <dlopen_doit>, args=args@entry=0x7fffffff0400) at dlerror.c:163
#10 0x00007ffff729b2e6 in __dlopen (file=<optimized out>, mode=mode@entry=1) at dlopen.c:87
#11 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x55555acc17d0 "/src/julea/prefix-hdf-julea/lib/libjulea-kv.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:332
#12 0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#13 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#14 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#15 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#16 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#17 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#18 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:20:07.689: j_init 1
** (process:1384): DEBUG: 13:20:07.689: j_init 2
[New Thread 0x7ffff66f9700 (LWP 1390)]

Thread 1 "enzo.exe" hit Breakpoint 2, j_fini () at ../lib/core/jcommon.c:243
243	{
(gdb) bt
#0  j_fini () at ../lib/core/jcommon.c:243
#1  0x00007ffff7fe796d in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe8541 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03c0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#4  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#5  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b330 <dlclose_doit>, args=0x55555acc0070) at dlerror.c:163
#6  0x00007ffff729b364 in __dlclose (handle=<optimized out>) at dlclose.c:46
#7  0x00007ffff7df12d1 in H5PL__close (handle=handle@entry=0x55555acc0070) at H5PLint.c:437
#8  0x00007ffff7df1460 in H5PL__open (path=path@entry=0x55555acc17d0 "/src/julea/prefix-hdf-julea/lib/libjulea-kv.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:415
#9  0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#10 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#11 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#12 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#13 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#14 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#15 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:20:09.971: j_fini
[Thread 0x7ffff66f9700 (LWP 1390) exited]
warning: Temporarily disabling breakpoints for unloaded shared library "/src/julea/build-hdf-julea/lib/libjulea.so"

Thread 1 "enzo.exe" hit Breakpoint 1, j_init () at ../lib/core/jcommon.c:131
131	{
(gdb) bt
#0  j_init () at ../lib/core/jcommon.c:131
#1  0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff74185cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#5  0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff729b256 in dlopen_doit (a=a@entry=0x7fffffff0400) at dlopen.c:66
#7  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03a0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#8  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#9  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b200 <dlopen_doit>, args=args@entry=0x7fffffff0400) at dlerror.c:163
#10 0x00007ffff729b2e6 in __dlopen (file=<optimized out>, mode=mode@entry=1) at dlopen.c:87
#11 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x55555acc17d0 "/src/julea/prefix-hdf-julea/lib/libjulea-item.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:332
#12 0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#13 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#14 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#15 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#16 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#17 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#18 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:20:12.928: j_init 1
** (process:1384): DEBUG: 13:20:12.929: j_init 2
[New Thread 0x7ffff66f9700 (LWP 1391)]

Thread 1 "enzo.exe" hit Breakpoint 2, j_fini () at ../lib/core/jcommon.c:243
243	{
(gdb) bt
#0  j_fini () at ../lib/core/jcommon.c:243
#1  0x00007ffff7fe796d in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe8541 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03c0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#4  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#5  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b330 <dlclose_doit>, args=0x55555acc0030) at dlerror.c:163
#6  0x00007ffff729b364 in __dlclose (handle=<optimized out>) at dlclose.c:46
#7  0x00007ffff7df12d1 in H5PL__close (handle=handle@entry=0x55555acc0030) at H5PLint.c:437
#8  0x00007ffff7df1460 in H5PL__open (path=path@entry=0x55555acc17d0 "/src/julea/prefix-hdf-julea/lib/libjulea-item.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:415
#9  0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#10 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#11 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#12 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#13 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#14 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#15 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:20:15.651: j_fini
[Thread 0x7ffff66f9700 (LWP 1391) exited]
warning: Temporarily disabling breakpoints for unloaded shared library "/src/julea/build-hdf-julea/lib/libjulea.so"

Thread 1 "enzo.exe" hit Breakpoint 1, j_init () at ../lib/core/jcommon.c:131
131	{
(gdb) bt
#0  j_init () at ../lib/core/jcommon.c:131
#1  0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff74185cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#5  0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff729b256 in dlopen_doit (a=a@entry=0x7fffffff0400) at dlopen.c:66
#7  0x00007ffff74185cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff03a0, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#8  0x00007ffff741865f in __GI__dl_catch_error (objname=0x55555acc0010, errstring=0x55555acc0018, mallocedp=0x55555acc0008, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#9  0x00007ffff729ba25 in _dlerror_run (operate=operate@entry=0x7ffff729b200 <dlopen_doit>, args=args@entry=0x7fffffff0400) at dlerror.c:163
#10 0x00007ffff729b2e6 in __dlopen (file=<optimized out>, mode=mode@entry=1) at dlopen.c:87
#11 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x55555acc17d0 "/src/julea/prefix-hdf-julea/lib/libjulea-hdf5.so", type=H5PL_TYPE_VOL, key=0x7fffffff0610, success=success@entry=0x7fffffff05b7, 
    plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLint.c:332
#12 0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff05c0, search_params=0x7fffffff05c0, plugin_info=0x7fffffff05b8, dir=<optimized out>, found=0x7fffffff05b7) at H5PLpath.c:692
#13 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff05c0, found=found@entry=0x7fffffff05b7, plugin_info=plugin_info@entry=0x7fffffff05b8) at H5PLpath.c:603
#14 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff0610) at H5PLint.c:273
#15 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x555555b14956 "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#16 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x555555b14956 "julea", vipl_id=720575940379279375) at H5VL.c:163
#17 0x000055555556d9a8 in initializeBenjamin () at benjamin.h:17
#18 0x000055555556daf4 in main (argc=3, argv=0x7fffffff1ca8) at enzo.C:273
(gdb) c
Continuing.
** (process:1384): DEBUG: 13:20:17.261: j_init 1
** (process:1384): DEBUG: 13:20:17.261: j_init 2
[New Thread 0x7ffff66f9700 (LWP 1392)]
** (process:1384): DEBUG: 13:20:17.262: H5PLget_plugin_type
** (process:1384): DEBUG: 13:20:17.262: H5PLget_plugin_info

...
@michaelkuhn michaelkuhn self-assigned this Aug 18, 2019
@michaelkuhn
Copy link
Member

"j_init 1" wird beim Betreten der j_init Funktion geloggt.
"j_init 2" NACHDEM j_is_initialized() überprüft wurde -> j_init erkennt also nie, dass bereits init ausgeführt worden ist.
"j_fini" wird beim Betreten der j_fini Funktion geloggt.
"H5PLget_plugin_type" und "H5PLget_plugin_info" werden jeweils in der julea-hdf5-implementation geloggt.

** (process:1384): DEBUG: 13:19:57.819: j_init 1
** (process:1384): DEBUG: 13:19:57.820: j_init 2
** (process:1384): DEBUG: 13:20:05.011: j_fini
** (process:1384): DEBUG: 13:20:07.689: j_init 1
** (process:1384): DEBUG: 13:20:07.689: j_init 2
** (process:1384): DEBUG: 13:20:09.971: j_fini
** (process:1384): DEBUG: 13:20:12.928: j_init 1
** (process:1384): DEBUG: 13:20:12.929: j_init 2
** (process:1384): DEBUG: 13:20:15.651: j_fini
** (process:1384): DEBUG: 13:20:17.261: j_init 1
** (process:1384): DEBUG: 13:20:17.261: j_init 2
** (process:1384): DEBUG: 13:20:17.262: H5PLget_plugin_type
** (process:1384): DEBUG: 13:20:17.262: H5PLget_plugin_info

Anhand der Strack-Traces unten kann man sehen, dass HDF5 versucht, alle JULEA-Bibliotheken nacheinander zu laden (und sie dann wieder entlädt, da sie keine HDF5-Plugins sind). Dabei werden jedes Mal j_init und j_fini aufgerufen. j_fini deinitialisiert dabei alles, sodass j_init danach wieder durch läuft. Im letzten Schritt wird dann das HDF5-Plugin geladen, so dass nicht direkt wieder j_fini aufgerufen wird. Das Ganze verhält sich also, wie man es erwarten würde.

Welches Problem tritt denn genau mit component=client auf?

@Qualenritter
Copy link
Contributor Author

Qualenritter commented Aug 19, 2019

Ich habe mir jetzt ein minimal working hdf5 example geschrieben. (H5VLinitialize und H5VLterminate sind überflüssig - und sollten auch aus julea-test gelöscht werden):

#include <hdf5.h>
#include <H5PLextern.h>
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char** argv)
{
        hid_t julea_vol_id;
        printf("XXX 1\n");
        julea_vol_id = H5VLregister_connector_by_name("julea", H5P_DEFAULT);
        printf("XXX 2\n");
        H5VLinitialize(julea_vol_id, H5P_DEFAULT);
        printf("XXX 3\n");
        H5VLterminate(julea_vol_id);
        printf("XXX 4\n");
        H5VLunregister_connector(julea_vol_id);
        printf("XXX 5\n");
        return 0;
}

gcc example.c -lhdf5 -ggdb

"und sie dann wieder entlädt, da sie keine HDF5-Plugins sind" für die gegeben logs hast du recht. Ich habe das heute nochmal ausgeführt, dieses Mal mit:

export LD_LIBRARY_PATH="/src/julea/prefix-hdf-julea/lib:$LD_LIBRARY_PATH"
export HDF5_PLUGIN_PATH=/src/julea/prefix-hdf-julea/lib/plugin

Wobei in dem Pfad "/src/julea/prefix-hdf-julea/lib/plugin" nur genau die eine hdf5-plugin-lib war.
Die Julia lib wurde tatsächlich nur noch genau einmal geladen.

component=server funktioniert also - nach deiner Erklärung - wie erwartet.

Bei component=client passt deine Erklärung allerdings nicht.
(Anmerkung: im julea-code habe ich bei allen julea-backends component=client erlaubt)
mit

export LD_LIBRARY_PATH="/src/julea/prefix-hdf-julea/lib:$LD_LIBRARY_PATH"
export HDF5_PLUGIN_PATH=/src/julea/prefix-hdf-julea/lib/plugin

Funktioniert alles super wie erwartet - genau wie bei component=server, ABER
mit

export LD_LIBRARY_PATH="/src/julea/prefix-hdf-julea/lib:$LD_LIBRARY_PATH"
export HDF5_PLUGIN_PATH=/src/julea/prefix-hdf-julea/lib

Also bei allen libs im gleichen Ordner, ist das anders.
Die log Ausgabe "H5VL_julea_db_init" stammt von der julea-hdf5-vol-init-function.

Das erste j_init ist ok, aber das zweite (verschachtelte) nicht.
Zusammen mit threads passt die Reihenfolge nicht mehr, db-backend wird zwei mal direkt hintereinander initialisiert, und dannach einmal freigegeben.
Die erste Benutzung der julea-lib crasht dann.

(gdb) break j_init
Function "j_init" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (j_init) pending.
(gdb) break j_fini
Function "j_fini" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (j_fini) pending.
(gdb) r
Starting program: /src/julea/example/a.out 
XXX 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, j_init () at ../lib/core/jcommon.c:131
131	{
(gdb) bt
#0  j_init () at ../lib/core/jcommon.c:131
#1  0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7b445cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#5  0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff79c7256 in dlopen_doit (a=a@entry=0x7fffffff19d0) at dlopen.c:66
#7  0x00007ffff7b445cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff1970, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#8  0x00007ffff7b4465f in __GI__dl_catch_error (objname=0x7ffff79cb0f0 <last_result+16>, errstring=0x7ffff79cb0f8 <last_result+24>, mallocedp=0x7ffff79cb0e8 <last_result+8>, 
    operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#9  0x00007ffff79c7a25 in _dlerror_run (operate=operate@entry=0x7ffff79c7200 <dlopen_doit>, args=args@entry=0x7fffffff19d0) at dlerror.c:163
#10 0x00007ffff79c72e6 in __dlopen (file=<optimized out>, mode=mode@entry=1) at dlopen.c:87
#11 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x5555555a0520 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff1be0, 
    success=success@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLint.c:332
#12 0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff1b90, search_params=0x7fffffff1b90, plugin_info=0x7fffffff1b88, dir=<optimized out>, found=0x7fffffff1b87)
    at H5PLpath.c:692
#13 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff1b90, found=found@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLpath.c:603
#14 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff1be0) at H5PLint.c:273
#15 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x55555555600a "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#16 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x55555555600a "julea", vipl_id=720575940379279375) at H5VL.c:163
#17 0x00005555555551a1 in main (argc=1, argv=0x7fffffff1d88) at hdf5-example.c:34
(gdb) c
Continuing.
** (process:7232): DEBUG: 11:13:20.563: j_init 1
** (process:7232): DEBUG: 11:13:20.563: j_init 2

Breakpoint 1, j_init () at ../lib/core/jcommon.c:131
131	{
(gdb) bt
#0  j_init () at ../lib/core/jcommon.c:131
#1  0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7b445cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#5  0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff79c7256 in dlopen_doit (a=a@entry=0x7fffffff12b0) at dlopen.c:66
#7  0x00007ffff7b445cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff1250, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#8  0x00007ffff7b4465f in __GI__dl_catch_error (objname=0x7ffff79cb0f0 <last_result+16>, errstring=0x7ffff79cb0f8 <last_result+24>, mallocedp=0x7ffff79cb0e8 <last_result+8>, 
    operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#9  0x00007ffff79c7a25 in _dlerror_run (operate=operate@entry=0x7ffff79c7200 <dlopen_doit>, args=args@entry=0x7fffffff12b0) at dlerror.c:163
#10 0x00007ffff79c72e6 in __dlopen (file=file@entry=0x5555555b3860 "/src/julea/build-hdf-julea/backend/object/libposix.so", mode=<optimized out>) at dlopen.c:87
#11 0x00007ffff734c9f2 in _g_module_open (bind_local=<optimized out>, bind_lazy=0, file_name=<optimized out>) at gmodule-dl.c:98
#12 g_module_open (file_name=0x5555555b1ee0 "/src/julea/build-hdf-julea/backend/object/libposix.so", flags=<optimized out>) at gmodule.c:599
#13 0x00007ffff7813d78 in j_backend_load (name=0x5555555b3700 "posix", component=J_BACKEND_COMPONENT_CLIENT, type=J_BACKEND_TYPE_OBJECT, backend=0x5555555ad1b8)
    at ../lib/core/jbackend.c:90
#14 0x00007ffff7814279 in j_backend_load_client (name=0x5555555b3700 "posix", component=0x5555555b3760 "client", type=J_BACKEND_TYPE_OBJECT, module=0x5555555ad1d0, backend=0x5555555ad1b8)
    at ../lib/core/jbackend.c:215
#15 0x00007ffff7818ebc in j_init () at ../lib/core/jcommon.c:185
#16 0x00007ffff7fe295a in ?? () from /lib64/ld-linux-x86-64.so.2
#17 0x00007ffff7fe2a59 in ?? () from /lib64/ld-linux-x86-64.so.2
#18 0x00007ffff7fe6cbc in ?? () from /lib64/ld-linux-x86-64.so.2
#19 0x00007ffff7b445cf in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#20 0x00007ffff7fe62a6 in ?? () from /lib64/ld-linux-x86-64.so.2
#21 0x00007ffff79c7256 in dlopen_doit (a=a@entry=0x7fffffff19d0) at dlopen.c:66
#22 0x00007ffff7b445cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff1970, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#23 0x00007ffff7b4465f in __GI__dl_catch_error (objname=0x7ffff79cb0f0 <last_result+16>, errstring=0x7ffff79cb0f8 <last_result+24>, mallocedp=0x7ffff79cb0e8 <last_result+8>, 
    operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#24 0x00007ffff79c7a25 in _dlerror_run (operate=operate@entry=0x7ffff79c7200 <dlopen_doit>, args=args@entry=0x7fffffff19d0) at dlerror.c:163
#25 0x00007ffff79c72e6 in __dlopen (file=<optimized out>, mode=mode@entry=1) at dlopen.c:87
#26 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x5555555a0520 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff1be0, 
    success=success@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLint.c:332
#27 0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff1b90, search_params=0x7fffffff1b90, plugin_info=0x7fffffff1b88, dir=<optimized out>, found=0x7fffffff1b87)
    at H5PLpath.c:692
#28 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff1b90, found=found@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLpath.c:603
#29 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff1be0) at H5PLint.c:273
#30 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x55555555600a "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#31 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x55555555600a "julea", vipl_id=720575940379279375) at H5VL.c:163
#32 0x00005555555551a1 in main (argc=1, argv=0x7fffffff1d88) at hdf5-example.c:34
(gdb) c
Continuing.
** (process:7232): DEBUG: 11:13:23.550: j_init 1
** (process:7232): DEBUG: 11:13:23.550: j_init 2
** (process:7232): DEBUG: 11:13:23.591: db-backend-init
[New Thread 0x7ffff711f700 (LWP 7236)]
** (process:7232): DEBUG: 11:13:23.592: db-backend-init
[New Thread 0x7ffff691e700 (LWP 7237)]

Thread 1 "a.out" hit Breakpoint 2, j_fini () at ../lib/core/jcommon.c:243
243	{
(gdb) bt
#0  j_fini () at ../lib/core/jcommon.c:243
#1  0x00007ffff7fe796d in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe8541 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7b445cf in __GI__dl_catch_exception (exception=exception@entry=0x7fffffff1990, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:196
#4  0x00007ffff7b4465f in __GI__dl_catch_error (objname=0x7ffff79cb0f0 <last_result+16>, errstring=0x7ffff79cb0f8 <last_result+24>, mallocedp=0x7ffff79cb0e8 <last_result+8>, 
    operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:215
#5  0x00007ffff79c7a25 in _dlerror_run (operate=operate@entry=0x7ffff79c7330 <dlclose_doit>, args=0x5555555a05a0) at dlerror.c:163
#6  0x00007ffff79c7364 in __dlclose (handle=<optimized out>) at dlclose.c:46
#7  0x00007ffff7df12d1 in H5PL__close (handle=handle@entry=0x5555555a05a0) at H5PLint.c:437
#8  0x00007ffff7df1460 in H5PL__open (path=path@entry=0x5555555a0520 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff1be0, 
    success=success@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLint.c:415
#9  0x00007ffff7df2770 in H5PL__find_plugin_in_path (search_params=0x7fffffff1b90, search_params=0x7fffffff1b90, plugin_info=0x7fffffff1b88, dir=<optimized out>, found=0x7fffffff1b87)
    at H5PLpath.c:692
#10 H5PL__find_plugin_in_path_table (search_params=search_params@entry=0x7fffffff1b90, found=found@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLpath.c:603
#11 0x00007ffff7df11be in H5PL_load (type=type@entry=H5PL_TYPE_VOL, key=key@entry=0x7fffffff1be0) at H5PLint.c:273
#12 0x00007ffff7eef041 in H5VL__register_connector_by_name (name=name@entry=0x55555555600a "julea", app_ref=app_ref@entry=true, vipl_id=vipl_id@entry=720575940379279375) at H5VLint.c:1049
#13 0x00007ffff7edc258 in H5VLregister_connector_by_name (name=0x55555555600a "julea", vipl_id=720575940379279375) at H5VL.c:163
#14 0x00005555555551a1 in main (argc=1, argv=0x7fffffff1d88) at hdf5-example.c:34
(gdb) c
Continuing.
** (process:7232): DEBUG: 11:13:27.078: j_fini
** (process:7232): DEBUG: 11:13:27.078: db-backend-fini
[Thread 0x7ffff691e700 (LWP 7237) exited]
warning: Temporarily disabling breakpoints for unloaded shared library "/src/julea/prefix-hdf-julea/lib/libjulea.so"
** (process:7232): DEBUG: 11:13:27.129: H5PLget_plugin_type
** (process:7232): DEBUG: 11:13:27.129: H5PLget_plugin_info
** (process:7232): DEBUG: 11:13:27.129: H5VL_julea_db_init start

Thread 1 "a.out" received signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_lock (mutex=0x100000000) at ../nptl/pthread_mutex_lock.c:67
67	../nptl/pthread_mutex_lock.c: No such file or directory.

@michaelkuhn
Copy link
Member

Ich vermute, das Problem kommt daher: HDF5 lädt libjulea, dadurch wird implizit j_init aufgerufen. In j_init werden die client-seitigen Backends geladen, die wiederum von libjulea abhängen. Dadurch wird rekursiv noch einmal j_init aufgerufen. Seltsam, dass das bisher keine Probleme gemacht hat.

Ich sehe momentan zwei Möglichkeiten, das zu reparieren:

  1. Wir bieten eine libjulea für Clients (wie bisher) und eine libjulea-internal (ohne Konstruktor/Destruktor) an. Das würde auch das Problem lösen, dass in julea-server implizit j_init aufgerufen wird.
  2. Wir setzen j_common in j_init früher, sodass kein rekursiver Aufruf stattfindet.

@michaelkuhn
Copy link
Member

#10 0x00007ffff79c72e6 in __dlopen (file=file@entry=0x5555555b3860 "/src/julea/build-hdf-julea/backend/object/libposix.so", mode=) at dlopen.c:87
#12 g_module_open (file_name=0x5555555b1ee0 "/src/julea/build-hdf-julea/backend/object/libposix.so", flags=) at gmodule.c:599
#25 0x00007ffff79c72e6 in __dlopen (file=, mode=mode@entry=1) at dlopen.c:87
#26 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x5555555a0520 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff1be0, success=success@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLint.c:332

Der Konstruktor wird zweimal aufgerufen, weil zwei unterschiedliche Versionen von libjulea geladen werden: Zuerst die installierte Version (aus prefix), danach die im Build-Verzeichnis. Das Problem tritt auf, wenn man eine Debug-Version installiert und gegen die installierte Version linkt. Sie lädt dann Module aus dem Build-Verzeichnis nach.

Ich überlege mir mal, wie man das sauberer lösen kann.

@Qualenritter
Copy link
Contributor Author

Ich vermute, das Problem kommt daher: HDF5 lädt libjulea, dadurch wird implizit j_init aufgerufen. In j_init werden die client-seitigen Backends geladen, die wiederum von libjulea abhängen. Dadurch wird rekursiv noch einmal j_init aufgerufen. Seltsam, dass das bisher keine Probleme gemacht hat.

Ich sehe momentan zwei Möglichkeiten, das zu reparieren:

  1. Wir bieten eine libjulea für Clients (wie bisher) und eine libjulea-internal (ohne Konstruktor/Destruktor) an. Das würde auch das Problem lösen, dass in julea-server implizit j_init aufgerufen wird.
  2. Wir setzen j_common in j_init früher, sodass kein rekursiver Aufruf stattfindet.

Variante 1 halte ich für schöner.
Bei Variante 2 bin ich mir nicht sicher, wie das mit den statischen Variablen aussieht. Müsste es nicht für jede lib neue statische Variablen geben, wodurch das frühere setzen von j_common nichts bringt?

@Qualenritter
Copy link
Contributor Author

#10 0x00007ffff79c72e6 in __dlopen (file=file@entry=0x5555555b3860 "/src/julea/build-hdf-julea/backend/object/libposix.so", mode=) at dlopen.c:87
#12 g_module_open (file_name=0x5555555b1ee0 "/src/julea/build-hdf-julea/backend/object/libposix.so", flags=) at gmodule.c:599
#25 0x00007ffff79c72e6 in __dlopen (file=, mode=mode@entry=1) at dlopen.c:87
#26 0x00007ffff7df1330 in H5PL__open (path=path@entry=0x5555555a0520 "/src/julea/prefix-hdf-julea/lib/libjulea.so", type=H5PL_TYPE_VOL, key=0x7fffffff1be0, success=success@entry=0x7fffffff1b87, plugin_info=plugin_info@entry=0x7fffffff1b88) at H5PLint.c:332

Der Konstruktor wird zweimal aufgerufen, weil zwei unterschiedliche Versionen von libjulea geladen werden: Zuerst die installierte Version (aus prefix), danach die im Build-Verzeichnis. Das Problem tritt auf, wenn man eine Debug-Version installiert und gegen die installierte Version linkt. Sie lädt dann Module aus dem Build-Verzeichnis nach.

Ich überlege mir mal, wie man das sauberer lösen kann.

Für den Anfang wäre es schon extrem hilfreich, wenn jede einzelne libjulea*.so beim geladen werden "g_debug(..git-hash..voller-ordner-pfad-mit-lib-namen..compile-flags..)" ausgeben würde.

Langfristig wäre es sinnvoll, wenn "waf.sh configure prefix= ..." nicht nur den Ordner ändert, wo die lib landet, sondern auch "sicherstellt", dass alle libs aus dem gleichen Ordner geladen werden.
Hier könnte man vielleicht auch ein paar assertions im code hinzufügen?

michaelkuhn added a commit that referenced this issue Aug 21, 2019
This should fix issues with installed debug builds loading backends from
the build directory. Debug builds still allow overriding the backend
directory with the JULEA_BACKEND_PATH environment variable, though.
@michaelkuhn
Copy link
Member

Langfristig wäre es sinnvoll, wenn "waf.sh configure prefix= ..." nicht nur den Ordner ändert, wo die lib landet, sondern auch "sicherstellt", dass alle libs aus dem gleichen Ordner geladen werden.
Hier könnte man vielleicht auch ein paar assertions im code hinzufügen?

Das Prefix legt bereits fest, von wo die Backends geladen werden. Bisher haben Debug-Builds allerdings immer zuerst Backends aus dem Build-Verzeichnis geladen. Mit Commit 5e45247 habe ich das geändert, so dass Backends aus dem Prefix bevorzugt werden. Das sollte solche Probleme hoffentlich zumindest unwahrscheinlicher machen.

@michaelkuhn
Copy link
Member

Für den Anfang wäre es schon extrem hilfreich, wenn jede einzelne libjulea*.so beim geladen werden "g_debug(..git-hash..voller-ordner-pfad-mit-lib-namen..compile-flags..)" ausgeben würde.

Man kann aus der Bibliothek heraus wohl nicht herausfinden, aus welchem Pfad sie geladen wurde, daher wird das vermutlich nicht so einfach machbar sein.

@Qualenritter
Copy link
Contributor Author

Langfristig wäre es sinnvoll, wenn "waf.sh configure prefix= ..." nicht nur den Ordner ändert, wo die lib landet, sondern auch "sicherstellt", dass alle libs aus dem gleichen Ordner geladen werden.
Hier könnte man vielleicht auch ein paar assertions im code hinzufügen?

Das Prefix legt bereits fest, von wo die Backends geladen werden. Bisher haben Debug-Builds allerdings immer zuerst Backends aus dem Build-Verzeichnis geladen. Mit Commit 5e45247 habe ich das geändert, so dass Backends aus dem Prefix bevorzugt werden. Das sollte solche Probleme hoffentlich zumindest unwahrscheinlicher machen.

Bei mir waren die Probleme bisher beim release build, und nicht beim debug-build.

@Qualenritter
Copy link
Contributor Author

Für den Anfang wäre es schon extrem hilfreich, wenn jede einzelne libjulea*.so beim geladen werden "g_debug(..git-hash..voller-ordner-pfad-mit-lib-namen..compile-flags..)" ausgeben würde.

Man kann aus der Bibliothek heraus wohl nicht herausfinden, aus welchem Pfad sie geladen wurde, daher wird das vermutlich nicht so einfach machbar sein.

g_debug(..git-hash..compile-flags..)

kann man leicht herausfinden und z.b. erst in die julea-config.h schreiben, und beim initialisieren einmal Ausgeben. Das würde zumindest verhindern, dass ich immer wieder irgendwelche uralt-libs mit dazwischen lade.

@michaelkuhn
Copy link
Member

michaelkuhn commented Aug 22, 2019

Bei mir waren die Probleme bisher beim release build, und nicht beim debug-build.

Das muss dann daran gelegen haben, dass du alte Versionen im Prefix oder LD_LIBRARY_PATH liegen hattest. JULEA selbst lädt die Backends aus dem Prefix. Da die Backends allerdings nochmal gegen libjulea gelinkt sind, kann hier aufgrund des LD_LIBRARY_PATHs die falsche nachgeladen werden.

g_debug(..git-hash..compile-flags..)

kann man leicht herausfinden und z.b. erst in die julea-config.h schreiben, und beim initialisieren einmal Ausgeben. Das würde zumindest verhindern, dass ich immer wieder irgendwelche uralt-libs mit dazwischen lade.

Dann kann aber immer noch zweimal die gleiche Version (einmal aus dem Prefix, einmal aus dem Build-Verzeichnis) geladen werden. Optimal wäre vermutlich, wenn wir irgendwie herausfinden könnten, ob libjulea mehr als einmal geladen wurde.

Edit: Zur Laufzeit lässt sich mit LD_DEBUG=files,libs ganz gut erkennen, welche Bibliotheken geladen werden.

@michaelkuhn
Copy link
Member

Gibt es hier noch etwas zu tun? Falls nicht, würde ich das Issue schließen.

@Qualenritter
Copy link
Contributor Author

Aktuell funktioniert bei mir alles, allerdings bin ich auch gerade nicht dabei neue skripte zu schreiben

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

2 participants