Harvie/libpurple-core-answerscripts

Answerscripts.so makes pidgin crash when startup

Opened this issue · 16 comments

I'm trying answerscripts with Pidgin 2.7.11 and cannot make it to run. Plugin seems to make Pidgin crash. Here's backtrace: http://pastebin.com/57pd14SV

For more info: Commenting line "setenv(ENV_PREFIX "L_AGENT_VERSION", (char *) purple_core_get_version(), 1); //Version of client" from init_plugin function fixes crashing problem.

try latest git version pls :)

Still crash with latest git version. Commenting setenv line make it work again.

fuck :)

Please let me know what output you will se in console with this debug line:
putchar('['); puts((char *) core_version); putchar(']'); //Debug
setenv(ENV_PREFIX "L_AGENT_VERSION", (char *) core_version, 1); //Version of client

and you can also try this:
setenv(ENV_PREFIX "L_AGENT_VERSION", (const char *) core_version, 1); //Version of client

BTW what operation system (os, [kernel, distro,] version) are you using?

Here it is http://pastebin.com/4MBWa9WM . I'm using ArchLinux kernel 2.6.38.4, Pidgin 2.7.11.
And adding const to char* doesn't help.

http://pastebin.com/4MBWa9WM --> Unknown Paste ID!

I have no crash on this (32bit):

[15:39:28] 0 ;) harvie@insomnia ~ $ uname -a
Linux insomnia 2.6.38-ARCH #1 SMP PREEMPT Tue May 10 06:36:08 UTC 2011 i686 Mobile AMD Sempron(tm) Processor 3000+ AuthenticAMD GNU/Linux

[15:40:51] 0 ;) harvie@insomnia ~ $ /usr/bin/pacman -Qv kernel26 |tail -n 1
kernel26 2.6.38.6-1
[15:41:00] 0 ;) harvie@insomnia ~ $ /usr/bin/pacman -Qv pidgin |tail -n 1
pidgin 2.7.11-3

Sorry, here it is http://paste2.org/p/1417336 . I'm using the same Pidgin version but on 64bit.

It seems to me like some bug in 64b pidgin... I probably returns incorrect address to version string. (It points somewhere else instead which causes SEGV when i try to read string from that address. Can you also try to build pidgin from ABS using latest GCC with all optimalizations disabled?

(I don't have any 64b machine, so i can't make those experiments on myself)

Recompiled and still crashed. These are arguments to ./configure http://paste2.org/p/1417381

I can reccomend you to fill upstream libpurple bug at http://developer.pidgin.im/
and ask why purple_core_get_version() is returning crap on 64b...

BTW if you will do so, please post here URL of that issue so we can give votes to it and watch status.

Still issue with latest pidgin? BTW pidgin 2.8 seems buggy to me (but not related to this issue...)

Issue still persists on Pidgin 2.10.1, x86_64. Commenting both of these lines helped me.

setenv(ENV_PREFIX "L_AGENT", (char *) core_ui, 1);  //ID of IM client used with answerscripts
setenv(ENV_PREFIX "L_AGENT_VERSION", (char *) core_version, 1); //Version of client

also, a little off-topic, scripts don't work within multichats, can anything be done about that?

Well as workaround i've disabled L_AGENT on 64b.

BTW can you try to move those lines:

    const char * core_ui = purple_core_get_ui() != 0 ? (const char *) purple_core_get_ui() : "";
    const char * core_version = purple_core_get_version() != 0 ? (const char *) purple_core_get_version() : "";
    setenv(ENV_PREFIX "L_AGENT", (char *) core_ui, 1);  //ID of IM client used with answerscripts
    setenv(ENV_PREFIX "L_AGENT_VERSION", (char *) core_version, 1); //Version of client

Just after this line (where all other setenvs are):

setenv(ENV_PREFIX "L_STATUS_MSG", status_msg, 1); //status message set by local user

i think it may help... but i am not sure... let me know please.

Tried to move those lines, now Pidgin will start normally but crashes with the same error immediately when any message is received.

After latest system upgrades it started to crash for me on archlinux too. Maybe because i switched to 64b kernel... But i still use 32b userspace... BTW It happens only for ICQ messages, Jabber and IRC are OK. Same backtrace as yours. Maybe pidgin is returning bad pointer somewhere...

Only good part is that i can reproduce it now :-)

However there's upstream ticket:
https://developer.pidgin.im/ticket/15167