=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Doc/changelog-ja.tex,v retrieving revision 1.30 retrieving revision 1.36 diff -u -p -r1.30 -r1.36 --- OpenXM/src/kan96xx/Doc/changelog-ja.tex 2013/09/20 06:02:18 1.30 +++ OpenXM/src/kan96xx/Doc/changelog-ja.tex 2018/05/02 02:28:13 1.36 @@ -1,4 +1,4 @@ -% $OpenXM: OpenXM/src/kan96xx/Doc/changelog-ja.tex,v 1.29 2012/10/29 02:51:41 takayama Exp $ +% $OpenXM: OpenXM/src/kan96xx/Doc/changelog-ja.tex,v 1.35 2015/10/12 11:29:48 takayama Exp $ \documentclass{jarticle} \title{ChangeLog \\ ---kan96xx, kxx, k097} \author{Nobuki Takayama} @@ -129,6 +129,7 @@ \section{2004-09-05, グレブナfanの計算} \begin{enumerate} \item polymake が必要. 9/1, 9/2, 9/3, 9/4 のノートも参照. +@s/2004/08/21-note.pdf に変数等の説明あり. \item OpenXM の cvs への commit は大きい区切りで. 細かい変更は {\tt eventail/cone.sm1} で. \item {\tt OpenXM/src/kan96xx/Doc/gfan.sm1} 1.1 @@ -690,6 +691,223 @@ grep すると {\tt kclass.c} を探せばいい. ここに tag がいろいろある. usage に note-class を追加. +\section{2013-09-22, oxdecode\_post} +mime 形式の post message を URL encoding に変換 +(mime の判定等は現状なんちゃって). +これで, reverse proxy 経由でも正常動作. + +\begin{verbatim} +cat t.txt +FACETS POINTS +1 0 0 +1 1 0 +1 0 1 + + curl -F oxMessageBody=@t.txt http://polymake.math.kobe-u.ac.jp/cgi-bin/cgi-polymake.sh +\end{verbatim} + +\begin{verbatim} +library(RCurl); +postForm("http://polymake.math.kobe-u.ac.jp/cgi-bin/cgi-polymake.sh", + oxMessageBody="FACETS POINTS\n1 0 0\n1 1 0\n1 0 1") +[1] "POINTS\n1 0 0\n1 1 0\n1 0 1\r\n\nFACETS\n1 -1 -1\n0 1 0\n0 0 1\n\n + AFFINE_HULL\n\n\n_version 2.0\n_application polytope\n\n" +attr(,"Content-Type") + charset +"text/plain" "UTF-8" +\end{verbatim} + +{\tt cgiPolymake.log} に 1 を代入しておくと(既定値) +sm1log で /tmp/sm1log.txt に post message を記録. +date 関数を追加. + +curl を用いた呼び出しのテスト. +\begin{verbatim} +(cgi.sm1) run +/cgiQueryPolymake { cgiQueryPolymake.curl } def + [(FACETS) (polymake.data(polymake.POINTS([[1,0,0],[1,1,0],[1,0,1],[1,1,1/2]])))] /ff set +ff doPolymake.OoHG /rr set +\end{verbatim} + +\section{2013-09-25, usePolymake.*} +polymake のスイッチ. version により振る舞いが違うので注意. + +各種 log の場所. +\begin{enumerate} +\item server side. {\tt /tmp/sm1log.txt}: cgi-post の encoded 文字列. +\item server side. cgi-polymake.sh に tee を追加すると, oxdecode\_post 前の文字列を +保存できる. +\item client side. oxshell で work file を {\tt \$TMP} に残すには +oxshell の usage を見て, keep\_tmp\_files を使う. +local 版では {\tt @@@doPolymake.vars} に記録あり. +asir では {\tt polymake.log()} に格納. +\item {\tt usePolymake.OoHG.curl} の時は {\tt /tmp/sm1-q-cgi*.txt} +に cgi に問い合わせる時の文字列が格納される. +\end{enumerate} + +なお mac 版は error で bus error を起こす場合あり. +サンプル code は, {\tt misc-2013/09/genpos/mac.sm1}. +これは ticket. + +screenflow による覚え書きは, +fe の {\tt /Movies/oxvh/2013-09-25-polymake}. + +\section{2015-10-10, cygwin64, msys64} + +cygwin64, msys64 対応. +\begin{enumerate} +\item gc には patch. cygwin64 の gc.h はすでに patch が当たってる. + よって gc が更新されたら patch は多分不要. +\item sigsetjmp を {\tt \_setjmp} にしないとたとえば +微分作用素環の掛け算で segfault. 原因はよくわからず. +\item string.h, stdlib.h 等の prototype 宣言をしておかないと {\tt ox\_sm1} が segfault. +\item msys では cmd.exe が新しい window を開かないので(謎), mintty を使う. +\end{enumerate} +fe の {\tt /Movies/archive} の bandicam にも記録. + +Todo, ctrl-C が一度しか有効でない. sigaction を利用するべき? + +{\tt ox\_sm1} の segfault の debug +{\tiny +\begin{verbatim} + misc-2015/10/cygwin-for-sm1 に + oxserver00-d.c Makefile-for-ox_sm1d tmp-o.txt あり. + tmp-o.txt は ( (1).. (0).. div ) oxsubmit で エラーを起こす命令を, + stream dump したもの. cf. (ox.sm1) run (extension-oxLog) usage + oxpipe.c を oxserver00.c へ組み込んだもの. gdb 用. ox_sm1d + 523 rm ox_sm1d + 525 make -f Makefile-for-ox_sm1d ox_sm1d + 526 ./ox_sm1d +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-pc-msys". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: +. +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./ox_sm1d...done. +(gdb) break main +Breakpoint 1 at 0x10049b7b8: file oxserver00-d.c, line 37. +(gdb) run +Starting program: /home/Nobuki/OX4/OpenXM/src/kxx/ox_sm1d +[New Thread 11260.0x17c8] +[New Thread 11260.0x2e50] +[New Thread 11260.0x8ac] +[New Thread 11260.0x29d0] +[New Thread 11260.0x27b8] + +Breakpoint 1, main (argc=1, argv=0x24cb10) at oxserver00-d.c:37 +37 main(int argc, char *argv[]) { +(gdb) call dup2(open("tmp-o.txt",0),0) +// run macro package : dr.sm1, 9/26,1995 --- Version 09/22, 2013. +sm1>macro package : module1.sm1, 1994 -- Nov 8, 1998 +sm1 version : 3.050615 +sm1 url : http://www.math.kobe-u.ac.jp/KAN +name = ox_sm1 +sm1>--------------------------------------------------- +engineByteOrder=0 +Hello world. +Set EnvOfChildServer. +Set EnvOfStackMachine. + +mtag is 514 (serial=11) : OX_DATA +(CMO_STRING[4],[size=17],$ (1).. (0).. div $), +mtag is 513 (serial=12) : OX_COMMAND + +function_id is 268; SM_executeStringByLocalParser +KSexecuteString( (1).. (0).. div ) + +ERROR(kanExport[0|1].c): KisInvalidRational(): zero division. You have f/0. +Trace: div<-; + +Breakpoint 2, Sm1_popErrorMessage (s=0x10049d084 "executeString: ") + at sm1stackmachine.c:205 +205 char *Sm1_popErrorMessage(char *s) { +(gdb) print s +$2 = 0x10049d084 "executeString: " +(gdb) print ErrorMessageMode +$3 = 2 +(gdb) break popErrorStackByString +Breakpoint 3 at 0x1004033f0: file stackmachine.c, line 1445. +(gdb) continue +Continuing. + +Breakpoint 3, popErrorStackByString () at stackmachine.c:1445 +1445 char *popErrorStackByString(void) { +(gdb) list +1440 }else{ +1441 return( (ErrorStack.ostack)[--(ErrorStack.sp)]); +1442 } +1443 } +1444 +1445 char *popErrorStackByString(void) { +1446 struct object obj = OINIT; +1447 struct object eobj = OINIT; +1448 eobj = popErrorStack(); +1449 if (ectag(eobj) != CLASSNAME_ERROR_PACKET) { +(gdb) break sGC_malloc +Breakpoint 4 at 0x1004035a0: file stackmachine.c, line 1510. +(gdb) continue +Continuing. + +Breakpoint 4, sGC_malloc (n=93) at stackmachine.c:1510 +1510 void *sGC_malloc(size_t n) { /* synchronized function */ +(gdb) up +#1 0x000000010040276b in Sm1_popErrorMessage (s=0x10049d084 "executeString: ") + at sm1stackmachine.c:221 +221 a = (char *) sGC_malloc(sizeof(char)*(strlen(s)+strlen(e)+2)); +(gdb) print s +$4 = 0x10049d084 "executeString: " +(gdb) print e +$5 = 0x6008d4d70 "\nERROR(kanExport[0|1].c): KisInvalidRational(): zero division. You have f/0." +// 正常 +(gdb) continue +Continuing. + 14 [main] ox_sm1d 11260 cygwin_exception::open_stackdumpfile: Dumping stack trace to ox_sm1d.exe.stackdump +[Thread 11260.0x2e50 exited with code 35584] +[Thread 11260.0x8ac exited with code 35584] +[Thread 11260.0x29d0 exited with code 35584] +[Thread 11260.0x2f84 exited with code 35584] +[Thread 11260.0x2a28 exited with code 35584] +[Inferior 1 (process 11260) exited with code 0105400] +(gdb) quit + +GC_malloc や strcpy 等が怪しいとにらむ. + + + char * 系 void * 系の宣言なしが segfault の原因? + strcpy が変. + + kxx/serversm.h に +#include +void *sGC_malloc(int n); +を加える. + ./ox_sm1d