linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm]  LVM tools segfault since 2.03.12
@ 2021-09-02  7:34 Jean-Michel Pollion
  2021-09-02 14:11 ` Zdenek Kabelac
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Michel Pollion @ 2021-09-02  7:34 UTC (permalink / raw)
  To: linux-lvm

Hello,

I have the lvm2 tools segfaulting since 2.03.12 with a message of
unsorted commands in cmds.h.
It turns out that in my locale and on my setup, the LANG=C setting
before "sort -u" in tools/Makefile.in is not enough, I had to patch and
add LC_COLLATE=C too, or the rules will not count the underscore while
sorting, causing the segfault in the code (command.c IIRC).
This broke the boot on some of my servers, so I think it's a rather big
problem that perhaps can't be caught in reproducible builds.
Can this be corrected upstream or should I just modify my build
environment for LVM2?

Thanks


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] LVM tools segfault since 2.03.12
  2021-09-02  7:34 [linux-lvm] LVM tools segfault since 2.03.12 Jean-Michel Pollion
@ 2021-09-02 14:11 ` Zdenek Kabelac
       [not found]   ` <1059a9981045d052b49f0d386a9b19f1b7f1a8e2.camel@ookaze.fr>
  0 siblings, 1 reply; 5+ messages in thread
From: Zdenek Kabelac @ 2021-09-02 14:11 UTC (permalink / raw)
  To: LVM general discussion and development, Jean-Michel Pollion

Dne 02. 09. 21 v 9:34 Jean-Michel Pollion napsal(a):
> Hello,
> 
> I have the lvm2 tools segfaulting since 2.03.12 with a message of
> unsorted commands in cmds.h.
> It turns out that in my locale and on my setup, the LANG=C setting
> before "sort -u" in tools/Makefile.in is not enough, I had to patch and
> add LC_COLLATE=C too, or the rules will not count the underscore while
> sorting, causing the segfault in the code (command.c IIRC).
> This broke the boot on some of my servers, so I think it's a rather big
> problem that perhaps can't be caught in reproducible builds.
> Can this be corrected upstream or should I just modify my build
> environment for LVM2?
>


Hi

Interesting - can you send a patch to Makefile  to include LC_COLLATE=C
in case it does fixes your problem.

Although LANG=C should IMHO set all LC_XXX settings - so it can be also a bug 
in glibc process ??

What locales are used in your environment ?

Can you attache resulting sorted  cmds.h in your environment ?

Regards

Zdenek

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] LVM tools segfault since 2.03.12
       [not found]     ` <1cac267f-cad7-a511-c72d-d9a309c38b3f@redhat.com>
@ 2021-09-02 19:10       ` Jean-Michel Pollion
  2021-09-02 19:14         ` Zdenek Kabelac
  2021-09-06 17:59         ` Zdenek Kabelac
  0 siblings, 2 replies; 5+ messages in thread
From: Jean-Michel Pollion @ 2021-09-02 19:10 UTC (permalink / raw)
  To: linux-lvm; +Cc: Zdenek Kabelac

Le jeudi 02 septembre 2021 à 19:21 +0200, Zdenek Kabelac a écrit :
> Dne 02. 09. 21 v 17:49 Jean-Michel Pollion napsal(a):
> > Le jeudi 02 septembre 2021 à 16:11 +0200, Zdenek Kabelac a écrit :
> > > Dne 02. 09. 21 v 9:34 Jean-Michel Pollion napsal(a):
> > > > Hello,
> > > > 
> > > > I have the lvm2 tools segfaulting since 2.03.12 with a message
> > > > of
> > > > unsorted commands in cmds.h.
> > > > It turns out that in my locale and on my setup, the LANG=C
> > > > setting
> > > > before "sort -u" in tools/Makefile.in is not enough, I had to
> > > > patch
> > > > and
> > > > add LC_COLLATE=C too, or the rules will not count the
> > > > underscore
> > > > while
> > > > sorting, causing the segfault in the code (command.c IIRC).
> > > > This broke the boot on some of my servers, so I think it's a
> > > > rather
> > > > big
> > > > problem that perhaps can't be caught in reproducible builds.
> > > > Can this be corrected upstream or should I just modify my build
> > > > environment for LVM2?
> > > > 
> > > 
> > > Hi
> > > 
> > > Interesting - can you send a patch to Makefile  to include
> > > LC_COLLATE=C
> > > in case it does fixes your problem
> > I fixed it with a sed, the resulting patch is attached:
> > --- LVM2.2.03.13-orig/tools/Makefile.in 2021-08-11
> > 17:37:43.000000000
> > +0200
> > +++ LVM2.2.03.13/tools/Makefile.in      2021-09-02
> > 17:41:42.113702990
> > +0200
> > @@ -181,7 +181,7 @@
> >          ( cat $(srcdir)/license.inc && \
> >            echo "/* Do not edit. This file is generated by the
> > Makefile.
> > */" && \
> >            echo "cmd(CMD_NONE, none)" && \
> > -         $(GREP) '^ID:' $(srcdir)/command-lines.in | LANG=C
> > $(SORT) -u
> > > $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \
> > +         $(GREP) '^ID:' $(srcdir)/command-lines.in | LANG=C
> > LC_COLLATE=C $(SORT) -u | $(AWK) '{print "cmd(" $$2 "_CMD, " $$2
> > ")"}'
> > && \
> >            echo "cmd(CMD_COUNT, count)" \
> >          ) > $@
> 
> 
> And does it also work if you set  LC_ALL=C   (instead of LANG=C
> LC_COLLATE=C) ?

Yes, it works also with LC_ALL=C alone (without either LANG_C or
LC_COLLATE=C), I replaced LANG=C by LC_ALL=C in the Makefile and it
worked perfectly, as expected, as LC_ALL is supposed to supersede LANG.

> 
> Zdenek
> 


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] LVM tools segfault since 2.03.12
  2021-09-02 19:10       ` Jean-Michel Pollion
@ 2021-09-02 19:14         ` Zdenek Kabelac
  2021-09-06 17:59         ` Zdenek Kabelac
  1 sibling, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2021-09-02 19:14 UTC (permalink / raw)
  To: Jean-Michel Pollion, linux-lvm

Dne 02. 09. 21 v 21:10 Jean-Michel Pollion napsal(a):
> Le jeudi 02 septembre 2021 à 19:21 +0200, Zdenek Kabelac a écrit :
>> Dne 02. 09. 21 v 17:49 Jean-Michel Pollion napsal(a):
>>> Le jeudi 02 septembre 2021 à 16:11 +0200, Zdenek Kabelac a écrit :
>>>> Dne 02. 09. 21 v 9:34 Jean-Michel Pollion napsal(a):
>>>>> Hello,
>>>>>
>>>>> I have the lvm2 tools segfaulting since 2.03.12 with a message
>>>>> of
>>>>> unsorted commands in cmds.h.
>>>>> It turns out that in my locale and on my setup, the LANG=C
>>>>> setting
>>>>> before "sort -u" in tools/Makefile.in is not enough, I had to
>>>>> patch
>>>>> and
>>>>> add LC_COLLATE=C too, or the rules will not count the
>>>>> underscore
>>>>> while
>>>>> sorting, causing the segfault in the code (command.c IIRC).
>>>>> This broke the boot on some of my servers, so I think it's a
>>>>> rather
>>>>> big
>>>>> problem that perhaps can't be caught in reproducible builds.
>>>>> Can this be corrected upstream or should I just modify my build
>>>>> environment for LVM2?
>>>>>
>>>> Hi
>>>>
>>>> Interesting - can you send a patch to Makefile  to include
>>>> LC_COLLATE=C
>>>> in case it does fixes your problem
>>> I fixed it with a sed, the resulting patch is attached:
>>> --- LVM2.2.03.13-orig/tools/Makefile.in 2021-08-11
>>> 17:37:43.000000000
>>> +0200
>>> +++ LVM2.2.03.13/tools/Makefile.in      2021-09-02
>>> 17:41:42.113702990
>>> +0200
>>> @@ -181,7 +181,7 @@
>>>           ( cat $(srcdir)/license.inc && \
>>>             echo "/* Do not edit. This file is generated by the
>>> Makefile.
>>> */" && \
>>>             echo "cmd(CMD_NONE, none)" && \
>>> -         $(GREP) '^ID:' $(srcdir)/command-lines.in | LANG=C
>>> $(SORT) -u
>>>> $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \
>>> +         $(GREP) '^ID:' $(srcdir)/command-lines.in | LANG=C
>>> LC_COLLATE=C $(SORT) -u | $(AWK) '{print "cmd(" $$2 "_CMD, " $$2
>>> ")"}'
>>> && \
>>>             echo "cmd(CMD_COUNT, count)" \
>>>           ) > $@
>>
>> And does it also work if you set  LC_ALL=C   (instead of LANG=C
>> LC_COLLATE=C) ?
> Yes, it works also with LC_ALL=C alone (without either LANG_C or
> LC_COLLATE=C), I replaced LANG=C by LC_ALL=C in the Makefile and it
> worked perfectly, as expected, as LC_ALL is supposed to supersede LANG.
>

So thanks for checking,  I'll push this fix then.


Regards


Zdenek

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] LVM tools segfault since 2.03.12
  2021-09-02 19:10       ` Jean-Michel Pollion
  2021-09-02 19:14         ` Zdenek Kabelac
@ 2021-09-06 17:59         ` Zdenek Kabelac
  1 sibling, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2021-09-06 17:59 UTC (permalink / raw)
  To: LVM general discussion and development, Jean-Michel Pollion

On 02. 09. 21 21:10, Jean-Michel Pollion wrote:
> Le jeudi 02 septembre 2021 à 19:21 +0200, Zdenek Kabelac a écrit :
>> Dne 02. 09. 21 v 17:49 Jean-Michel Pollion napsal(a):
>>> Le jeudi 02 septembre 2021 à 16:11 +0200, Zdenek Kabelac a écrit :
>>>> Dne 02. 09. 21 v 9:34 Jean-Michel Pollion napsal(a):
>>>>> Hello,
  ?
> 
> Yes, it works also with LC_ALL=C alone (without either LANG_C or
> LC_COLLATE=C), I replaced LANG=C by LC_ALL=C in the Makefile and it
> worked perfectly, as expected, as LC_ALL is supposed to supersede LANG.

Upstreamed with:

https://listman.redhat.com/archives/lvm-devel/2021-September/msg00001.html

Regards

Zdenek

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-06 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  7:34 [linux-lvm] LVM tools segfault since 2.03.12 Jean-Michel Pollion
2021-09-02 14:11 ` Zdenek Kabelac
     [not found]   ` <1059a9981045d052b49f0d386a9b19f1b7f1a8e2.camel@ookaze.fr>
     [not found]     ` <1cac267f-cad7-a511-c72d-d9a309c38b3f@redhat.com>
2021-09-02 19:10       ` Jean-Michel Pollion
2021-09-02 19:14         ` Zdenek Kabelac
2021-09-06 17:59         ` Zdenek Kabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).