Closed jirib closed 12 years ago
I think this is about the same issue as ticket #5, I will investigate and brush up some openbsd skills :-)
Debug tip for OpenBSD: ln -s 'DFG' /etc/malloc.conf See MALLOC(3) for the meaning. I didn't have time too properly reproduce this bug yet.
I get the same segfault. I also tried to generate the keys from somewhere else, but it doesn't help. Any advance on that ?
Working on it.
cam0 are you using a shell somewhere where this occurs? Sofar, this only seems to happen if someone is running it from an openbsd or linux shell with restrictions.
I am trying to run it on an OpenBsd in a screen, but without any particular restriction. I compiled the otr plugin (from git) myself with the last version or irssi (0.8.15), but it was a bit of a hacking (files missing, wrong path, etc).
/otr genkey nick@irc.server.com irssi in free(): error: bogus pointer (double free?) 0x26e7f020 zsh: abort (core dumped) irssi. Backtrace is pretty much the same:
(gdb) bt
) at /usr/src/lib/libc/stdlib/malloc.c:387
at /tmp/irssi-otr-0.3/otr_key.c:161
item=0x7ea25400) at /tmp/irssi-otr-0.3/irssi_otr.c:182
) at signals.c:242
at signals.c:286
data=0x7c7ee3cc "genkey nick@irc.server.com ", server=0x86ae05e0, item=0x7ea25400)
at commands.c:329
item=0x7ea25400) at /tmp/irssi-otr-0.3/irssi_otr.c:94
) at signals.c:242
server=0x86ae05e0, item=0x7ea25400) at commands.c:899
) at signals.c:242
) at signals.c:242
at keyboard.c:639
) at signals.c:242
) at signals.c:242
at signals.c:286
at misc.c:54
Thanks,
c0
Another small question, what openbsd version are you running?
I'll hope to get this fixed soon.
Damn, I forgot to add that: % uname -a OpenBSD [,,,] 4.9 GENERIC#671 i386
thanks
I just had a look. 'dirname' is not portable, so I propose this patch that makes irssi-otr work for me:
[16:59 cam0 ~]% diff -u /tmp/irssiotr-HEAD-fd11e69/otr_key.c otr_key.c
--- /tmp/irssiotr-HEAD-fd11e69/otr_key.c Sun Feb 22 01:29:14 2009
+++ otr_key.c Thu Oct 27 16:43:29 2011
@@ -140,7 +140,8 @@
int ret;
int fds[2];
char *filename = g_strconcat(get_client_config_dir(),TMPKEYFILE,NULL);
- char *dir = dirname(g_strdup(filename));
+ char *filenamedup = g_strdup(filename);
+ char *dir = dirname(filenamedup);
if (kg_st.status!=KEYGEN_NO) {
if (strcmp(accname,kg_st.accountname)!=0)
@@ -153,13 +154,13 @@
if (g_mkdir(dir,S_IRWXU)) {
otr_noticest(TXT_KG_ABORTED_DIR,
accname,dir,strerror(errno));
- g_free(dir);
+ g_free(filenamedup);
g_free(filename);
return;
} else
otr_noticest(TXT_KG_MKDIR,dir);
}
- g_free(dir);
+ g_free(filenamedup);
if (pipe(fds) != 0) {
otr_noticest(TXT_KG_PIPE,
Excellent! I will test and merge it this weekend.
Pushed!
I will close the issue, feel free to reopen if something broke.
Hello,
I found irssi-otr core dumping ("old" version even this new fork). It core dumps when generating key.
If I should provide more info, please let me know. Thank you.
sys: OpenBSD 5.0-beta (i386) irssi-otr: 25. 7. 2011 (git) irssi: 0.8.15