clean up configure

Bug #446680 reported by Albert Lee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CtrlProxy
Fix Released
Low
Unassigned

Bug Description

Thanks for apply the changes in #402502. I found configure could use some minor improvements:
Remove a use of 'if !' which doesn't work on plain Bourne sh.
Moved the libgcrypt check to only affect GNUTLS_LIBS so libgcrypt isn't linked to everything.

There's also potential problems with the use of "%s" formatting of NULL pointers in libirc's
network_nick_set_nick/username/hostname functions. These result in undefined behaviour. On Solaris and older OpenSolaris releases this is defined as a SIGSEGV. This can be consistently reproduced in state handling calling network_nick_set_nick when reconnecting. Since the strings are used to generate a hostmask, I have replaced NULLs with "*".

I am filing a separate bug for compiler-related issues.

Revision history for this message
Albert Lee (trisk) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks, I've merged the configure patch.

The fix for dealing with username/nickname/hostname being NULL is incorrect - those functions should not be called with those values in the first place.

Changed in ctrlproxy:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Albert Lee (trisk) wrote :

Should I move this to a new bug?
Here's an example of network_nick_set_nick being called with n->username and n->hostname = NULL; iirc this was immediately after reattaching a detached session:

[2009-10-07 14:28:35] Received SIGSEGV!
[2009-10-07 14:28:35] BACKTRACE: 20 stack frames:
[2009-10-07 14:28:35] #0 /usr/bin/ctrlproxy'signal_crash+0x1c [0x1b8f4]
[2009-10-07 14:28:35] #1 /lib/libc.so.1'__sighndlr+0xc [0xff2c1910]
[2009-10-07 14:28:35] #2 /lib/libc.so.1'call_user_handler+0x42c [0xff2b6128]
[2009-10-07 14:28:35] #3 /lib/libc.so.1'sigacthandler+0x48 [0xff2b633c]
[2009-10-07 14:28:35] #4 /lib/libc.so.1'strlen+0x50 [0xff23fe10]
[2009-10-07 14:28:35] #5 /lib/libc.so.1'vsnprintf+0x64 [0xff28b490]
[2009-10-07 14:28:35] #6 /usr/lib/libglib-2.0.so.0.1600.3'g_printf_string_upper_bound+0x10 [0xff154b84]
[2009-10-07 14:28:35] #7 /usr/lib/libglib-2.0.so.0.1600.3'g_vasprintf+0x68 [0xff1898d0]
[2009-10-07 14:28:35] #8 /usr/lib/libglib-2.0.so.0.1600.3'g_strdup_vprintf+0x10 [0xff16df70]
[2009-10-07 14:28:35] #9 /usr/lib/libglib-2.0.so.0.1600.3'g_strdup_printf+0x1c [0xff16dfa0]
[2009-10-07 14:28:35] #10 /usr/bin/ctrlproxy'network_nick_set_nick+0x6c [0x2d9d0]
[2009-10-07 14:28:35] #11 /usr/bin/ctrlproxy'state_handle_data+0xe4 [0x2f8ec]
[2009-10-07 14:28:35] #12 /usr/bin/ctrlproxy'process_from_server+0x100 [0x2b7c0]
[2009-10-07 14:28:35] #13 /usr/bin/ctrlproxy'handle_transport_receive+0xbc [0x312cc]
[2009-10-07 14:28:35] #14 /usr/lib/libglib-2.0.so.0.1600.3'g_main_dispatch+0x1e0 [0xff148d9c]
[2009-10-07 14:28:35] #15 /usr/lib/libglib-2.0.so.0.1600.3'g_main_context_dispatch+0xc8 [0xff14a440]
[2009-10-07 14:28:35] #16 /usr/lib/libglib-2.0.so.0.1600.3'g_main_context_iterate+0x49c [0xff14a960]
[2009-10-07 14:28:35] #17 /usr/lib/libglib-2.0.so.0.1600.3'g_main_loop_run+0x3e4 [0xff14b264]
[2009-10-07 14:28:35] #18 /usr/bin/ctrlproxy'main+0x528 [0x1c0bc]
[2009-10-07 14:28:35] #19 /usr/bin/ctrlproxy'_start+0x108 [0x1b400]
[2009-10-07 14:28:35] Please send a bug report to <email address hidden>.
[2009-10-07 14:28:35] A gdb backtrace is appreciated if you can reproduce this bug.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Yes, please move it into a new bug.

Changed in ctrlproxy:
status: Triaged → Fix Released
summary: - Fix a potential crash in libirc, clean up configure
+ clean up configure
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.