Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more config checks and assertions in statusbar code #994

Merged
merged 1 commit into from
Feb 2, 2019

Conversation

ailin-nemui
Copy link
Contributor

should fix #993

@josephbisch
Copy link
Member

(gdb) r --config=config.min
Starting program: /home/joseph/install/irssi-fix-993/bin/irssi --config=config.min
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

** (irssi:6014): CRITICAL **: 14:42:36.008: Expected block node at `/00000000' was of scalar type. Corrupt config?

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff76c8879 in _g_log_abort (breakpoint=1) at gmessages.c:554
554	    G_BREAKPOINT ();
(gdb) bt
#0  0x00007ffff76c8879 in _g_log_abort (breakpoint=1) at gmessages.c:554
#1  0x00007ffff76c7891 in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x555555a36260 <.str.5> "Expected %s node at `%s%s/%s' was of scalar type. Corrupt config?", args=0x7fffffffdce0) at gmessages.c:1371
#2  0x00007ffff76c6c9d in g_log (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x555555a36260 <.str.5> "Expected %s node at `%s%s/%s' was of scalar type. Corrupt config?") at gmessages.c:1413
#3  0x000055555598830c in config_node_section_index (rec=0x6070000001e0, parent=0x60300000b560, key=0x6020000007b0 "00000000", index=-1, new_type=2) at get.c:76
#4  0x000055555598e11e in config_parse_symbol (rec=<optimized out>, node=<optimized out>) at parse.c:176
#5  config_parse_loop (rec=0x6070000001e0, node=<optimized out>, expect=G_TOKEN_EOF) at parse.c:223
#6  0x000055555598cba6 in config_parse (rec=0x6070000001e0) at parse.c:283
#7  0x000055555596d8f9 in parse_configfile (fname=0x606000001040 "/home/joseph/install/irssi-fix-993/config.min") at settings.c:751
#8  0x000055555596e68b in init_configfile () at settings.c:777
#9  settings_init () at settings.c:884
#10 0x0000555555923ae7 in core_init () at core.c:240
#11 0x00005555557ebb18 in textui_init () at irssi.c:152
#12 main (argc=<optimized out>, argv=<optimized out>) at irssi.c:328
$ hexdump -C config.min 
00000000  22 22 22 22 22 22 3b 30  22 22 30 30 30 30 30 30  |"""""";0""000000|
00000010  30 30 22 22 30 30 30 30  30 30 30 30 7b           |00""00000000{|
0000001d

@josephbisch
Copy link
Member

(gdb) r --config=config2.min
Starting program: /home/joseph/install/irssi-fix-993/bin/irssi --config=config2.min
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

** (irssi:6935): CRITICAL **: 14:46:25.872: Expected list node at `/0' was of scalar type. Corrupt config?

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff76c8879 in _g_log_abort (breakpoint=1) at gmessages.c:554
554	    G_BREAKPOINT ();
(gdb) bt
#0  0x00007ffff76c8879 in _g_log_abort (breakpoint=1) at gmessages.c:554
#1  0x00007ffff76c7891 in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x555555a36260 <.str.5> "Expected %s node at `%s%s/%s' was of scalar type. Corrupt config?", args=0x7fffffffdce0) at gmessages.c:1371
#2  0x00007ffff76c6c9d in g_log (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x555555a36260 <.str.5> "Expected %s node at `%s%s/%s' was of scalar type. Corrupt config?") at gmessages.c:1413
#3  0x000055555598830c in config_node_section_index (rec=0x6070000001e0, parent=0x60300000b560, key=0x6020000005b0 "0", index=-1, new_type=3) at get.c:76
#4  0x000055555598e54c in config_parse_symbol (rec=<optimized out>, node=<optimized out>) at parse.c:191
#5  config_parse_loop (rec=0x6070000001e0, node=<optimized out>, expect=G_TOKEN_EOF) at parse.c:223
#6  0x000055555598cba6 in config_parse (rec=0x6070000001e0) at parse.c:283
#7  0x000055555596d8f9 in parse_configfile (fname=0x606000001040 "/home/joseph/install/irssi-fix-993/config2.min") at settings.c:751
#8  0x000055555596e68b in init_configfile () at settings.c:777
#9  settings_init () at settings.c:884
#10 0x0000555555923ae7 in core_init () at core.c:240
#11 0x00005555557ebb18 in textui_init () at irssi.c:152
#12 main (argc=<optimized out>, argv=<optimized out>) at irssi.c:328
hexdump -C config2.min 
00000000  30 20 30 29 30 28                                 |0 0)0(|
00000006

@josephbisch
Copy link
Member

(gdb) r --config=config2.min
Starting program: /home/joseph/install/irssi-fix-993/bin/irssi --config=config2.min
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

** (irssi:7927): CRITICAL **: 14:49:25.157: Expected section node at `/statusbar' was of scalar type. Corrupt config?

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff76c8879 in _g_log_abort (breakpoint=1) at gmessages.c:554
554	    G_BREAKPOINT ();
(gdb) bt
#0  0x00007ffff76c8879 in _g_log_abort (breakpoint=1) at gmessages.c:554
#1  0x00007ffff76c7891 in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x555555a36260 <.str.5> "Expected %s node at `%s%s/%s' was of scalar type. Corrupt config?", args=0x7fffffffe040) at gmessages.c:1371
#2  0x00007ffff76c6c9d in g_log (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x555555a36260 <.str.5> "Expected %s node at `%s%s/%s' was of scalar type. Corrupt config?") at gmessages.c:1413
#3  0x000055555598830c in config_node_section_index (rec=0x6070000001e0, parent=0x60300000b560, key=0x6020000f4cb0 "statusbar", index=-1, new_type=-1) at get.c:76
#4  0x0000555555988deb in config_node_section (rec=<optimized out>, parent=<optimized out>, key=0xffffffff "", new_type=-1) at get.c:43
#5  config_node_traverse (rec=0x6070000001e0, section=0x5555559cda60 <.str.3> "statusbar", create=0) at get.c:145
#6  0x00005555557be221 in read_statusbar_config () at statusbar-config.c:275
#7  0x00005555557bde57 in statusbar_config_init () at statusbar-config.c:790
#8  0x00005555557ebc3d in textui_finish_init () at irssi.c:182
#9  main (argc=<optimized out>, argv=<optimized out>) at irssi.c:336
$ hexdump -C config2.min 
00000000  30 22 22 30 22 22 53 54  41 54 55 53 42 41 52 22  |0""0""STATUSBAR"|
00000010  22                                                |"|
00000011

@ailin-nemui ailin-nemui added the auto-merge This PR is scheduled for merge if no further comments are opened label Jan 28, 2019
@ailin-nemui
Copy link
Contributor Author

@irssi/developers

@ailin-nemui ailin-nemui merged commit ff18e79 into irssi:master Feb 2, 2019
@ailin-nemui ailin-nemui deleted the fix-993 branch February 2, 2019 13:35
@ailin-nemui ailin-nemui added this to the 1.2.0 milestone Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge This PR is scheduled for merge if no further comments are opened
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segfault / null pointer dereference in statusbar_read()
2 participants