hns - 日記自動生成システム - Version 2.19.9

  • 04/25(木) Interface
  • 04/27() 2100 - 2100 ALL JA
  • 04/28() tokuda net 誕生日
  • 04/28() 自動車保険期限 (OS/Browser 制限有)
  • 04/30(火) NTT 東 払込期日
  • 04/30(火) ○ 固定資産税振替・支払
  • 05/01(水) atactl check
  • 05/01(水) 不燃ごみ
  • 05/03(金) 0900-1500 東京コンテスト
  • 05/14(火) All JA ログ締切
  • 05/15(水) 不燃ごみ
  • 05/18() 木之本会議
  • 05/19() CQ Ham Radio
  • 05/19() 別冊 CQ
  • 05/25() Interface
  • 403 JNUG 総会/BOF 2017/07/08 (土)
  • 402 用途別 Emacs ( C, LaTeX, 日本語 )
  • 380 cvsweb の移行
  • 370 tamago 辞書登録
  • 368 CROSS (cross/i386-mingw32, cross/powerpc-linux ) Framework --- binutils + gcc
  • 363 Wanderlust+HyperEstraier
  • 360 evbppc 用 patch / 玄箱
  • 335 /dev/battery is missing hack | libgcc_s_pic.a is missing | samba の -PIE 問題335 ntpd monitor
  • 325 tcode頁の更新
  • 322 software |hardware
  • 321 emacs-22 | IPv6
  • 320 bulk build (Mac OS X 10.4 and NetBSD/macppc)
  • 310 Wanderlust の Namazu の挙動
  • 290 WordPress 1.2 -> 1.5 migration
  • 220 Wanderlust で日本語題名の wl-summary-print-buffer
  • 215 NetBSD/ofppc
便利なツール
Emacs
らくらく 入門
rakuraku-emacs-cover

先月 2024年04月 来月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2014年06月27日(金) 旧暦 [n年日記] [更新:"2014/06/27 23:14:48"]

#1 [debug] fgetc Segmentation Fault at malloc

#0  0x00007f7ff789df92 in ?? () from /usr/lib/libc.so.12
#1  0x00007f7ff789e3d0 in ?? () from /usr/lib/libc.so.12
#2  0x00007f7ff789e689 in malloc () from /usr/lib/libc.so.12
#3  0x00007f7ff78ed28c in __smakebuf () from /usr/lib/libc.so.12
#4  0x00007f7ff78e24f8 in __srefill () from /usr/lib/libc.so.12
#5  0x00007f7ff78e2384 in __srget () from /usr/lib/libc.so.12
#6  0x00007f7ff7843997 in fgetc () from /usr/lib/libc.so.12
これはどういう時かな。確かに読んでいるファイルは大きいのだけれど。
% wc hoge.5itmp 
   43213  152201 1897759 hoge.5itmp
1.9MByte かな。でもそんなにやたらに大きということでもないと思う
次のような文字を教えても google は見向きもしない(ようだ)
in malloc ()
in __smakebuf ()
in __srefill ()
in __srget ()
in fgetc () from
ちなみに、次のところで説明されている問題は、まだ理解出来ていない。
fgetc が malloc を(勝手に)呼んでいるとして、そのメモリは、いつ free されるのだろうか ?

上記の答えは、「file descriptor を close すれば、開放される」
include/stdio.h

   112  typedef struct __sFILE {
   113          unsigned char *_p;      /* current position in (some) buffer */
   114          int     _r;             /* read space left for getc() */
   115          int     _w;             /* write space left for putc() */
   116          unsigned short _flags;  /* flags, below; this FILE is free if 0 */
   117          short   _file;          /* fileno, if Unix descriptor, else -1 */
   118          struct  __sbuf _bf;     /* the buffer (at least 1 byte, if !NULL) */
   119          int     _lbfsize;       /* 0 or -_bf._size, for inline putc */
   120  
   121          /* operations */
   122          void    *_cookie;       /* cookie passed to io functions */
   123          int     (*_close)(void *);
   124          int     (*_read) (void *, char *, int);
   125          __off_t (*_seek) (void *, __off_t, int);
   126          int     (*_write)(void *, const char *, int);
   127  
   128          /* file extension */
   129          struct  __sbuf _ext;
   130  
   131          /* separate buffer for long sequences of ungetc() */
   132          unsigned char *_up;     /* saved _p when _p is doing ungetc data */
   133          int     _ur;            /* saved _r when _r is counting ungetc data */
   134  
   135          /* tricks to meet minimum requirements even when malloc() fails */
   136          unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
   137          unsigned char _nbuf[1]; /* guarantee a getc() buffer */
   138  
   139          /* Formerly used by fgetln/fgetwln; kept for binary compatibility */
   140          struct  __sbuf _lb__unused;
   141  
   142          /* Unix stdio files get aligned to block boundaries on fseek() */
   143          int     _blksize;       /* stat.st_blksize (may be != _bf._size) */
   144          __off_t _offset;        /* current lseek offset */
   145  } FILE;
   146  
lib/libc/stdio/makebuf.c
    55  /*
    56   * Allocate a file buffer, or switch to unbuffered I/O.
    57   * Per the ANSI C standard, ALL tty devices default to line buffered.
    58   *
    59   * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek
    60   * optimisation) right after the fstat() that finds the buffer size.
    61   */
    62  void
    63  __smakebuf(fp)
    64          FILE *fp;
    65  {
    66          void *p;
    67          int flags;
    68          size_t size;
    69          int couldbetty;
    70
    71          _DIAGASSERT(fp != NULL);
    72
    73          if (fp->_flags & __SNBF) {
    74                  fp->_bf._base = fp->_p = fp->_nbuf;
    75                  fp->_bf._size = 1;
    76                  return;
    77          }
    78          flags = __swhatbuf(fp, &size, &couldbetty);
    79          if ((p = malloc(size)) == NULL) {
    80                  fp->_flags |= __SNBF;
    81                  fp->_bf._base = fp->_p = fp->_nbuf;
    82                  fp->_bf._size = 1;
    83                  return;
    84          }
    85          __cleanup = _cleanup;
    86          flags |= __SMBF;
    87          fp->_bf._base = fp->_p = p;
    88          fp->_bf._size = size;
    89          if (couldbetty && isatty(__sfileno(fp)))
    90                  flags |= __SLBF;
    91          fp->_flags |= flags;
    92  }
上の中で size が気になる時には __swhatbuf も見る必要がある
    94  /*
    95   * Internal routine to determine `proper' buffering for a file.
    96   */
    97  int
    98  __swhatbuf(fp, bufsize, couldbetty)
    99          FILE *fp;
   100          size_t *bufsize;
   101          int *couldbetty;
   102  {
   103          struct stat st;
   104
   105          _DIAGASSERT(fp != NULL);
   106          _DIAGASSERT(bufsize != NULL);
   107          _DIAGASSERT(couldbetty != NULL);
   108
   109          if (__sfileno(fp) == -1 || fstat(__sfileno(fp), &st) < 0) {
   110                  *couldbetty = 0;
   111                  *bufsize = BUFSIZ;
   112                  return (__SNPT);
   113          }
   114
   115          /* could be a tty iff it is a character device */
   116          *couldbetty = S_ISCHR(st.st_mode);
   117          if (st.st_blksize == 0) {
   118                  *bufsize = BUFSIZ;
   119                  return (__SNPT);
   120          }
   121
   122          /*
   123           * Optimise fseek() only if it is a regular file.  (The test for
   124           * __sseek is mainly paranoia.)  It is safe to set _blksize
   125           * unconditionally; it will only be used if __SOPT is also set.
   126           */
   127          *bufsize = st.st_blksize;
   128          fp->_blksize = st.st_blksize;
   129          return ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek ?
   130              __SOPT : __SNPT);
   131  }
st というのは 103 行目 にあるが struct stat の構成要素(member)だ
modena@makoto 23:14:17/140627(/export/src)% (cd include;mkid; gid BUFSIZ)
stdio.h:181:#define     BUFSIZ  1024            /* size of buffer used by setbuf */
というのもある


2011年06月27日(月) 旧暦 [n年日記] [更新:"2011/06/29 09:40:11"]

#3 [pkgsrc] xdvi での日本語表示

2011/03/01 に続いて、きょうも色々調べて見たが、進展はなかった。
print/ja-vfxdvi
print/xdvik
wip-jp/ja-xdvik
主に最低限 wip-jp/ja-xdvik を compile 出来るようにしておきたいと 思ったが、png-1.5 問題を解決出来なかった。 (どうも TeXlive の 2011 を見れば良い気がしたが、一年の変化だと、 そう簡単に一部を取込むというのは出来そうになかった)

#2 [日本語入力] 最近漢直 Win から入力出来ない気がする

最近漢直 Win から入力出来ない気がする (Windows XP, Windows 2000) 1.27f

#1 [無線] JARL から QSL Card 370g

2011/04/30 の 350 g から少し増えた。


2004年06月27日() 旧暦 [n年日記]

#1 [pkgsrc] Mozilla のないくらし

www/mozilla/work/mozilla で ./configure ってやると、正常終了。続けて gmake
../../dist/bin/libxpcom.so: undefined reference to `nsXPTCStubBase::Stub229()'
gmake[3]: *** [nsIFileEnumerator] Error 1
gmake[3]: Leaving directory `/export/pkgsrc/www/mozilla/work/mozilla/xpcom/tests'
gmake[2]: *** [libs] Error 2
(ここまで 1.6) ここから 1.7


2001年06月27日(水) 旧暦 [n年日記]

#1 [inn] inn-2.3.2 を組立てる

を見ながら。SS-10 は遅いなぁ。
1056.634u 122.278s 22:16.89 88.1% 0+0k 1028+10411io 205pf+0w
spool と history を分けた方がいいと思うので、
2036 cyl を 1400+636 に分けて、
 c: 2052288        0  unknown               # (Cyl.    0 - 2035)
 d: 1411200        0   4.2BSD  512 4096  16 # (Cyl.    0 - 1399)
 e:  641088  1411200   4.2BSD 1024 8192  16 # (Cyl. 1400 - 2035)
newfs -m 2 -f 512 -b 4096 /dev/sd4d
newfs -m 2 /dev/sd4e
cyl は 1600+436 くらいの方が良かったかな。やり直し。
 c: 2052288        0  unknown               # (Cyl.    0 - 2035)
 d: 1612800        0   4.2BSD  512 4096  16 # (Cyl.    0 - 1599)
 e:  439488  1612800   4.2BSD 1024 8192  16 # (Cyl. 1600 - 2035)
make install すると

Do not forget to update your cron entries, and also run makedbz if you need to. If this is a first-time installation a minimal active file has been installed. You will need to touch history and run "makedbz -i" to initialize the history database. See INSTALL for more information.

と表示される

/dev/sd4d 757582  12544  729886 1%  /usr/local/news
/dev/sd4e 212559      3  208304 0%  /usr/local/news/db
active は出来ている。 ~news/.cshrc に
set path = ( /usr/local/news/bin /usr/bin /bin /usr/local/bin )
と書いておいて
     6  22:02   touch db/history
     7  22:02   makedbz -i
> ls -l db
total 6
-rw-r--r--  1 news  news  225 Jun 27 21:28 active
-rw-r--r--  1 news  news    0 Jun 27 21:56 active.times
-rw-r--r--  1 news  news    0 Jun 27 22:02 history
-rw-r--r--  1 news  news   41 Jun 27 22:02 history.n.dir
-rw-r--r--  1 news  news    0 Jun 27 22:02 history.n.hash
-rw-r--r--  1 news  news    0 Jun 27 22:02 history.n.index
-rw-r--r--  1 news  news  333 Jun 27 21:28 newsgroups

> inndstart
> ps ax | grep inn
動いていない。/var/log/message を見ると
milano innd: SERVER cant dbzinit 
   /usr/local/news/db/history No such file or directory
とある。良く見たら history の名前が一時名だった。名前を変えて
> mv history.n.hash history.hash
> mv history.n.dir  history.dir
> mv history.n.index history.index
> inndstart
> !ps
ps ax | grep inn
17805 ??  Ss     0:00.22 /usr/local/news/bin/innd -p4 
これで一応動いた。 active を同期させるのは ? actsync というのがあるはずだけれど、簡単には分らないので 接続先から list active で持って来た。 script しておいて、その記録を
> tr -d '\015' < /tmp/active \
  | awk '{print "ctlinnd newgroup", $1, $4}' > /tmp/1
  して、少し前後を削り、
> vi /tmp/1
  sh /tmp/1

incoming.conf に追加:

innfeed.conf:

expire.ctl:

/usr/local/news/bin/innd -p4 -c 2000:

古めの記事が来ているようなので、どうせならと 2000 日。


2000年06月27日(火) 旧暦 [n年日記]

5161歩

#3 [NetBSD] shared library

僕は「多分 libtool を使うのだろう」という言葉しか 考えがうかばない。(それ以上知らないということ)
(hns-2.00 って、枝番の付け方が違う ? もしそうだとすると、 入替えた時に、以前の参照 (LINK) が狂ってしまう ? )

#2 [音訳誹語] その一

security 安全
trade off 天びん

#1 [Mailing-List] Debian は Majordomo に安全上問題があり、契約文の上でも変更も許されないので削除

debian-security-announce-00/msg00007.html だそうです。
僕は、はっきり言って fml はきらいです。理由は、もしかしたら 誤解かも知れないけれど、あまりにも何でも設定出来ることです。 例えば、投稿先に # bye なんて送ることが出来るような設定も 出来るとか。



最近の日記
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)
以上、5 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)