View Issue Details

IDProjectCategoryView StatusLast Update
0005478unrealupgrade-confpublic2019-12-11 12:27
Reporterkenneaal Assigned Tosyzop  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.0.0-rc2 
Fixed in Version5.0.0 
Summary0005478: Memory leak in upgrade-conf (AddressSanitizer)
DescriptionRunning some test upgrades on our relatively standard 4.x config files cause the following errors and leaks some bytes:

kenneaal@minas-tirith:~/unrealircd$ ./unrealircd upgrade-conf
Attempting to upgrade '/home/kenneaal/unrealircd/conf/unrealircd.conf' (and all it's included files) from UnrealIRCd 3.2.x to UnrealIRCd 4.x...
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf:208: You have a close brace ('};') too many. Check line 208 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf:208 Ignoring extra semicolon
/home/kenneaal/unrealircd/conf/unrealircd.conf:209: Ignoring extra end comment
WARNING: Starting with UnrealIRCd 4.2.1 a /*-style comment stops as soon as the first */ is encountered. See https://www.unrealircd.org/docs/FAQ#Nesting_comments for more information.
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf:249: You have a close brace ('};') too many. Check line 249 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf:249 Ignoring extra semicolon
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf:254: You have a close brace ('};') too many. Check line 254 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf:254 Ignoring extra semicolon
/home/kenneaal/unrealircd/conf/unrealircd.conf:255: Ignoring extra end comment
WARNING: Starting with UnrealIRCd 4.2.1 a /*-style comment stops as soon as the first */ is encountered. See https://www.unrealircd.org/docs/FAQ#Nesting_comments for more information.
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf:208: You have a close brace ('};') too many. Check line 208 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf:208 Ignoring extra semicolon
/home/kenneaal/unrealircd/conf/unrealircd.conf:209: Ignoring extra end comment
WARNING: Starting with UnrealIRCd 4.2.1 a /*-style comment stops as soon as the first */ is encountered. See https://www.unrealircd.org/docs/FAQ#Nesting_comments for more information.
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf:249: You have a close brace ('};') too many. Check line 249 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf:249 Ignoring extra semicolon
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf:254: You have a close brace ('};') too many. Check line 254 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf:254 Ignoring extra semicolon
/home/kenneaal/unrealircd/conf/unrealircd.conf:255: Ignoring extra end comment
WARNING: Starting with UnrealIRCd 4.2.1 a /*-style comment stops as soon as the first */ is encountered. See https://www.unrealircd.org/docs/FAQ#Nesting_comments for more information.
Checking '/home/kenneaal/unrealircd/conf/unrealircd.conf'...
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:208: You have a close brace ('};') too many. Check line 208 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:208 Ignoring extra semicolon
/home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:209: Ignoring extra end comment
WARNING: Starting with UnrealIRCd 4.2.1 a /*-style comment stops as soon as the first */ is encountered. See https://www.unrealircd.org/docs/FAQ#Nesting_comments for more information.
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:249: You have a close brace ('};') too many. Check line 249 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:249 Ignoring extra semicolon
config error: /home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:254: You have a close brace ('};') too many. Check line 254 AND the lines above it from the previous block.
/home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:254 Ignoring extra semicolon
/home/kenneaal/unrealircd/conf/unrealircd.conf.tmp:255: Ignoring extra end comment
WARNING: Starting with UnrealIRCd 4.2.1 a /*-style comment stops as soon as the first */ is encountered. See https://www.unrealircd.org/docs/FAQ#Nesting_comments for more information.
config error: could not load configuration file '/home/kenneaal/unrealircd/conf/unrealircd.conf'
File '/home/kenneaal/unrealircd/conf/unrealircd.conf' left unchanged (no upgrade necessary)
Oh wait, /home/kenneaal/unrealircd/conf/unrealircd.conf needs an include for operclass.default.conf. Added.

1 configuration file(s) upgraded. You can now boot UnrealIRCd with your freshly converted conf's!
You should probably take a look at the converted configuration files now or at a later time.
See also https://www.unrealircd.org/docs/Upgrading_from_3.2.x and the sections in there (eg: Oper block)


=================================================================
==11271==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f3a00c624d8 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee4d8)
    #1 0x5584120ce38a in safe_alloc /home/kenneaal/unrealircd-5.0.0-rc2/src/support.c:687
    #2 0x5584120ee5c9 in add_include_list /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1553
    #3 0x5584120f4b87 in build_include_list_ex /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1569
    #4 0x5584120f4e67 in build_include_list /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1596
    #5 0x5584120f5000 in update_conf /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1612
    #6 0x558412057507 in main /home/kenneaal/unrealircd-5.0.0-rc2/src/ircd.c:1150
    #7 0x7f3a004fb09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)

Indirect leak of 47 byte(s) in 1 object(s) allocated from:
    #0 0x7f3a00baefa0 in __interceptor_strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3afa0)
    #1 0x5584120ce496 in our_strdup /home/kenneaal/unrealircd-5.0.0-rc2/src/support.c:696
    #2 0x5584120ee5f3 in add_include_list /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1556
    #3 0x5584120f4b87 in build_include_list_ex /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1569
    #4 0x5584120f4e67 in build_include_list /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1596
    #5 0x5584120f5000 in update_conf /home/kenneaal/unrealircd-5.0.0-rc2/src/updconf.c:1612
    #6 0x558412057507 in main /home/kenneaal/unrealircd-5.0.0-rc2/src/ircd.c:1150
    #7 0x7f3a004fb09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)

SUMMARY: AddressSanitizer: 71 byte(s) leaked in 2 allocation(s).
1 kenneaal@minas-tirith:~/unrealircd$
Steps To ReproduceReproduces consistently with our config files; they are available if you need them, though we'd prefer to upload them outside of the public view.
Tagsmemory-leak upgrade-conf
3rd party modules

Activities

syzop

2019-12-11 12:26

administrator   ~0021157

Last edited: 2019-12-11 12:27

Thanks for the report. I did not fix the memory leak itself but did make a chance a few days ago that will make it no longer print this message anymore (unless doing special asan builds), so that pretty much fixes it for end users.

More important: I have added a warning that upgrade-conf should only be used in specific circumstances. I can understand how people would use it since they also used the command many years ago. I did not think of that until you reported this issue, so thanks for that :)

It now prints this text on ./unrealircd upgrade-conf:
**
You have requested to upgrade your configuration files.
If you are upgrading from 4.x to 5.x then DO NOT run this script. This script does NOT update config files from 4.x -> 5.x.
UnrealIRCd 4.2.x configuration files should work OK on 5.x, with only some warnings printed when you boot the IRCd.
See https://www.unrealircd.org/docs/Upgrading_from_4.x#Configuration_changes
This upgrade-conf script is only useful if you are upgrading from 3.2.x.

Continue upgrading 3.2.x to 4.x configuration file format? (Y/N):
**

Issue History

Date Modified Username Field Change
2019-12-02 11:29 kenneaal New Issue
2019-12-02 11:29 kenneaal Tag Attached: memory-leak upgrade-conf
2019-12-11 12:26 syzop Assigned To => syzop
2019-12-11 12:26 syzop Status new => resolved
2019-12-11 12:26 syzop Resolution open => fixed
2019-12-11 12:26 syzop Fixed in Version => 5.0.0
2019-12-11 12:26 syzop Note Added: 0021157
2019-12-11 12:27 syzop Note Edited: 0021157
2019-12-11 12:27 syzop Note Edited: 0021157