|
From: Tatsuro M. <tma...@ya...> - 2010-10-11 01:33:48
|
Hello I have tried to look this phenomena in detail. However it is principally difficult to trace the issue by the gdb. And on the gdb, application error itself does not appear. Therefore I use the SetConsoleCtrlHandler and CtrlHandler functions in the win32api. The issue is easy to fix to use the above. I have also retied to fix ctrc+c issue on gnuplot.exe on windows. It seem that setjmp+longjmp routine does not work in the interrupt routine on windows. In windows console program, use of the SetConsoleCtrlHandler and CtrlHandler functions seem to be usual way to trap CTRL + C. In the trapping routine, I have copied SETJMP in gnu_main( for the windows case). However, I cannot make the prompt 'gnuplot> ' to be appeared. But I found that the pressing the return key makes the prompt to be appeared. I have write that temporal treatment. If press the CTRL + C at gnuplot prompt, gnuplot> CTRL+C detected. Press return to back to the prompt -> If press the return, I can back to the gnuplot prompt The total appearances are gnuplot> CTRL+C detected. Press return to back to the prompt -> gnuplot> I have attached the patch. Comments and suggestions are welcome. For the wnuplot, the way I have shown cannot be used. Perhaps, the GUI program for windows, different way should be considered. Regards Tatsuro --- Tatsuro MATSUOKA wrote: > Hello > > The problem is completely different from the original issue. > Therefore I post the issue as a different one. > > > Explanation of CTRL_CLOSE_EVENT > > CTRL_CLOSE_EVENT : Close the window consoleby clicking on the x at the upper right corner. > > > I have confirmed the same phenomena at gnuplot 4.4.0 on the gnuplot official site. > > I also confirmed the same pehnomena at gnuplot 4.4.0 for octave-mingw32 bundled with > octave-3.2.4 > mingw32 which is prepared by Benjamin. > > Perhaps it is not specific to the current my build system. > > One of the way to avoid this issue is to trap the CTRL_CLOSE_EVENT using win32api and exit > gnuplot > using the function (at_exit? ) used inside gnuplot. > > If I implement this, I will write the routine in the plot.c > > However I will look at what is happing further. > > Regards > > Tatsuro > > > > *************************************************** > --- Tatsuro MATSUOKA wrote: > > > This is well known issue for windows console applications. > > The octave also has the similar issue. > > Seeing phenomena in detail, the issue pointed is not the same as that of the octave for windows. > > Please try, > > set term win > plot x > > and quit gnuplot by clicking on the x at the upper right corner. > In my case, gnuplot terminates normally. > > set term emf > set out 'test.emf' > plot x > > and quit gnuplot by clicking on the x at the upper right corner. > In this case, gnuplot also terminates normally. > (test.emf was correctly generated so that gnuplot terminated with normal quit process.) > > > This phenomenon seems to be specific to the wxt terminal + gnuplot.exe. > > I have to see the code of the wxt terminal related codes so that it will take time to correct > it. > > Regards > > Tatsuro > > > > > > However, to avoid this issue one have to trap CTRL_CLOSE_EVENT (that is you described as > > clicking on > > the x at the upper right corner) using SetConsoleCtrlHandler function, which is the win32api > > function. > > > > However, I have tried to trap CTRL+C by this api function to overcome the SIGINT issue for > > gnuplot for > > windows, the results was not successful. > > > > I can try to fix CTRL_CLOSE_EVENT issue but I do not have any confidence to avoid to it. > > > > One possible way to treat the issue in tricky way is to execute gnuplot.exe on the cmd.exe > > wrapper > > application like 'ckw'. > > > > I am using the Japanese software the ckw downloaded from > > http://sites.google.com/site/craftware/ckw/download/ckw-0.8.10-mod4-20100508.zip > > > > The reference is translated by me. > > http://www.tatsuromatsuoka.com/ckw/Reference-en.txt > > > > Known bug for the ckw-0.8.10-mod4-20100508. > > If the ckw command is execute by shortcut, it fails to hide the cmd console. > > To avoid this, you execute ckw using the start command in the cmd. > > cmd /c start ckw (options) > > > > Please also see the help of start command by typing 'help start' at cmd prompt. > > > > Regards > > > > Tatsuro > > > > > > > > --- Petr Mikulik wrote: > > > > > > I've tried the latest distribution from > > > > http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/, and the fix is > > > > confirmed! > > > > > > > > However, I've found something else. Steps to reproduce: > > > > > > > > 1) Start gnuplot.exe - either from an Explorer window or from the console > > > > 2) Plot anything - for example 'plot x' > > > > 3) Close the window, not by typing exit, but by clicking on the x at > > > > the upper right corner > > > > 4) Observe the error window: 'Application error: The instruction at > > > > "0x00000000" referenced memory at "0x00000000". The memory could not > > > > be "read".' > > > > > > > > It's always 0x00000000, and it's 100% reproducible on both Windows XP > > > > (32 bit) machines I've tried. > > > > > > > > Notes: this happens only with gnuplot.exe, but not with wgnuplot.exe. > > > > Also, this doesn't occur if you change the terminal to "windows" > > > > instead of "wxt". > > > > > > I set wine to "winxp" and gnuplot.exe works correctl > > -------------------------------------- > Learn more about breast cancer - Pink Ribbon Campaign 2010 > http://yj.pn/JAy9L7 > -------------------------------------- Learn more about breast cancer - Pink Ribbon Campaign 2010 http://yj.pn/JAy9L7 |