[sword-devel] Segmentation fault - was Re: SWORD 1.7.0RC3

Troy A. Griffitts scribe at crosswire.org
Tue Sep 10 08:12:39 MST 2013


Hey Jaak,

Thank, yeah, but why?  :)

My investigation turns up:

shared build works fine and valgrinds clean
static build on g++ (GCC) 4.8.1 (F19) fails
static build on g++ (GCC) 4.4.7 (RHEL 6.4) works fine and valgrinds clean

In the error case, it seems that std::list's c-tor(iterator start, 
iterator end) doesn't get called appropriately, though all the other 
file globals get initialized just fine.

I moved the global filter in the utility to a stack variable and it 
alleviates the problem, but still wonder why the problem in the first place.

Any advice would be appreciated.  If I'm doing something wrong, I'd like 
to change it, but right now I'm going with "compiler bug" :)

Troy





On 09/10/2013 08:20 AM, Jaak Ristioja wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm pretty sure that the crash is because the global
>
>    const StringList oValues(&choices[0], &choices[2]);
>
> in ../src/modules/filters/utf8greekaccents.cpp:41 is not initialized
> when it is used in UTF8GreekAccents::UTF8GreekAccents() to initialize
> the global
>
>    UTF8GreekAccents greekAccentsFilter;
>
> instance in imp2gbs.cpp:62.
>
>
> Blessings,
> Jaak
>
> On 10.09.2013 02:02, Peter von Kaehne wrote:
>> I hate to bring this up, now, when we really all want 1.7 out, but
>> current svn head produces a segmentation fault in imp2gbs. The
>> other utilities insofar as I tested them seem to be fine.
>>
>> Below the stacktrace. Tell me if you need more. I basically use
>> usrinst.sh produced binaries, with the only modification that I
>> changed the install directory to /usr/local/bin
>>
>>
>>
>> peter at peter-ThinkPad-Twist:~/Source/sword$ gdb
>> /usr/local/bin/imp2gbs GNU gdb (GDB) 7.5-ubuntu Copyright (C) 2012
>> Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or
>> later <http://gnu.org/licenses/gpl.html> This is free software: you
>> are free to change and redistribute it. There is NO WARRANTY, to
>> the extent permitted by law.  Type "show copying" and "show
>> warranty" for details. This GDB was configured as
>> "i686-linux-gnu". For bug reporting instructions, please see:
>> <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from
>> /usr/local/bin/imp2gbs...done. (gdb) r Starting program:
>> /usr/local/bin/imp2gbs
>>
>> Program received signal SIGSEGV, Segmentation fault. 0x08050b7a in
>> sword::SWBuf::c_str (this=0x8) at ../include/swbuf.h:141 141
>> inline const char *c_str() const{ return buf; } (gdb) bt #0
>> 0x08050b7a in sword::SWBuf::c_str (this=0x8) at
>> ../include/swbuf.h:141 #1  0x0805a790 in
>> sword::SWOptionFilter::setOptionValue (this=0x8115b60
>> <greekAccentsFilter>, ival=0x80c715b "On") at
>> ../src/modules/filters/swoptfilter.cpp:51 #2  0x0805aca2 in
>> sword::UTF8GreekAccents::UTF8GreekAccents (this=0x8115b60
>> <greekAccentsFilter>, __in_chrg=<optimised out>,
>> __vtt_parm=<optimised out>) at
>> ../src/modules/filters/utf8greekaccents.cpp:43 #3  0x0805099d in
>> __static_initialization_and_destruction_0 (__initialize_p=1,
>> __priority=65535) at imp2gbs.cpp:62 #4  0x080509df in
>> _GLOBAL__sub_I_imp2gbs.cpp(void) () at imp2gbs.cpp:273 #5
>> 0x080c6ae2 in __libc_csu_init () #6  0xb77f046a in
>> __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 #7
>> 0x0804f931 in _start () (gdb) #0  0x08050b7a in sword::SWBuf::c_str
>> (this=0x8) at ../include/swbuf.h:141 #1  0x0805a790 in
>> sword::SWOptionFilter::setOptionValue (this=0x8115b60
>> <greekAccentsFilter>, ival=0x80c715b "On") at
>> ../src/modules/filters/swoptfilter.cpp:51 #2  0x0805aca2 in
>> sword::UTF8GreekAccents::UTF8GreekAccents (this=0x8115b60
>> <greekAccentsFilter>, __in_chrg=<optimised out>,
>> __vtt_parm=<optimised out>) at
>> ../src/modules/filters/utf8greekaccents.cpp:43 #3  0x0805099d in
>> __static_initialization_and_destruction_0 (__initialize_p=1,
>> __priority=65535) at imp2gbs.cpp:62 #4  0x080509df in
>> _GLOBAL__sub_I_imp2gbs.cpp(void) () at imp2gbs.cpp:273 #5
>> 0x080c6ae2 in __libc_csu_init () #6  0xb77f046a in
>> __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 #7
>> 0x0804f931 in _start () (gdb) #0  0x08050b7a in sword::SWBuf::c_str
>> (this=0x8) at ../include/swbuf.h:141 #1  0x0805a790 in
>> sword::SWOptionFilter::setOptionValue (this=0x8115b60
>> <greekAccentsFilter>, ival=0x80c715b "On") at
>> ../src/modules/filters/swoptfilter.cpp:51 #2  0x0805aca2 in
>> sword::UTF8GreekAccents::UTF8GreekAccents (this=0x8115b60
>> <greekAccentsFilter>, __in_chrg=<optimised out>,
>> __vtt_parm=<optimised out>) at
>> ../src/modules/filters/utf8greekaccents.cpp:43 #3  0x0805099d in
>> __static_initialization_and_destruction_0 (__initialize_p=1,
>> __priority=65535) at imp2gbs.cpp:62 #4  0x080509df in
>> _GLOBAL__sub_I_imp2gbs.cpp(void) () at imp2gbs.cpp:273 #5
>> 0x080c6ae2 in __libc_csu_init () #6  0xb77f046a in
>> __libc_start_main () from /lib/i386-linux-gnu/libc.so.6 #7
>> 0x0804f931 in _start () (gdb)
>>
>>
>>
>> _______________________________________________ sword-devel mailing
>> list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel Instructions
>> to unsubscribe/change your settings at above page
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.20 (GNU/Linux)
>
> iQgcBAEBAgAGBQJSLropAAoJEEqsYmEt1rCOpU8//1jFkuQjkIxQyYDpGNL5G6Z/
> jlwckJTOStKGPl3ZmT36Zt5AUeNGOivVc5ZKbmBGIHCQolIXgEgiZbgcg1oxDcW1
> gsS2IYiLSCco1anNQrtSXGdd6rkiC7atdwBLYfsDbEFBYy/t6tyUryVjCrbzgfdm
> HROgdOhcG6fb33zwCATbl0u7IpG7J0UgZzxB2gQSTY6J0yI1Qk8gGfOb0rDxUDMv
> nS6UY7Dk1ld0lQ/oS9D9/U1fh9pT1xobAvdb8BCTMt3xFGH8pfq1O6R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KbftyvtV5BG+Liog9/F9aUxIP8Wu
> G0NwLW7++Pb8GkTOerd/y/oNTs9T/DqcwBRWnxbOKWxd1oCfIU6QGECpNOuuBe1c
> X5Y1qhzKYKQyVXaII3pZ/C18s2Bd/xpNVRKh/kd1x7gM5QZYwsT/8c/5x39nU+Rm
> ld8/P1V1xYhO86zIublXqBRxD5GrQDfs8p5OG1CmN7Q2MXm3YZzX67yhkqVLIIjV
> AoMa8qSfIL2LI7rb9By6U42s6FnkJGydFRf2Jshxf9uQ0RcmNNtg3J3VSgBMrwIs
> 4CUnknPgicQQuJEluRys4ZWjEhJ8h+T2pPxOHBl75fzsZA017+UX2PBtbzFDQF19
> blilkx0dYcOWHfocTxwW
> =aFlX
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list