<div style="min-height:22px">Hi!</div><div style="min-height:22px"><br></div><div style="min-height:22px">I've tested the latest rc1 package with various computers. it worked as expected, including printing Chinese character. Thanks again.</div><div style="min-height:22px"><br></div><div style="min-height:22px">- Rujia</div><div style="min-height:22px"></div><span class="mail-footer">发自我的iPhone</span><div id="original-content"><br><br><div><div style="font-size:70%;padding:2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size:70%;background:#f0f0f0;color:#212121;padding:8px;border-radius:4px"><div><b>发件人:</b> Daniel Kochmański <jackdaniel@hellsgate.pl></div><div><b>发送时间:</b> 2015年03月07日 00:22</div><div><b>收件人:</b> Rujia Liu <2575127@qq.com></div><div><b>抄送:</b> ecls-list <ecls-list@lists.sourceforge.net></div><div><b>主题:</b> Re: [Ecls-list] Issue: ECL fails to compile under Chinese Windows</div></div></div><br>Hello,<br><br>I believe that I have succesfully found solution. Problem was recurrence<br>in si_make_encoding function. It was calling ext::make-encoding, but due<br>to bogus entry in symbols_list, this was pointing back to<br>si_make_encoding. I think problem was affecting not only Chinese, but<br>also other windows installations with custom code page.<br><br>Fix is pushed to develop and rc1 branches. I would be grateful, if you<br>could check if it works on your computer. (I've tested it on changed<br>encoding on windows, so I could reproduce error, and now it compiles<br>fine here).<br><br>Cheers,<br>Daniel<br><br>Daniel Kochmański writes:<br><br>> Hey,<br>><br>> I'm very thankful for this detailed description. Really, well done! :-)<br>> It is very helpful to know, where problem and what potential solution<br>> is. I'm downloading now windows 7 trial version and will try to<br>> reproduce error.<br>><br>> Best regards,<br>> Daniel<br>><br>> Rujia Liu writes:<br>><br>>> Dear all,<br>>><br>>> I'm a Chinese developer who have used ECL for some time in 2013. Although I don't use it recently, I'd like to report an old issue (and our investigations) that I struggled with.<br>>><br>>> Problem: ECL fails to compile under CHINESE windows XP and windows 7, due to ecl_min.exe crash.<br>>><br>>> This issue is present in 13.5 (and also 15.3.7-rc1) but not in version 12.12.1. <br>>><br>>> I've discussed this with Juan Jose in private emails (thanks, Juanjo!) but we were both quite busy and didn't finish it.<br>>><br>>> However, we have some important observations: <br>>><br>>> 1. Before 2012-12-16, the whole ECL is working on our machines (not only ecl-min) so something that changed after that is causing this problem.<br>>><br>>> 2. I debugged with windbg, found that ecl_min.exe crashed in cl_boot, here:<br>>><br>>> if (cl_fboundp(@'ext::make-encoding') != ECL_NIL) {<br>>>         maybe_fix_console_stream(cl_core.standard_input);<br>>>         maybe_fix_console_stream(cl_core.standard_output);<br>>>         maybe_fix_console_stream(cl_core.error_output);<br>>>     }<br>>><br>>> (BTW: our encoding is CP936 and windbg showed the code successfully detected this, i.e. known_cp[i].name is "WINDOWS-CP936")<br>>><br>>> In maybe_fix_console_stream(cl_object stream), there is a call:<br>>><br>>>     si_stream_external_format_set(stream, external_format);<br>>><br>>> Then I traced into it, and found it got here:<br>>><br>>> #ifdef ECL_CLOS_STREAMS<br>>>         unlikely_if (ECL_INSTANCEP(stream)) {<br>>>                 FEerror("Cannot change external format of stream ~A", 1, stream);  <--- *** it got here. ***<br>>>         }<br>>> #endif<br>>><br>>> and here:<br>>><br>>>                         cl_object elt_type = ecl_stream_element_type(stream);<br>>>                         unlikely_if (elt_type != @'character' &&<br>>>                                      elt_type != @'base-char')<br>>>                                 FEerror("Cannot change external format"<br>>>                                         "of binary stream ~A", 1, stream); <-- *** and here. ***<br>>>                         set_stream_elt_type(stream, stream->stream.byte_size,<br>>>                                             stream->stream.flags, format);<br>>><br>>> Then in set_stream_elt_type, it got into an INFINITE RECURSION:<br>>><br>>> static int<br>>> parse_external_format(cl_object stream, cl_object format, int flags)<br>>> {<br>>>         if (format == @':default') {<br>>>                 format = ecl_symbol_value(@'ext::*default-external-format*');<br>>>         }<br>>>     if (CONSP(format)) {  <-- this is always true, so it recurses indefinitely<br>>>         flags = parse_external_format(stream, ECL_CONS_CDR(format), flags);<br>>>         format = ECL_CONS_CAR(format);<br>>>     }<br>>><br>>> I don't know why format is such "infinite cons", maybe because of the FEerrors, the format variable is left in an abnormal state?<br>>><br>>> 3. In ECL12.12.1, the condition below is not satisfied so the 'troublesome' maybe_fix_console_stream is not called at all (that's why ecl_min.exe does NOT crash under 12.12.1).<br>>><br>>> if (cl_fboundp(@'ext::make-encoding') != ECL_NIL) {<br>>>         maybe_fix_console_stream(cl_core.standard_input);<br>>>         maybe_fix_console_stream(cl_core.standard_output);<br>>>         maybe_fix_console_stream(cl_core.error_output);<br>>>     }<br>>><br>>> Actually, after I commented out these lines in git repository's master, everything seems to work fine.<br>>><br>>> I've tested some programs, outputing chinese characters without any problem. But since I haven't tested a lot of program, I'm not sure whether there is any potential problem.<br>>><br>>> Finally, my questions:<br>>><br>>> 1. Is it possible to skip setting the external format? Actually our program will reset the encoding to utf-8, despite our windows defaults to CP936 so it really doesn't matter whether to set it in cl_boot. It's perfectly ok to set it to LATIN-1 instead. We tested ECL12.12.1, it depends on msvc/encodings directory (when I removed the director it asks for WINDOWS-CP936 file) but it works.<br>>><br>>> 2. Since this issue affacts a lot of (potential) users, should we add it somewhere in the document or wrap these lines in a compiler directive so that user can choose to skip this part when compiling?<br>>><br>>> BTW: I'm very happy to see that ECL has a new maintainer now. That's REALLY great!<br>>> ‍<br>>> Best regards,<br>>> Rujia Liu------------------------------------------------------------------------------<br>>> Dive into the World of Parallel Programming The Go Parallel Website, sponsored<br>>> by Intel and developed in partnership with Slashdot Media, is your hub for all<br>>> things parallel software development, from weekly thought leadership blogs to<br>>> news, videos, case studies, tutorials and more. Take a look and join the <br>>> conversation now. http://goparallel.sourceforge.net/_______________________________________________<br>>> Ecls-list mailing list<br>>> Ecls-list@lists.sourceforge.net<br>>> https://lists.sourceforge.net/lists/listinfo/ecls-list<br><br>-- <br>Daniel Kochmański | Poznań, Poland<br>;; aka jackdaniel<br><br>"Be the change that you wish to see in the world." - Mahatma Gandhi</div>