[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gambas3 ide 3.19.1 - gbx3 [2993]: warning: 2 allocation(s) non freed.


I think I have found the problem: The RDir implementation has issues with unreadable directories (related to access).

Here is the test:

Execute the following commands as root:
# all dirs/files readable for regular users
mkdir -p /tmp/gtests/test_1/aaa
touch /tmp/gtests/test_1/aaa/111
mkdir -p /tmp/gtests/test_1/bbb
touch /tmp/gtests/test_1/bbb/222
mkdir -p /tmp/gtests/test_1/ccc
touch /tmp/gtests/test_1/ccc/333

# dir /tmp/gtests/test_2/bbb not readable for regular users
cp -a /tmp/gtests/test_1 /tmp/gtests/test_2
chmod 700 /tmp/gtests/test_2/bbb

# file /tmp/gtests/test_3/bbb/222 not readable for regular users
cp -a /tmp/gtests/test_1 /tmp/gtests/test_3
chmod 600 /tmp/gtests/test_3/bbb/222


Now use the following gambas-script (/tmp/test.g) for testing:
#!/usr/bin/env gbs3

Dim sDir As String
Dim sFile As String

sDir = "/tmp/gtests/test_1"
'sDir = "/tmp/gtests/test_2"
'sDir = "/tmp/gtests/test_3"

For Each sFile In RDir(sDir, "", gb.File, False)
  Print sFile
Next


If I change the variable sDir accordingly and run the script, the result is
$ /tmp/test.g   # (/tmp/gtests/test_1)
ccc/333
bbb/222
aaa/111

$ /tmp/test.g   # (/tmp/gtests/test_2)
ccc/333
aaa/111
gbx3 [23705]: warning: 2 allocation(s) non freed.

$ /tmp/test.g   # (/tmp/gtests/test_3)
ccc/333
bbb/222
aaa/111

Similarly, you can test this with the gambas-ide by calling up the "System Information" after the start and terminating the ide again immediately:

$ LIBPATH="/tmp/gtests/test_1" GB_GUI=gb.qt5 gambas3
# no output, no errors

$ LIBPATH="/tmp/gtests/test_2" GB_GUI=gb.qt5 gambas3
gbx3 [24318]: warning: 2 allocation(s) non freed.

$ LIBPATH="/tmp/gtests/test_3" GB_GUI=gb.qt5 gambas3
# also no output, no errors

In openSUSE there is a directory under /usr/lib64 which is access restricted:
$ ls /usr/lib64/mysql/plugin/auth_pam_tool_dir
ls: cannot open directory '/usr/lib64/mysql/plugin/auth_pam_tool_dir': Permission denied


Follow-Ups:
Re: gambas3 ide 3.19.1 - gbx3 [2993]: warning: 2 allocation(s) non freed.Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>