|
|
便利なツール Emacs らくらく 入門 |
|
Namazu for hns による簡易全文検索 詳しくは 詳細指定/ヘルプを参照して下さい |
|||||||||||||||||||||||||||||||||||||||||||||
2013年09月07日(土) 旧暦 [n年日記] [更新:"2013/09/08 09:55:17"]#1 [emacs]
08/16 の日記
とは、また違うところから getenv を呼出していて落ちる
livorno@makoto 08:17:48/130908(..editors/emacs24)% gdb work/emacs-24.3/src/emacs GNU gdb (GDB) 7.3.1 Copyright (C) 2011 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 "x86_64--netbsd". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /export/CHROOT/usr/pkgsrc/editors/emacs24/work/emacs-24.3/src/emacs... (no debugging symbols found)...done. (gdb) run /export/CHROOT/usr/pkgsrc/doc/guide/files/options.xml Starting program: /export/CHROOT/usr/pkgsrc/editors/emacs24/work/emacs-24.3/src/emacs /export/CHROOT/usr/pkgsrc/doc/guide/files/options.xml Program received signal SIGSEGV, Segmentation fault. [Switching to LWP 1] 0x00007f7febcfc134 in strncmp () from /usr/lib/libc.so.12 (gdb) bt #0 0x00007f7febcfc134 in strncmp () from /usr/lib/libc.so.12 #1 0x00007f7febcb311e in __getenvslot () from /usr/lib/libc.so.12 #2 0x00007f7febcb3272 in __findenvvar () from /usr/lib/libc.so.12 #3 0x00007f7febcb2d10 in getenv () from /usr/lib/libc.so.12 #4 0x00007f7ff2852c5e in _XkbGetCharset () from /usr/X11R7/lib/libX11.so.7 #5 0x00007f7ff285ca26 in XkbTranslateKeySym () from /usr/X11R7/lib/libX11.so.7 #6 0x00007f7ff285cc7e in XLookupString () from /usr/X11R7/lib/libX11.so.7 #7 0x00007f7fe6417fc5 in _XimLocalFilter () from /usr/X11R7/lib/X11/locale/lib/common/ximcp.so.2 #8 0x00000000004af224 in event_handler_gdk () #9 0x00007f7ff545d558 in ?? () from /usr/pkg/lib/libgdk-x11-2.0.so.0 #10 0x00007f7ff545f0ad in ?? () from /usr/pkg/lib/libgdk-x11-2.0.so.0 #11 0x00007f7ff5460433 in ?? () from /usr/pkg/lib/libgdk-x11-2.0.so.0 #12 0x00007f7ff0050c90 in g_main_context_dispatch () from /usr/pkg/lib/libglib-2.0.so.0 #13 0x00007f7ff0051030 in g_main_context_iterate () from /usr/pkg/lib/libglib-2.0.so.0 #14 0x00007f7ff00510c4 in g_main_context_iteration () from /usr/pkg/lib/libglib-2.0.so.0 #15 0x00007f7ff5946678 in gtk_main_iteration () from /usr/pkg/lib/libgtk-x11-2.0.so.0 #16 0x00000000004a7f84 in XTread_socket () #17 0x00000000004d7de2 in gobble_input () #18 0x00000000004d740d in process_pending_signals () #19 0x00000000005245b1 in Fmake_list () #20 0x0000000000545137 in concat () #21 0x000000000054598c in Fcopy_sequence () #22 0x00000000004d5fb0 in timer_check () #23 0x00000000004d65da in readable_events () #24 0x00000000004d7ed4 in get_input_pending () #25 0x00000000004da1db in detect_input_pending_run_timers () #26 0x0000000000576755 in wait_reading_process_output () #27 0x000000000041c5f1 in sit_for () #28 0x00000000004db2ac in read_char () #29 0x00000000004dccea in read_key_sequence.clone.16 () #30 0x00000000004deb57 in command_loop_1 () #31 0x000000000053b3ef in internal_condition_case () #32 0x00000000004d3949 in command_loop_2 () #33 0x000000000053b2be in internal_catch () #34 0x00000000004d46cc in recursive_edit_1 () #35 0x00000000004d4990 in Frecursive_edit () #36 0x00000000004d034f in main () (gdb) quitstrncmp is written in assembly language: (gdb) x/16i 0x00007f7febcfc120 0x7f7febcfc120 <strncmp>: test %rdx,%rdx 0x7f7febcfc123 <strncmp+3>: jmp 0x7f7febcfc12e <strncmp+14> 0x7f7febcfc125 <strncmp+5>: inc %rdi 0x7f7febcfc128 <strncmp+8>: inc %rsi 0x7f7febcfc12b <strncmp+11>: dec %rdx 0x7f7febcfc12e <strncmp+14>: je 0x7f7febcfc1f6 <strncmp+214> 0x7f7febcfc134 <strncmp+20>: mov (%rdi),%al 0x7f7febcfc136 <strncmp+22>: test %al,%al 0x7f7febcfc138 <strncmp+24>: je 0x7f7febcfc1ed <strncmp+205> 0x7f7febcfc13e <strncmp+30>: cmp %al,(%rsi) 0x7f7febcfc140 <strncmp+32>: jne 0x7f7febcfc1ed <strncmp+205> 0x7f7febcfc146 <strncmp+38>: inc %rdi 0x7f7febcfc149 <strncmp+41>: inc %rsi 0x7f7febcfc14c <strncmp+44>: dec %rdx 0x7f7febcfc14f <strncmp+47>: je 0x7f7febcfc1f6 <strncmp+214> 0x7f7febcfc155 <strncmp+53>: mov (%rdi),%al (gdb)modena@makoto 09:45:51/130908(..lib/libc)% view arch/x86_64/string/strncmp.S 1 /* 2 * Written by J.T. Conklin <jtc@NetBSD.org>. 3 * Public domain. 4 */ 5 6 #include <machine/asm.h> 7 8 #if defined(LIBC_SCCS) 9 RCSID("$NetBSD: strncmp.S,v 1.3 2005/08/03 22:59:50 rpaulo Exp $") 10 #endif 11 12 /* 13 * NOTE: I've unrolled the loop eight times: large enough to make a 14 * significant difference, and small enough not to totally trash the 15 * cache. 16 */ 17 18 ENTRY(strncmp) 19 testq %rdx,%rdx 20 jmp L2 /* Jump into the loop! */ 21 22 L1: incq %rdi 23 incq %rsi 24 decq %rdx 25 L2: jz L4 /* strings are equal */ 26 movb (%rdi),%al 27 testb %al,%al 28 jz L3 29 cmpb %al,(%rsi)modena@makoto 09:49:52/130908(..lib/libc)% view ./stdlib/_env.c 254 __getenvslot(const char *name, size_t l_name, bool allocate) 255 { 256 size_t new_size, num_entries, required_size; 257 char **new_environ; 258 259 /* Does the environ need scrubbing? */ 260 if (environ != allocated_environ && allocated_environ != NULL) 261 __scrubenv(); 262 263 /* Search for an existing environment variable of the given name. */ 264 num_entries = 0; 265 while (environ[num_entries] != NULL) { 266 if (strncmp(environ[num_entries], name, l_name) == 0 && 267 environ[num_entries][l_name] == '=') { 268 /* We found a match. */ 269 return num_entries; 270 } 271 num_entries ++; 272 } %rdi environ[num_entries] %rsi name %rdx: l_name (size_t len)In the line 26 of strncmp.S, fetch from address 'name', but its address is incorrect. ( つっこみ )
2010年09月07日(火) 旧暦 [n年日記] [更新:"2010/09/09 13:23:12"]#1 [comp] 同じプログラムが 32bit/64bit OS で動作が違う
自分がかかわっている、C で書かれた、大きなプログラムがあって、
NetBSD/amd64 で動くのに NetBSD/i386 で動かない(らしい)。
本来 long int と書く必要があるところを int と書いているのかなぁ。 でも 64bit が必要な変数やデータ構造なんてないはずだけれど。 動かないと書いているけれど、殆ど動く。ある動作だけ変なのです。 また「らしい」と書いたけれど、全て自分の手元の話。どうもそうらしい、 という意味。問題の再現方法は分っています。 「gcc の warning を良く見る」というのもあるかな。 unsigned int と書くべきところを int としていると、そういう問題が起きることがある ? はい、何か分ったら、ここか、ここから分るところに書きます (9/20 日頃までには解決する必要があるのです)。 実は、多分つまらない理由だった気がします。for 文の終了条件が不充分で、 暴走していたのですが、 64bit だと、偶然止ってくれたというような ことかと思います。 --- src/bfd/reloc.c 23 Feb 2010 06:53:43 -0000 1.23 +++ src/bfd/reloc.c 8 Sep 2010 03:09:51 -0000 @@ -5201,10 +5201,11 @@ (unsigned int) reloc_count ); #endif + int count = reloc_count; if (reloc_count > 0) { arelent **parent; - for (parent = reloc_vector; *parent != NULL; parent++) + for (parent = reloc_vector; *parent != NULL && count-- > 1 ; parent++) { char *error_message = NULL; bfd_reloc_status_type r =でも実は cygwin (gcc-3.4.4) ではまだ動いていなくて gcc を 4 にすれば 良いのかなと思っています。(最新の cygwin でも 3.4.4.999 ?) gcc4 という選択肢があったけれど、それを見る前に自分で gcc-4.2.1 を ./configure だけで make。しかし動作がおかしいのは変らない。 ( Read More... (4) | つっこみ )
Comments related this article
2007年09月07日(金) 旧暦 [n年日記] [更新:"2007/09/07 12:54:02"]#2 [Emacs] outline-regexp を切替えるには ?
*.c を編集する時には、いつもは次の
outline-regexp
を使っている
;; (setq outline-regexp "[_A-Za-z]+\\(.*\\)\\|/\\* \\$Header") ; normalしかし時には次のようにしたい。これは実際には一行。 ;; (setq outline-regexp "[_A-Za-z]+\\(.*\\)\\| /\\* \\$Header\\| [ \t]*\\(for\\|else if\\|else\\|if\\|while\\)")これをうまく切替えるには ? しかし ( ) の使い方は perl と elisp で逆だし、しばらく考えないと分らない、 あるいは実は、考えても分らない。
( つっこみ )
#1 [pkgsrc] doxygen を使う
ttyp1:makoto@catania 12:09:19/070907(...nn/gas)> diff Doxyfile.orig Doxyfile | grep '>' > EXTRACT_ALL = YES > EXTRACT_PRIVATE = YES > EXTRACT_STATIC = YES > EXTRACT_LOCAL_METHODS = YES > INPUT = src/ld src/bfd work/ld work/bfd > EXCLUDE_PATTERNS = "*/testsuite/*" > SOURCE_BROWSER = YES > HAVE_DOT = YES > CALL_GRAPH = YES > CALLER_GRAPH = YESこれは binutils の中の ld を見たい時。bfd や work の下も参照するように するのが良い。(しかし多分 work の方は、この場合には、意味がないかも知れない) これで 2.1GHz Athlon X2 (BE 2350) で Generating page index... 2425.283u 453.954s 55:32.44 86.4% 0+0k 326+258395io 1pf+0w ttyp1:makoto@catania 12:04:59/070907(...nn/gas)> ls -l Doxyfile*55 分くらいかかる。できた html は約 340MB ( つっこみ )
2005年09月07日(水) 旧暦 [n年日記] [更新:"2007/09/05 11:30:44"]#1 [NetBSD][3.99.8] kernel を 作って見た。50 分 ?ld -N -Ttext 100000 -e __start -S -o netbsd ${SYSTEM_OBJ} vers.o text data bss dec hex filename 4533144 81684 199048 4813876 497434 netbsd 2185.712u 384.916s 54:31.03 78.5% 0+0k 15+3007io 1pf+0w ttyZ0:makoto@s900 13:40:06/050907(...compile/ZS-L2-1M-PB2-SHM)> @ bytebench:
FINAL SCORE 45.1
G4/350 のはず NetBSD s900 3.99.8 NetBSD 3.99.8 (ZS-L2-1M-PB2-SHM) #0: Wed Sep 7 13:39:56 JST 2005 makoto@s900:/export/syssrc/sys/arch/macppc/compile/ZS-L2-1M-PB2-SHM macppc
( つっこみ )
2004年09月07日(火) 旧暦 [n年日記]更新: "2004/09/09 23:51:43"#1 [Emacs] Wanderlust
最近の版は添付書類の名前に漢字が使われていても、
そのまま Samba 側で読める名前で保存してくれる。
それとは関係ないが、更新:
121 7:59 cvs update -dP -C. で始まる名前でなくても、.ignore のようなものを置いておけば無視されるは ずだが、名前に確信がないので... 藤島さんより: .nosearch のことですね。いつもありがとうございます。 ( つっこみ )
2002年09月07日(土) 旧暦 [n年日記]#1 [無題] 秋葉原・新橋11:31 千葉 12:45 荻窪 14:40 秋葉原着 15:45 新橋 ... 21:03 新橋 21:57 本千葉ATA 66/100 用 IDE 線を買って来る (400 円) (だけ) ( つっこみ )
2001年09月07日(金) 旧暦 [n年日記]#6 lookup-1.3
長い間見当らなかった「広辞苑」(第四版・電子ブック版)が
見つかったので
eb-3.1, ndtp-3.02
lookup-1.3
を入れて見た。
作った人が日本人だと日本語の説明がしっくり読めてうれしい (ndtpd) しっくり (1)物事や人心がよく合うさま。折合いのよいさま。「夫婦の仲が―行かない」って、こういう時に使う言葉ではなさそう。 M-x lookup-pattern RET 単語 RET で探す。 ( つっこみ )
#5 [Emacs] 僕が Mew を使わなくなった訳
( つっこみ )
#4 [Emacs] Mew-2.0 に対応した prom-mew 持っていませんか(NO)
と聞かれたが、残念ながら Wanderlust に移ってしまって、有りません
と答えたのは(事実とは言え)、ちょっと申訳けなかった。
( つっこみ )
#3 [URL] テキストサイト管理人に 100 の質問
長い。
画面の中に、一つも
接続(link)
のないのは(どちらにしても)最低。
( つっこみ )
#2 [hns] 日記の URL を旬でなく日付指定にしたい
どうもです。
~/diary/namazu2/etc/mknmzrc -rw-r--r-- 1 makoto wheel 5457 Sep 15 2000 mknmzrcこれって新しくなっていなかった。(何故 ?) namazu_for_hns-2.0-pl4 を開けて、比べて、変更した。 # you can customize link to your diary #$hnf::link_templ = '?%year%month%abc#%year%month%day0'; # hns-2.x $hnf::link_templ = '?%year%month%day'; #$hnf::link_templ = '?%year%month%hiday#%year%month%day0'; # hns-1.x #$hnf::link_templ = '%year%month.html#%year%month%day0'; # static ( つっこみ )
#1 [Namazu] libintl
NetBSD-current でも、
@ 私家版日本語変更に抜け:makoto@u ■8:42:29/010907(~)> zcat 2.0.6-more-japanese-20010810.gz | grep ^\+\+ +++ namazu-2.0.6/po/ja.po Fri Aug 10 16:28:26 2001 +++ namazu-2.0.6/template/NMZ.foot.ja Fri Aug 10 16:14:01 2001 +++ namazu-2.0.6/template/NMZ.head.ja Fri Aug 10 16:14:02 2001 +++ namazu-2.0.6/template/NMZ.result.normal.ja Fri Aug 10 16:14:02 2001 +++ namazu-2.0.6/template/NMZ.result.short.ja Fri Aug 10 16:14:02 2001 +++ namazu-2.0.6/template/NMZ.tips.ja Fri Aug 10 16:33:03 2001 makoto@u ■8:42:48/010907(~)> less /home/ftp/pub/namazu/ 2.0.7-more-japanese-20010904.gz | grep ^\+\+ +++ namazu-2.0.7/po/ja.po Tue Sep 4 17:27:28 2001要修正 これは直したつもり。 2.0.7-more-japanese-20010907.gz @ cvs に入れて見た。便利:@ (VPATH) {nmz,src}/Makefile.am の変更の他に tests も要変更。:mknmz-11,12 namazu-7,9,11 ja-namazu-cgi-1がまだ通っていない。 ( つっこみ )
2000年09月07日(木) 旧暦 [n年日記]#2 [Namazu] 2000-09-06 libintl.h missing etc○ configure にかかった時間 creating config.h 16.350u 96.574s 2:24.62 78.0% 0+0k 567+2992io 238pf+0w makoto@scgj■ 15:32:23/000907(...making/namazu-2000-09-06)> ○ time make すると libintl.h がないと言う time make In file included from alias.c:44: i18n.h:8: libintl.h: No such file or directory *** Error code 1 ○ gettext のものが /usr/local/include/libintl.h にあったので、 ( cd nmz; ln -s /usr/local/include/libintl.h . ) とする ○ gettext 関係の名前が解決出来ないと言うので mkdir .libs gcc -g -O2 -Wall -pedantic -o .libs/namazu form.o namazu.o output.o rcfile.o result.o usage.o namazu-cmd.o ../nmz/.libs/libnmz.so -lm ../lib/libnmzut.a -lm -Wl,--rpath -Wl,/usr/local/lib ../nmz/.libs/libnmz.so: warning: reference to compatibility setlocale(); include <locale.h> for correct reference output.o: In function `print_page_index': /E/making/namazu-2000-09-06/src/output.c:493: undefined reference to `gettext' output.o: In function `print_current_range': /E/making/namazu-2000-09-06/src/output.c:538: undefined reference to `gettext' output.o: In function `print_hitnum_all_idx': /E/making/namazu-2000-09-06/src/output.c:586: undefined reference to `gettext' output.o: In function `print_hitnum': /E/making/namazu-2000-09-06/src/output.c:596: undefined reference to `gettext' /E/making/namazu-2000-09-06/src/output.c:603: undefined reference to `gettext' output.o:/E/making/namazu-2000-09-06/src/output.c:662: more undefined references to `gettext' follow collect2: ld returned 1 exit status *** Error code 1 ○次のように src に行って makoto@scgj■ 15:54:34/000907(...namazu-2000-09-06/src)> gcc -g -O2 -Wall -pedantic -o .libs/namazu form.o namazu.o output.o rcfile.o result.o usage.o namazu-cmd.o ../nmz/.libs/libnmz.so -lm ../lib/libnmzut.a -lm -L/usr/local/lib -lintl -Wl,--rpath -Wl,/usr/local/lib ../nmz/.libs/libnmz.so: warning: reference to compatibility setlocale(); include <locale.h> for correct reference makoto@scgj■ 15:54:48/000907(...namazu-2000-09-06/src)> ○実行して見ると makoto@scgj■ 15:59:12/000907(...making/namazu-2000-09-06)> ~makoto/public_html/diary/namazu.cgi Cannot open "../nmz/.libs/libnmz.so" ○ src/Make file を 少し変更して 作り直し。 makoto@scgj■ 16:05:54/000907(...namazu-2000-09-06/src)> gcc -g -O2 -Wall -pedantic -o .libs/namazu.cgi form.o namazu.o output.o rcfile.o result.o usage.o cgi.o namazu-cgi.o -lnmz -lm ../lib/libnmzut.a -lm -L/usr/local/lib -lintl -Wl,--rpath -Wl,/usr/local/lib /usr/local/lib/libnmz.so: warning: reference to compatibility setlocale(); include <locale.h> for correct reference makoto@scgj■ 16:06:15/000907(...namazu-2000-09-06/src)> ( つっこみ )
#1 [Unix] MRTG,snmpd, とか僕には役に立つ
http://www3.digitalworks.com/~jean/newb/UNIX
(何故か見付からなくなってしまった) ( つっこみ )
|
最近の日記 2024年03月10日 ・停電 (瞬電) 2024年03月03日 ・the second try on bare-metal ・useradd 2024年02月29日 ・opendkim and senmail 2024年01月24日 ・chat/iam 0.0.8 2024年01月21日 ・uselocale vs setlocale (textproc/R-readxl) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||