I have done some testing today and this error occurs if you have 5 custom plugins-*.ini files or more, it will load the first four it finds in the directory.
Here is what a strace gives:
Code:
munmap(0x43b7a000, 4096) = 0
open("cstrike/addons/amxmodx/configs/plugins.ini", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43b7a000
read(5, "", 4096) = 0
close(5) = 0
munmap(0x43b7a000, 4096) = 0
open("cstrike/addons/amxmodx/configs/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 5
fstat64(5, {st_mode=S_IFDIR|0755, st_size=24576, ...}) = 0
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
getdents64(5, /* 21 entries */, 4096) = 704
getdents64(5, /* 0 entries */, 4096) = 0
close(5) = 0
open("cstrike/addons/amxmodx/configs/plugins-5.ini", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43b7a000
read(5, "", 4096) = 0
close(5) = 0
munmap(0x43b7a000, 4096) = 0
open("cstrike/addons/amxmodx/configs/plugins-4.ini", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43b7a000
read(5, "", 4096) = 0
close(5) = 0
munmap(0x43b7a000, 4096) = 0
open("cstrike/addons/amxmodx/configs/plugins-3.ini", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43b7a000
read(5, "", 4096) = 0
close(5) = 0
munmap(0x43b7a000, 4096) = 0
open("cstrike/addons/amxmodx/configs/plugins-2.ini", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43b7a000
read(5, "", 4096) = 0
close(5) = 0
munmap(0x43b7a000, 4096) = 0
open("cstrike/addons/amxmodx/plugins/plugins-1.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
Check the last open() for the plugins-1.ini file. It has suddenly switched from cstrike/addons/amxmodx/configs/ to cstrike/addons/amxmodx/plugins.
So I added some debug code and found out that the problem is inside meta_api.cpp. The function LoadExtraPluginsFromDir should loop the config directory for any plugins-*.ini files and it also does this. However in the while loop after, BuildPluginFileList(initialdir, files);, initaldir gets changed after four times hence the fifth time it have changed to say addons/amxmodx/plugins instead of addons/amxmodx/configs.
Quick fix is to change:
Code:
snprintf(path, sizeof(path)-1, "%s/%s",
initialdir,
pString->c_str());
to:
Code:
snprintf(path, sizeof(path)-1, "%s/%s",
get_localinfo("amxx_configsdir", "addons/amxmodx/configs"),
pString->c_str());
also I think the thing that causing this is a memory corruption thing in the build_pathname_r() from modules.cpp