?

Log in

No account? Create an account
gdb output from "logjam offline grep" segfault second try - LogJam [entries|archive|friends|userinfo]
LogJam

[ website | LogJam ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

gdb output from "logjam offline grep" segfault second try [Oct. 23rd, 2005|02:44 pm]
LogJam

logjam

[substitute]
Of possible interest, when I do "logjam offline sync" I get a nonfatal error during the sync like this:

26.5% xmlEscapeEntities : char out of range 28.9%

A gdb backtrace of logjam built with symbols and as many debug libs as I could get looks like this when I do: logjam offline grep "macguffin" etc.

#0 0xb772f433 in strlen () from /usr/lib/debug/libc.so.6
#1 0xb7767889 in __regexec (preg=0xbffa56dc, string=0x0, nmatch=0,
pmatch=0x0, eflags=0) at regexec.c:234
#2 0x08055019 in do_offline_grep (cmdline=0xbffa5a18, acc=0x80be5d0, argc=2,
argv=0xbffa5aec) at cmdline.c:452
#3 0x08055e40 in command_dispatch (cmdline=0xbffa5a18, commands=0xbffa57d8,
help=0x808adcc "Manage offline copies of your journal.\n", argc=2,
argv=0xbffa5aec) at cmdline.c:704
#4 0x08055701 in do_offline (cmdline=0xbffa5a18, acc=0x80be5d0, argc=3,
argv=0xbffa5ae8) at cmdline.c:545
#5 0x08055e40 in command_dispatch (cmdline=0xbffa5a18, commands=0xbffa5988,
help=0x8089f0c "Options:\n -v, --version", ' ' , "Show version of program.\n -q, --quiet", ' ' , "Say less.\n\n -u, --username", ' ' , "Username to operate as.\n -p, --"...,
argc=3, argv=0xbffa5ae8) at cmdline.c:704
#6 0x080561c3 in cmdline_parse (doc=0x80cd6a0, argc=4, argv=0xbffa5ae4)
at cmdline.c:739
#7 0x08053ede in main (argc=4, argv=0xbffa5ae4) at init.c:217
LinkReply

Comments:
(Deleted comment)
From: evan
2005-10-24 01:08 am (UTC)
Sounds right to me!

I guess the best fix would to be call glib's UTF-8 validation code when pulling entries from the server and fixing it up there, before it ever gets into the LJEntry struct (and subsequently the XML store).

...wait a sec, we actually do that! lj_entry_new_from_result calls verify_utf8.

...and now that I look, addtextchildenc appears to try to encode entities but the code is wrong! It never uses the encoded value. That makes sense anyway, as libxml ought to do the escaping for us.
(Reply) (Parent) (Thread)
From: evan
2005-10-24 01:12 am (UTC)
I should just deprecate the xml storage. Yuck.
(Reply) (Parent) (Thread)
From: evan
2005-10-24 01:33 am (UTC)
In any case, we can at least hack around this, and add a debug print to help it get tracked down.
(Reply) (Parent) (Thread)
From: evan
2005-10-24 01:49 am (UTC)
http://www.livejournal.com/community/logjam_cvs/120603.html

if you get the chance, grab that and lemme know if it helps.
(Reply) (Thread)
[User Picture]From: substitute
2005-10-24 08:30 am (UTC)

That fixed it!

You guys rule.
(Reply) (Parent) (Thread)