1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Zdenek Kabelac 83258e3385 toolcontext: do not change stream for pthreaded programs
With pthreaded daemons like 'dmeventd' using  liblvm via plugin,
lvm2 actually should not 'play' with streams at all - as there
could be parallel outputs running.

As a current quick workaround just disable change for pthreaded
program (gettid() != getpid()).

TODO: it's possible the change of buffering actually doesn't serve us
any measurable benefit and could be dropped as whole later...

Meanwhile this patch is fixing this occasional valgrind race report:

Invalid read of size 4
   at 0x571892C: vfprintf (in /usr/lib64/libc-2.26.9000.so)
   by 0x57216B3: fprintf (in /usr/lib64/libc-2.26.9000.so)
   by 0x5042886: dm_event_log (libdevmapper-event.c:925)
   by 0x10B015: _dmeventd_log (dmeventd.c:125)
   by 0x10D289: _unregister_for_event (dmeventd.c:1146)
   by 0x10E52E: _handle_request (dmeventd.c:1583)
   by 0x10E6D7: _do_process_request (dmeventd.c:1631)
   by 0x10E7C6: _process_request (dmeventd.c:1660)
   by 0x1101A4: main (dmeventd.c:2285)
 Address 0x6264d30 is 192 bytes inside a block of size 552 free'd
   at 0x4C2ED68: free (vg_replace_malloc.c:530)
   by 0x573907D: fclose@@GLIBC_2.2.5 (in /usr/lib64/libc-2.26.9000.so)
   by 0x6AC5C00: reopen_standard_stream (log.c:189)
   by 0x6A8E62C: destroy_toolcontext (toolcontext.c:2271)
   by 0x6BA5C22: lvm_fin (lvmcmdline.c:3339)
   by 0x6BD5EF3: lvm2_exit (lvmcmdlib.c:123)
   by 0x6856013: dmeventd_lvm2_exit (dmeventd_lvm.c:103)
   by 0x66535B8: unregister_device (dmeventd_thin.c:432)
   by 0x10CBBC: _do_unregister_device (dmeventd.c:926)
   by 0x10CD74: _monitor_unregister (dmeventd.c:979)
   by 0x10D094: _monitor_thread (dmeventd.c:1066)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)
 Block was alloc'd at
   at 0x4C2DBBB: malloc (vg_replace_malloc.c:299)
   by 0x573932B: fdopen@@GLIBC_2.2.5 (in /usr/lib64/libc-2.26.9000.so)
   by 0x6AC5DC2: reopen_standard_stream (log.c:200)
   by 0x6A8D11D: create_toolcontext (toolcontext.c:1898)
   by 0x6BA5B6B: init_lvm (lvmcmdline.c:3319)
   by 0x6BD5BC8: cmdlib_lvm2_init (lvmcmdlib.c:34)
   by 0x6BD5F04: lvm2_init (lvm2cmd.c:20)
   by 0x6855EA7: dmeventd_lvm2_init (dmeventd_lvm.c:67)
   by 0x665305F: register_device (dmeventd_thin.c:352)
   by 0x10CB7A: _do_register_device (dmeventd.c:916)
   by 0x10CEE4: _monitor_thread (dmeventd.c:1006)
   by 0x54B35E0: start_thread (in /usr/lib64/libpthread-2.26.9000.so)
   by 0x57C30EE: clone (in /usr/lib64/libc-2.26.9000.so)
....
Process terminating with default action of signal 6 (SIGABRT): dumping core
   at 0x570016B: raise (in /usr/lib64/libc-2.26.9000.so)
   by 0x5701520: abort (in /usr/lib64/libc-2.26.9000.so)
   by 0x57437D8: __libc_message (in /usr/lib64/libc-2.26.9000.so)
   by 0x5743831: __libc_fatal (in /usr/lib64/libc-2.26.9000.so)
   by 0x5744056: _IO_vtable_check (in /usr/lib64/libc-2.26.9000.so)
   by 0x574751C: __overflow (in /usr/lib64/libc-2.26.9000.so)
   by 0x574191A: fputc (in /usr/lib64/libc-2.26.9000.so)
   by 0x50428E3: dm_event_log (libdevmapper-event.c:934)
   by 0x10B015: _dmeventd_log (dmeventd.c:125)
   by 0x10D289: _unregister_for_event (dmeventd.c:1146)
   by 0x10E52E: _handle_request (dmeventd.c:1583)
   by 0x10E6D7: _do_process_request (dmeventd.c:1631)
   by 0x10E7C6: _process_request (dmeventd.c:1660)
   by 0x1101A4: main (dmeventd.c:2285)
2018-02-09 10:56:40 +01:00
..
activate pvmove: reinstantiate clustered pvmove 2018-02-01 21:55:20 +01:00
cache device: Fix basic async I/O error handling 2018-02-08 20:19:21 +00:00
cache_segtype cache: fix lvdisplay output 2017-06-22 20:17:18 +02:00
commands toolcontext: do not change stream for pthreaded programs 2018-02-09 10:56:40 +01:00
config device: Fix basic async I/O error handling 2018-02-08 20:19:21 +00:00
datastruct datastruct: Add str_list_wipe. 2016-04-29 19:47:15 +01:00
device device: Fix basic async I/O error handling 2018-02-08 20:19:21 +00:00
display coverity: validate retval from get_only_segment_using_this_lv 2017-06-27 00:27:36 +02:00
error activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
filters config: Split config buffer processing into new fn. 2018-01-02 21:10:46 +00:00
format1 callbacks: Miscellaneous fixes for recent changes 2018-02-06 01:09:39 +00:00
format_pool callbacks: Miscellaneous fixes for recent changes 2018-02-06 01:09:39 +00:00
format_text format_text: Use versionsort to sort archive files 2018-02-09 01:08:55 +00:00
freeseg doc: change fsf address 2016-01-21 12:11:37 +01:00
label device: Fix basic async I/O error handling 2018-02-08 20:19:21 +00:00
locking pvmove: reinstantiate clustered pvmove 2018-02-01 21:55:20 +01:00
log device: categorise block i/o 2017-12-04 23:45:26 +00:00
lvmpolld doc: change fsf address 2016-01-21 12:11:37 +01:00
metadata device: Add ioflags parameter to transfer additional state. 2018-01-21 21:10:23 +00:00
mirror pvmove: enhance delayed_resume logic 2017-11-26 00:36:48 +01:00
misc lvm-string: add function to detect component LV suffix 2017-12-19 15:28:07 +01:00
mm activation: keep priority till memlock_unlock 2017-12-08 13:21:15 +01:00
notify dbus: also recognize error state for missing service that comes from original D-Bus 2016-11-15 10:09:11 +01:00
properties doc: change fsf address 2016-01-21 12:11:37 +01:00
raid raid: protect raid4 activation 2017-11-11 00:56:10 +01:00
report tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
snapshot activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
striped striped: implement compatible target name 2016-12-05 17:02:01 +01:00
thin thin: add new ZERO/DISCARDS_UNSELECTED 2017-03-10 19:33:00 +01:00
unknown doc: change fsf address 2016-01-21 12:11:37 +01:00
uuid cleanup :drop unneeded header file 2016-10-03 17:49:56 +02:00
zero activate: Use macros for target and module names. 2016-03-22 17:46:15 +00:00
Makefile.in liblvm: Move lib code used exclusively into metadata-liblvm.c 2017-10-18 19:29:32 +01:00