azynheira / mu0

Automatically exported from code.google.com/p/mu0
0 stars 0 forks source link

seg fault on vanilla arch install #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.vanilla arch linux install
2.install xapian-core 1.6.8, gmime 2.6.6, mu 0.9.8.1
3.run 'mu find'

What is the expected output? What do you see instead?
segmentation fault

What version of the product are you using? On what operating system?
Linux (none) 3.2.7-1-ARCH #1 SMP PREEMPT Tue Feb 21 09:51:29 CET 2012 x86_64 
Intel(R) Core(TM) i5-2557M CPU @ 1.70GHz GenuineIntel GNU/Linux

Please provide any additional information below.
was working perfectly on my chakra distro. running 'make check' also produces a 
test error, log file attached.

Original issue reported on code.google.com by urban.yo...@gmail.com on 26 Feb 2012 at 5:47

Attachments:

GoogleCodeExporter commented 8 years ago
Hmm, I cannot reproduce the 'make check' failure. 

Anyway, can you make a backtrace of the crash? Ie.

so (replace searchparameters with the parameters you used in your search): 
   $ gdb --args mu find searchparameters 

Then on the gdb prompt type 'r', enter:
   (gdb) r
then the program runs; when it crashes, type 'bt' enter and gdb will print the 
backtrace. If you can put that here, I can see what is going on.

Original comment by digg...@gmail.com on 28 Feb 2012 at 6:01

GoogleCodeExporter commented 8 years ago
Program received signal SIGSEGV, Segmentation fault.
0x0000000000418c4c in output_plain_fields (color=<optimized out>, 
fields=<optimized out>, msg=<optimized out>, threads=<optimized out>) at 
mu-cmd-find.c:633
633             for (myfields = fields, nonempty = 0; *myfields; ++myfields) {
(gdb) bt
#0  0x0000000000418c4c in output_plain_fields (color=<optimized out>, 
fields=<optimized out>, msg=<optimized out>, threads=<optimized out>) at 
mu-cmd-find.c:633
#1  output_plain (err=0x7fffffffe558, include_unreadable=0, color=1, threads=0, 
summary=0, fields=0x429836 "d f s", iter=0x688430) at mu-cmd-find.c:685
#2  output_query_results (err=0x7fffffffe558, opts=<optimized out>, 
iter=0x688430) at mu-cmd-find.c:102
#3  process_query (query=<optimized out>, err=0x7fffffffe558, opts=<optimized 
out>, xapian=0x66b990) at mu-cmd-find.c:147
#4  execute_find (err=0x7fffffffe558, opts=<optimized out>, store=<optimized 
out>) at mu-cmd-find.c:840
#5  mu_cmd_find (store=<optimized out>, opts=<optimized out>, 
err=0x7fffffffe558) at mu-cmd-find.c:875
#6  0x0000000000409b43 in with_store (func=0x4182d0 <mu_cmd_find>, 
opts=0x643cb0, read_only=<optimized out>, err=0x7fffffffe558) at mu-cmd.c:429
#7  0x0000000000408ded in main (argc=1, argv=0x7fffffffe658) at mu.cc:74

Original comment by urban.yo...@gmail.com on 28 Feb 2012 at 9:17

GoogleCodeExporter commented 8 years ago
Ah, thanks... could you try to do the same with a non-optimized build, ie.

  ./configure CFLAGS="-O0 -ggdb3" CXXFLAGS="-O0 -ggdb3" && make clean && make

and then try again to get the backtrace? That should hopefully give some more 
information. Thanks in advance!

Original comment by digg...@gmail.com on 29 Feb 2012 at 6:21

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
#0  0x00007ffff5775c61 in __strlen_sse2 () from /lib/libc.so.6
#1  0x00007ffff575d77e in fputs () from /lib/libc.so.6
#2  0x000000000041a324 in mu_util_fputs_encoded (
    str=0x6a1120 "\345\233\236\350\246\206\357\274\232 Pictures & Videos", stream=0x7ffff5a8f120) at mu-util.c:432
#3  0x000000000041cdd0 in output_plain_fields (msg=0x6432c0, fields=0x431586 "d 
f s", color=1, threads=0)
    at mu-cmd-find.c:646
#4  0x000000000041cf04 in output_plain (iter=0x693430, fields=0x431586 "d f s", 
summary=0, threads=0, color=1, 
    include_unreadable=0, err=0x7fffffffe550) at mu-cmd-find.c:685
#5  0x000000000041bc78 in output_query_results (iter=0x693430, opts=0x64ecb0, 
err=0x7fffffffe550)
    at mu-cmd-find.c:102
#6  0x000000000041bdd0 in process_query (xapian=0x676990, query=0x692680 
"\"karen\"", opts=0x64ecb0, 
    err=0x7fffffffe550) at mu-cmd-find.c:147
#7  0x000000000041d460 in execute_find (store=0x64ee10, opts=0x64ecb0, 
err=0x7fffffffe550) at mu-cmd-find.c:840

#8  0x000000000041d5b3 in mu_cmd_find (store=0x64ee10, opts=0x64ecb0, 
err=0x7fffffffe550) at mu-cmd-find.c:875
#9  0x000000000040a66b in with_store (func=0x41d4b7 <mu_cmd_find>, 
opts=0x64ecb0, read_only=1, err=0x7fffffffe550)
    at mu-cmd.c:429
#10 0x000000000040a82f in mu_cmd_execute (opts=0x64ecb0, err=0x7fffffffe550) at 
mu-cmd.c:468
#11 0x00000000004097c9 in main (argc=1, argv=0x7fffffffe648) at mu.cc:74

Original comment by urban.yo...@gmail.com on 29 Feb 2012 at 6:37

GoogleCodeExporter commented 8 years ago
it's returning some values (emails) before segfaulting now....

Original comment by urban.yo...@gmail.com on 29 Feb 2012 at 6:38

GoogleCodeExporter commented 8 years ago
hmmm, i can't reproduce it, but i made some code changes that might help; I 
pushed it to master (https://github.com/djcb/mu).

Can you test that? Alternatively, you can replace the existing file 
src/mu-util.c with the one attached and recompile and see if it helps.

Thanks!

Original comment by digg...@gmail.com on 29 Feb 2012 at 6:59

Attachments:

GoogleCodeExporter commented 8 years ago
so make check still reports an error

TEST: test-mu-cmd... (pid=15192)
  /mu-cmd/test-mu-index:                                               OK
  /mu-cmd/test-mu-find-empty-query:                                    OK
  /mu-cmd/test-mu-find-01:                                             **
ERROR:test-mu-cmd.c:96:search: assertion failed (newlines_in_output(output) == 
expected): (0 == 1)
FAIL
GTester: last random seed: R02Sada897107d41d7855a82672c533177b8
/bin/sh: line 5: 15149 Terminated              gtester --verbose test-mu-util 
test-mu-str test-mu-maildir test-mu-msg-fields test-mu-query test-mu-contacts 
test-mu-cmd test-mu-cmd-cfind test-mu-msg test-mu-runtime test-mu-store 
test-mu-threads test-mu-date test-mu-flags
make[2]: *** [test] Error 143
make[2]: Leaving directory `/home/mo/compiled/mu/src/tests'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/home/mo/compiled/mu/src'
make: *** [test] Error 2

however when i run the command the program does not segfault anymore, and gdb 
returns no stack when i run a backtrace... and it does return the emails 
searched for.... so seems to work?

Original comment by urban.yo...@gmail.com on 29 Feb 2012 at 8:48

GoogleCodeExporter commented 8 years ago
I'm glad the crash seems to be fixed, but I wonder why the test-case does not 
pass. Can you try to run it manually, ie,

   src/tests/test-mu-cmd --verbose -k

and attach the output? Hopefully, that'll give me a clue.

Thanks!

Original comment by digg...@gmail.com on 2 Mar 2012 at 11:29

GoogleCodeExporter commented 8 years ago
sure!

[mo@(none) ~/compiled/mu/src/tests]$ ./test-mu-cmd --verbose -k
GTest: random seed: R02Scf13b79a7a275ce641392cbf7e0c5e9b
GTest: run: /mu-cmd/test-mu-index
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-df6e966c 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
GTest: result: OK
GTest: run: /mu-cmd/test-mu-find-empty-query
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-3d118b38 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-3d118b38 ""

Output:
Thu Jan  1 09:00:00 1970 Sitting Bull <sb@example.com> pics for you
Thu Jan  1 09:00:00 1970 Napoleon Bonaparte <nb@example.com> rock on dude
Sat Feb 21 03:05:33 2004 foobar <foo@example.com> Fwd: rfc822
Sat May  7 07:27:52 2005  \303\266tzi  <oetzi@web.de> Re: der b\303\244r und 
das m\303\244dchen
Fri Aug  1 03:57:25 2008 John Milton <jm@example.com> Fere libenter homines id 
quod volunt credunt
Fri Aug  1 03:57:25 2008 Socrates <soc@example.com> cool stuff
Fri Aug  1 03:57:25 2008 Geoff Tate <jeff@example.com> eyes of a stranger
Wed Mar  9 02:04:20 2011 Jimbo Foobarcuux <jimbo@slp53.sl.home> Re: Are writes 
"atomic" to readers of the file?
Mon May 23 17:53:45 2011 ArtOlive <artolive@mailinglijst.nl> NIEUWSBRIEF ART 
OLIVE | juni exposite in galerie ArtOlive
Tue Jun 14 03:57:25 2011 xyz@123.xx abc
Sun Nov 13 01:06:23 2011 "Richard P. Feynman" <rpf@example.com> atoms
Thu Nov 24 21:24:00 2011 dwarf@siblings.net Fwd: test abc
GTest: result: OK
GTest: run: /mu-cmd/test-mu-find-01
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-4c9e3fd4 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-4c9e3fd4 
f:john fruit

Output:
Fri Aug  1 03:57:25 2008 John Milton <jm@example.com> Fere libenter homines id 
quod volunt credunt
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-d29e82dc 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-d29e82dc 
f:soc@example.com

Output:
Fri Aug  1 03:57:25 2008 Socrates <soc@example.com> cool stuff
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-e23e6ef4 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-e23e6ef4 
t:alki@example.com

Output:
Fri Aug  1 03:57:25 2008 Socrates <soc@example.com> cool stuff
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-50bbd4c 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-50bbd4c 
t:alcibiades

Output:
Fri Aug  1 03:57:25 2008 Socrates <soc@example.com> cool stuff
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-9bd64008 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-9bd64008 
f:soc@example.com OR f:john

Output:
Fri Aug  1 03:57:25 2008 John Milton <jm@example.com> Fere libenter homines id 
quod volunt credunt
Fri Aug  1 03:57:25 2008 Socrates <soc@example.com> cool stuff
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-7ddf8df0 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-7ddf8df0 
f:soc@example.com OR f:john OR t:edmond

Output:
Thu Jan  1 09:00:00 1970 Napoleon Bonaparte <nb@example.com> rock on dude
Fri Aug  1 03:57:25 2008 John Milton <jm@example.com> Fere libenter homines id 
quod volunt credunt
Fri Aug  1 03:57:25 2008 Socrates <soc@example.com> cool stuff
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-1a917ed4 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-1a917ed4 
t:julius

Output:
Fri Aug  1 03:57:25 2008 John Milton <jm@example.com> Fere libenter homines id 
quod volunt credunt
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-4f8fae24 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-4f8fae24 s:dude

Output:
Thu Jan  1 09:00:00 1970 Napoleon Bonaparte <nb@example.com> rock on dude
/home/mo/compiled/mu/src/mu index --muhome=/tmp/mu-test-1000/test-dcf8fec8 
--maildir=/home/mo/compiled/mu/src/tests/testdir2/ --quiet
/home/mo/compiled/mu/src/mu find --muhome=/tmp/mu-test-1000/test-dcf8fec8 
t:dant?s

Output:
**
ERROR:test-mu-cmd.c:96:search: assertion failed (newlines_in_output(output) == 
expected): (0 == 1)
Aborted

Original comment by urban.yo...@gmail.com on 3 Mar 2012 at 4:21

GoogleCodeExporter commented 8 years ago
Thanks a lot! I suspect it's an encoding issue (ie., mu is making some 
unwarranted assumptions about that). Let me see if I can do something about 
it...

Original comment by digg...@gmail.com on 6 Mar 2012 at 7:27

GoogleCodeExporter commented 8 years ago
i've pushed some changes that hopefully make the unit tests no longer break. 
could you test it? thanks in advance!

Original comment by digg...@gmail.com on 10 Mar 2012 at 10:46

GoogleCodeExporter commented 8 years ago
all tests passed! was it an encoding issue?

Original comment by urban.yo...@gmail.com on 10 Mar 2012 at 11:25

GoogleCodeExporter commented 8 years ago
Thanks for the quick response! The problem was that the test require some 
locales to be available, otherwise the there are indeed some encoding problems. 
I've changed it now to skip those tests, if we cannot find an appropriate 
locale.

Original comment by digg...@gmail.com on 10 Mar 2012 at 12:32