<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The C++ standard does specify order w/in a file (top down), but not across files. This fact can be used to order across files by using a global from one to initialize a global another. Don't recommend it, but it is nice when it is a must.<div><br></div><div>-- DM</div><div><br><div><div>On Sep 11, 2013, at 12:56 PM, "Troy A. Griffitts" <<a href="mailto:scribe@crosswire.org">scribe@crosswire.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Jaak, I disagree that your comments have anything to do with this problem. I have confirmed that the 3 file globals immediately preceding the problem global have been initialized. I doubt you are saying the c++ standard doesn't support initializing a global array and then initializing a global std::list with the members of this array, all in the same object file. I know the spec doesn't assure global initialization order across object files, but within the same object file, I find it hard to believe there is no specification to the order.<br><br><div class="gmail_quote">Jaak Ristioja <<a href="mailto:jaak@ristioja.ee">jaak@ristioja.ee</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>It's not a compiler bug.<br><br>Basically the C++ standard does not enforce an initialization order<br>for globals. So the compiler is free to initialize such stuff in any<br>order. I think your toolchain just happens to be lucky enough to do<br>that in an the order which doesn't yield in a crash.<br><br>I don't have the time to look this up in the C++ standards myself, but<br>you can google such stuff:<br><br><a href="http://stackoverflow.com/questions/3746238/c-global-initialization-order-ignores-dependencies">http://stackoverflow.com/questions/3746238/c-global-initialization-order-ignores-dependencies</a><br><br><br>Blessings,<br>Jaak<br><br>On 10.09.2013 18:12, Troy A. Griffitts wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Hey Jaak,<br><br>Thank, yeah, but why? :)<br><br>My investigation turns up:<br><br>shared build works fine and valgrinds clean static build on g++<br>(GCC) 4.8.1 (F19) fails static build on g++ (GCC) 4.4.7 (RHEL 6.4)<br>works fine and valgrinds clean<br><br>In the error case, it seems that std::list's c-tor(iterator start, <br>iterator end) doesn't get called appropriately, though all the<br>other file globals get initialized just fine.<br><br>I moved the global filter in the utility to a stack variable and<br>it alleviates the problem, but still wonder why the problem in the<br>first place.<br><br>Any advice would be appreciated. If I'm doing something wrong, I'd<br>like to change it, but right now I'm going with "compiler bug" :)<br><br>Troy<br><br><br><br><br><br>On 09/10/2013 08:20 AM, Jaak Ristioja wrote: I'm pretty sure that<br>the crash is because the global<br><br>const StringList oValues(&choices[0], &choices[2]);<br><br>in ../src/modules/filters/utf8greekaccents.cpp:41 is not<br>initialized when it is used in UTF8GreekAccents::UTF8GreekAccents()<br>to initialize the global<br><br>UTF8GreekAccents greekAccentsFilter;<br><br>instance in imp2gbs.cpp:62.<br><br><br>Blessings, Jaak<br><br>On 10.09.2013 02:02, Peter von Kaehne wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">I hate to bring this up, now, when we really all want 1.7<br>out, but current svn head produces a segmentation fault in<br>imp2gbs. The other utilities insofar as I tested them seem to<br>be fine.<br><br>Below the stacktrace. Tell me if you need more. I basically<br>use <a href="http://usrinst.sh/">usrinst.sh</a> produced binaries, with the only modification<br>that I changed the install directory to /usr/local/bin<br><br><br><br>peter@peter-ThinkPad-Twist:~/Source/sword$ gdb <br>/usr/local/bin/imp2gbs GNU gdb (GDB) 7.5-ubuntu Copyright (C)<br>2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL<br>version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>> This is<br>free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law. Type<br>"show copying" and "show warranty" for details. This GDB was<br>configured as "i686-linux-gnu". For bug reporting<br>instructions, please see: <br><<a href="http://www.gnu.org/software/gdb/bugs">http://www.gnu.org/software/gdb/bugs</a>/>... Reading symbols<br>from /usr/local/bin/imp2gbs...done. (gdb) r Starting<br>program: /usr/local/bin/imp2gbs<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0x08050b7a in sword::SWBuf::c_str (this=0x8) at<br>../include/swbuf.h:141 141 inline const char *c_str() const{<br>return buf; } (gdb) bt #0 0x08050b7a in sword::SWBuf::c_str<br>(this=0x8) at ../include/swbuf.h:141 #1 0x0805a790 in <br>sword::SWOptionFilter::setOptionValue (this=0x8115b60 <br><greekAccentsFilter>, ival=0x80c715b "On") at <br>../src/modules/filters/swoptfilter.cpp:51 #2 0x0805aca2 in <br>sword::UTF8GreekAccents::UTF8GreekAccents (this=0x8115b60 <br><greekAccentsFilter>, __in_chrg=<optimised out>, <br>__vtt_parm=<optimised out>) at <br>../src/modules/filters/utf8greekaccents.cpp:43 #3 0x0805099d<br>in __static_initialization_and_destruction_0<br>(__initialize_p=1, __priority=65535) at imp2gbs.cpp:62 #4<br>0x080509df in _GLOBAL__sub_I_imp2gbs.cpp(void) () at<br>imp2gbs.cpp:273 #5 0x080c6ae2 in __libc_csu_init () #6<br>0xb77f046a in __libc_start_main () from<br>/lib/i386-linux-gnu/<a href="http://libc.so/">libc.so</a>.6 #7 0x0804f931 in _start ()<br>(gdb) #0 0x08050b7a in sword::SWBuf::c_str (this=0x8) at<br>../include/swbuf.h:141 #1 0x0805a790 in <br>sword::SWOptionFilter::setOptionValue (this=0x8115b60 <br><greekAccentsFilter>, ival=0x80c715b "On") at <br>../src/modules/filters/swoptfilter.cpp:51 #2 0x0805aca2 in <br>sword::UTF8GreekAccents::UTF8GreekAccents (this=0x8115b60 <br><greekAccentsFilter>, __in_chrg=<optimised out>, <br>__vtt_parm=<optimised out>) at <br>../src/modules/filters/utf8greekaccents.cpp:43 #3 0x0805099d<br>in __static_initialization_and_destruction_0<br>(__initialize_p=1, __priority=65535) at imp2gbs.cpp:62 #4<br>0x080509df in _GLOBAL__sub_I_imp2gbs.cpp(void) () at<br>imp2gbs.cpp:273 #5 0x080c6ae2 in __libc_csu_init () #6<br>0xb77f046a in __libc_start_main () from<br>/lib/i386-linux-gnu/<a href="http://libc.so/">libc.so</a>.6 #7 0x0804f931 in _start ()<br>(gdb) #0 0x08050b7a in sword::SWBuf::c_str (this=0x8) at<br>../include/swbuf.h:141 #1 0x0805a790 in <br>sword::SWOptionFilter::setOptionValue (this=0x8115b60 <br><greekAccentsFilter>, ival=0x80c715b "On") at <br>../src/modules/filters/swoptfilter.cpp:51 #2 0x0805aca2 in <br>sword::UTF8GreekAccents::UTF8GreekAccents (this=0x8115b60 <br><greekAccentsFilter>, __in_chrg=<optimised out>, <br>__vtt_parm=<optimised out>) at <br>../src/modules/filters/utf8greekaccents.cpp:43 #3 0x0805099d<br>in __static_initialization_and_destruction_0<br>(__initialize_p=1, __priority=65535) at imp2gbs.cpp:62 #4<br>0x080509df in _GLOBAL__sub_I_imp2gbs.cpp(void) () at<br>imp2gbs.cpp:273 #5 0x080c6ae2 in __libc_csu_init () #6<br>0xb77f046a in __libc_start_main () from<br>/lib/i386-linux-gnu/<a href="http://libc.so/">libc.so</a>.6 #7 0x0804f931 in _start ()<br>(gdb)<br><br><br><br><hr>sword-devel<br>mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a> <br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above<br>page</blockquote><br><br></blockquote><hr>sword-devel<br>mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a> <br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a> <br>Instructions to unsubscribe/change your settings at above page</blockquote><br><br><hr>sword-devel mailing<br>list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a> <br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a> Instructions<br>to unsubscribe/change your settings at above page</blockquote><br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v2.0.20 (GNU/Linux)<br><br>iQgcBAEBAgAGBQJSMHp7AAoJEEqsYmEt1rCOblpAAIfO/ypou3k0iGOmyo6xOay1<br>zGDLP0d8zgGJ4qIT48nsFTEgrSdLukeIhl1QO4hhCevw4IY/r7+pH1gQYlqrhquP<br>9esPk3SwUWn6oKVHD/7FTbDhap1EFtbsqyu273xV/08m9j/UROOSQAlWYPYmcsn1<br>5WLocCLrQO+RPNV0x2WuHkNXjm9R9ktqGrBDIQuCPArZehY6SVU5nsf+KdFMaNek<br>b1Esu+K8Qnyua77SI79K9Aj0s4HsSewrOYCe3TdiBqOKY9lJyHSdAuF3GiEIN2XZ<br>r/vegWmPRSuOXhLqFGXg5WDuGZcPCeeOCZy7AUmUCpDFRjtkcv+wH38vM9GLfdWb<br>TRlkiIoOIf7zA/IVwTNHqixQp4fmdyHftH3X9+9QKwvNFuVIG8VFhooIrfGIA7/q<br>YW1efT1FX6FImtJ+CPMLWvvAfQYKlV9NTQ4OBUR10QmCw32kvdvRipr/QevtCkxI<br>BIrVTjWjfnOi0coxbB9TTEWJqqG6zpIZGU08uHoVrH84kzf+7OQGoy52dITz72WR<br>wWwIOTuYWMXLOukym+4rviPRDnkFdG+7EeldN7+qQhm7/W8/aWy7vq8ucEjEwKCu<br>i+1ASmwlpSU2w1JH18DMcH13oXgClIN5IUuccsxim+BxLQHi+Z63A8p6JCxm96nH<br>h34/ZLVdb4MLpTY0gvXeIWB+a1e+lEoHQCc/6ukofnKNG2+BXICwwYvb6/FtxRKn<br>BqLnI58gmuzQwBemgsi+9naAOQSBsLHBtew7zrVAXe6aESkvC9tH8q+XefxWo/4H<br>c7FkqX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9RyJAkmwrR7Ktq67B0jWiC7qthL8LVG2vP9sMzPl8jSS/<br>vDGUef6M60Z1hzFxS/uDERBpJAZkSjwnv7f9+o85xAYPLTG7o7txFTVV0gZpAJX0<br>6qVic+7M3+gLrqoYFTt1o1LuGQ0WnbRUzI6fm5/BEKu6VVSkZKX6nZ2s5UW8OZet<br>xN3kiWDsBSQlGkumrlvrdkoSJN6QtaMszXvMyRZn/XvjSTCG/MrRHH7BrMNhH4Hf<br>RmJ5ot7HBAlkbiSVpEx3S7+Ne0neBxoX6YrQm1USYtfZrBgMfxrzCEdN4dyRRZP2<br>eSEnxVfaxg5HYwYUMtwhDtGo6cThEoHIM6TXgbCuvejdhFtEjv1xOu8IBJ/SDaxH<br>f5m6xUsmVNswO3CiMbmLxLaMiUwMD8h3TC1ojO7huZqRvWH/jxzDWGH2Uj9yMCXI<br>OHh3DLi31iJRSnjRsPRmqlvqEqwHy4xeMSBAnEbWVM/AhbppMArYmH4TXlFOrff4<br>mUndN2XIh+W9zntL4LMHgWudWPWHBeMHojyHjX4HA0mC+Aljkzc/J+UcEipya9RV<br>saOJrh3Inzmb4EIxcqMGkWDcrUQpZS71LMM7Wx0LJfolDOh6EhdIg37dtxgw8+St<br>GhuGtHv0gRl+d/HS2tnwCej8rgO/8KA7Y8g9XYVA8iPmJH8qvImisioTOQsJm9mX<br>3qFzLbZrP/bPRpckGwACbwuYs1xBCyu7i2Fl/9ec3xX7lEvZkoT9vG0Vv4vMSgwW<br>ThhOFc4y5KKUfKdik8u25j72+Bv4Rp/NuqqeC/P11JfEVzWn30x8gSrFiqcORlQ6<br>waGNah30EatCy2ZZOUEqfH2MCb70AsIZSfmPjsRrtmB4MNuLcZaDOuXiey2XS3b/<br>swjcbbC0bQSas+7uOfqc<br>=I09B<br>-----END PGP SIGNATURE-----<br><br><hr><br>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page<br></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</div>_______________________________________________<br>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page</blockquote></div><br></div></body></html>