Bug 1438817 - cluster.extra-hash-regex option causes segfault
Summary: cluster.extra-hash-regex option causes segfault
Keywords:
Status: CLOSED EOL
Alias: None
Product: GlusterFS
Classification: Community
Component: libgfapi
Version: 3.10
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Niels de Vos
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On: 1425623
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-04 13:28 UTC by Simon Turcotte-Langevin
Modified: 2018-06-20 18:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-06-20 18:28:55 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)
C file that reproduces the problem. (2.89 KB, application/zip)
2017-04-04 13:28 UTC, Simon Turcotte-Langevin
no flags Details

Description Simon Turcotte-Langevin 2017-04-04 13:28:29 UTC
Created attachment 1268659 [details]
C file that reproduces the problem.

Description of problem:
Some values for the cluster.extra-hash-regex option causes segfault when initializing a new virtual mount with libgfapi.

Version-Release number of selected component (if applicable):
GlusterFS 3.10

How reproducible:
Easily, simply need a volume with the extra regex value set to something with backslashes.

Steps to Reproduce:
1) Create a new volume
2) Set extra regex option:
     gluster volume set vol cluster.extra-hash-regex '"(.*)\\.tmp"'
3) Compile the code in attachment
4) Execute it
5) It should fail the 3rd time a virtual mount is created

Actual results:

[root@node test-native]# segfault-libgfapi
Creating virtual mount #0
Created virtual mount #0
Creating virtual mount #1
Created virtual mount #1
Creating virtual mount #2
Segmentation fault


Expected results:

[root@mtl-perf-assetstore-node01 test-native]# segfault-libgfapi
Creating virtual mount #0
Created virtual mount #0
Creating virtual mount #1
Created virtual mount #1
Creating virtual mount #2
Created virtual mount #2
Creating virtual mount #3
Created virtual mount #3
Creating virtual mount #4
Created virtual mount #4
Creating virtual mount #5
Created virtual mount #5
Creating virtual mount #6
Created virtual mount #6
Creating virtual mount #7
Created virtual mount #7
Creating virtual mount #8
Created virtual mount #8
Creating virtual mount #9
Created virtual mount #9
Creating virtual mount #10
Created virtual mount #10
[...]
Creating virtual mount #99
Created virtual mount #99


Additional info:
A valgrind output was attached along with the code.

Comment 1 Niels de Vos 2017-04-13 18:39:48 UTC
It does not crash the 3rd time for me, but it also does not finish the 1000 iterations either...

    Created virtual mount #201
    Creating virtual mount #202
    Created virtual mount #202
    Creating virtual mount #203
    
    real    0m4.193s
    user    0m1.873s
    sys     0m1.307s
    [root@vm122-138 segfault-libgfapi.d]# echo $?
    24
    
    $ errno 24
    EMFILE: Too many open files

errno 24 seems to be the common return value though...

Running under Valgrind exits on creating mount #70 for me.

I'm looking into resource leaks already, and will include this test too.

Comment 2 Shyamsundar 2018-06-20 18:28:55 UTC
This bug reported is against a version of Gluster that is no longer maintained
(or has been EOL'd). See https://www.gluster.org/release-schedule/ for the
versions currently maintained.

As a result this bug is being closed.

If the bug persists on a maintained version of gluster or against the mainline
gluster repository, request that it be reopened and the Version field be marked
appropriately.


Note You need to log in before you can comment on or make changes to this bug.