Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: hostserv request causing panic  (Read 4282 times)

0 Members and 1 Guest are viewing this topic.

Currawong

  • Guest
hostserv request causing panic
« on: March 30, 2006, 10:49:26 AM »

I've compiled 1.7.14 in Mac OS X 10.4.  It's been working fine until today when panics started occurring:

*** Global -- from services.madchat.tv: PANIC! buffer = :Currawong PRIVMSG hostserv :request appletalk.com.au

I've tried with fresh hs_request.db and hosts.db to no avail.  I can post an entire panic log if required.

Any idea what might be going on?

[Edited on 30-3-2006 by Currawong]
Logged

ShelLuser

  • Guest
(No subject)
« Reply #1 on: March 30, 2006, 08:22:07 PM »

What IRCd are you using?  I guess it could be possible that HostServ picks up the capabilities the wrong way.
Logged

Currawong

  • Guest
(No subject)
« Reply #2 on: April 01, 2006, 02:37:26 AM »

We're using UnrealIRCd.  Sorry, I should have specified that.  It was all working fine.  Updating to 1.7.14 made no difference.

I've found that it's very easy to end up with the module loading line at the beginning of the .conf file to wrap if one is careless with pico.  This is making me paranoid that I haven't typoed something in the config file, though I've gone through it more times than I can count.

Edit: Here's the first part of one of the crash logs:

Command: services
Path:    ./services
Version: ??? (???)
PID:     15417
Thread:  0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x0000000c

Thread 0 Crashed:
0   hs_request.so.l8ZYEA        0x01015324 my_memo_lang + 0xf0 (hs_request.c:277)
1   hs_request.so.l8ZYEA        0x01015474 req_send_memos + 0x80 (hs_request.c:307)
2   hs_request.so.l8ZYEA        0x010151b4 hs_do_request + 0x290 (hs_request.c:238)
3   services                    0x00011950 do_run_cmd + 0xd8 (commands.c:101)
4   services                    0x00020890 m_privmsg + 0x3ec (messages.c:196)
5   unreal32.so.jzJuhi          0x001830d4 anope_event_privmsg + 0x24 (unreal32.c:1506)
6   services                    0x00031940 process + 0x258 (process.c:277)
7   services                    0x0001f164 main + 0x38c (main.c:580)
8   services                    0x00001f64 _start + 0x188 (crt.c:267)
9   services                    0x00001dd8 start + 0x30


[Edited on 1-4-2006 by Currawong]
Logged

ShelLuser

  • Guest
(No subject)
« Reply #3 on: April 01, 2006, 02:08:56 PM »

Hmm, I am not sure here but I wonder if your permissions are still setup correctly. Especially the 'KERN_PROTECTION_FAILURE' makes me wonder if your server isn't denying certain options.
Logged

Currawong

  • Guest
(No subject)
« Reply #4 on: April 01, 2006, 02:23:45 PM »

Figured it out.  If i rm modules/runtime/* the problem is fixed. I hadn't realized the modules produced a bunch of runtime files.  I was incidentally checking the permissions of all the files using ls -lR and couldn't help wondering why a bunch of *.so.random files existed.  So though kernel protection failure relates to memory and not permissions, the first 3 lines in the crash log gave the game away.

0 hs_request.so.l8ZYEA 0x01015324 my_memo_lang + 0xf0 (hs_request.c:277)
1 hs_request.so.l8ZYEA 0x01015474 req_send_memos + 0x80 (hs_request.c:307)
2 hs_request.so.l8ZYEA 0x010151b4 hs_do_request + 0x290 (hs_request.c:238)
Logged

Currawong

  • Guest
(No subject)
« Reply #5 on: April 21, 2006, 06:00:00 AM »

Bumping this, as it's come back again.  Deleting the runtime files only fixes it briefly, then the crashes return.  It's compiled on Mac OS X 10.3.9 with GCC 3, which makes me wonder if that isn't the reason for the crashes.  See the last post for the details of where in the code the crash is occurring.

Anyone have an idea what in my_memo_lang + 0xf0 (hs_request.c:277) is causing the problem and how to fix it?  Should I compile it again and post any warnings or errors here relating to hs_request.c?
Logged

Currawong

  • Guest
(No subject)
« Reply #6 on: April 22, 2006, 12:29:45 AM »

This is the function in the code the panic log is referring to.  The line being referred to in panic logs is buf = sstrdup(fmt);.  A friend of mine who has some coding experience reckons that the data being called is null, causing the panic, but that's just a guess.  
Code: [Select]

void my_memo_lang(User * u, char *name, int z, int number, ...)
{
    va_list va;
    char buffer[4096], outbuf[4096];
    char *fmt = NULL;
    int lang = LANG_EN_US;
    char *s, *t, *buf;
    User *u2;

    if ((mod_current_module_name)
        && (!mod_current_module
            || strcmp(mod_current_module_name, mod_current_module->name)))
        mod_current_module = findModule(mod_current_module_name);

    u2 = finduser(name);
    /* Find the users lang, and use it if we cant */
    if (u2 && u2->na && u2->na->nc)
        lang = u2->na->nc->language;

    /* If the users lang isnt supported, drop back to enlgish */
    if (mod_current_module->lang[lang].argc == 0)
        lang = LANG_EN_US;

    /* If the requested lang string exists for the language */
    if (mod_current_module->lang[lang].argc > number) {
        fmt = mod_current_module->lang[lang].argv[number];

        buf = sstrdup(fmt);
        s = buf;
        while (*s) {
            t = s;
            s += strcspn(s, "\n");
            if (*s)
                *s++ = '\0';
            strscpy(outbuf, t, sizeof(outbuf));

            va_start(va, number);
            vsnprintf(buffer, 4095, outbuf, va);
            va_end(va);
            memo_send(u, name, buffer, z);
        }
        free(buf);
    } else {
        alog("%s: INVALID language string call, language: [%d], String [%d]", mod_current_module->name, lang, number);
    }
}

[Edited on 21-4-2006 by Currawong]
Logged

Currawong

  • Guest
Edit: Submitted this to Bugzilla
« Reply #7 on: May 22, 2006, 09:29:56 AM »

I'm bumping this thread with the output generated in hs_request.db when Anope crashes on /hostserv request apple.com:
Code: [Select]

Currawong:(null):apple.com:442E7DA1:Currawong

This appears to be a similar bug to this one - "sstrdup() called with NULL-arg" mentioned in the forums here.


[Edited on 22-5-2006 by Currawong]
Logged
Pages: [1]   Go Up