Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101640 - irssi crashes when tweaking with the /exec -o switch
Summary: irssi crashes when tweaking with the /exec -o switch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Packages in net-irc
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 06:45 UTC by Amir Sadoughi
Modified: 2006-10-22 08:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gdb backtrace with full debug symbols (backtrace,4.54 KB, text/plain)
2005-08-07 08:25 UTC, Sven Wegener
Details
irssi-exec-segv.patch (irssi-exec-segv.patch,574 bytes, patch)
2006-09-24 09:55 UTC, Sven Wegener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Amir Sadoughi 2005-08-07 06:45:27 UTC
Running irssi v0.8.9, I was able to crash the process by running the following
three times:
/exec -o perl -e "print 'test'x1000000"

When it crashes, I debugged it with gdb and found out the following message:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 20016)]
0xb7b7d9c0 in stpcpy () from /lib/libc.so.6

Reproducible: Always
Steps to Reproduce:
1. Run irssi.
2. Connect to a server, preferably one without flood protection.
3. Join a channel.
4. Run the following until irssi crashes:
/exec -o perl -e "print 'test'x1000000"
Actual Results:  
irsssi crashed.

Expected Results:  
It should not have crashed.

N/A
Comment 1 Sven Wegener gentoo-dev 2005-08-07 08:25:15 UTC
Created attachment 65317 [details]
gdb backtrace with full debug symbols

Verified, crashes here too. Attached is a gdb backtrace with full debug symbols
Comment 2 Sven Wegener gentoo-dev 2005-08-07 10:09:25 UTC
This should fix it, but I'm looking for other weirdness.

Index: src/fe-common/core/fe-exec.c
===================================================================
--- src/fe-common/core/fe-exec.c        (revision 3900)
+++ src/fe-common/core/fe-exec.c        (working copy)
@@ -356,7 +356,8 @@

        recvlen = 0;
        err = g_io_channel_read(rec->in, tmpbuf,
-                               sizeof(tmpbuf), &recvlen);
+                               sizeof(tmpbuf) - 1, &recvlen);
+       tmpbuf[recvlen] = 0;
        if (err != 0 && err != G_IO_ERROR_AGAIN && errno != EINTR)
                recvlen = -1;

Comment 3 Sérgio Luís 2006-08-02 05:40:13 UTC
Can you include this patch in irssi?
Comment 4 Sven Wegener gentoo-dev 2006-09-15 13:06:42 UTC
Seems like the patch doesn't fix it.I just got irssi-0.8.10 to crash with the same command.
Comment 5 Sven Wegener gentoo-dev 2006-09-24 09:55:01 UTC
Created attachment 97955 [details, diff]
irssi-exec-segv.patch

Could you please try this patch (thanks to exg) and see if it correctly fixes this problem. For me this seems to work fine.
Comment 6 Sven Wegener gentoo-dev 2006-10-22 08:17:47 UTC
irssi-0.8.10-r4 includes the patch, so this is fixed in CVS.