[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...
Issue #14357 has been reported by vo.x (Vit Ondruch).
11 messages
2018/01/15
[#85364] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Eric Wong <normalperson@...>
2018/02/03
v.ondruch@tiscali.cz wrote:
[#85368] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Eric Wong <normalperson@...>
2018/02/03
Eric Wong wrote:
[#85442] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Eric Wong <normalperson@...>
2018/02/06
Eric Wong <normalperson@yhbt.net> wrote:
[#85451] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Vladimir Makarov <vmakarov@...>
2018/02/06
On 02/06/2018 05:00 AM, Eric Wong wrote:
[#84874] [Ruby trunk Bug#14360] Regression CSV#open method for writing from Ruby 2.4.3 to 2.5.0 — shevegen@...
Issue #14360 has been updated by shevegen (Robert A. Heiler).
3 messages
2018/01/15
[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...
Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).
10 messages
2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/01/23
hsbt@ruby-lang.org wrote:
[#85081] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/01/24
Eric Wong <normalperson@yhbt.net> wrote:
[#85082] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/01/24
> Thinking about this even more; I don't think it's possible to
[#85088] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — danieldasilvaferreira@...
Issue #13618 has been updated by dsferreira (Daniel Ferreira).
3 messages
2018/01/25
[#85107] [Ruby trunk Misc#14222] Mutex.lock is not safe inside signal handler: what is? — eregontp@...
Issue #14222 has been updated by Eregon (Benoit Daloze).
3 messages
2018/01/25
[#85136] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...>
samuel@oriontransfer.org wrote:
3 messages
2018/01/26
[ruby-core:84842] [Ruby trunk Feature#14352] Array#pack("M") Quoted-Printable with binary mode
From:
mame@...
Date:
2018-01-12 01:36:00 UTC
List:
ruby-core #84842
Issue #14352 has been updated by mame (Yusuke Endoh).
遠藤と申します。ご報告ありがとうございます。
Quoted-Printable を規定しているのは RFC 2045 の "6.7. Quoted-Printable Content-Transfer-Encoding" だと思います。関連しそうなところを中心にルールを要約すると
(1) canonical form での CRLF 改行の CR と LF 以外の文字は、原則として =0C のようにエンコードする。ただし他のルールが別表現を許している場合はそれ以外でもよい。
(2) イコール以外の printable な文字(32〜60、62〜126)はそのままエンコード結果に出してもよい。
(3) 空白文字(9 と 32)もそのまま出してもよい。ただし行末に置く場合は =20 みたいにしないとダメ。
(4) テキスト内の CRLF 改行は、出力でも CRLF にしないといけない。メディア形式によっては CRLF 改行表現がないこともあるので、そういう形式ではハード改行を含めてはダメ。非テキストのエンコードでは =0D や =0A や =0D=0A が普通に現れる。
(5) 一行は 76 文字まで。行末に = をつけること。
と書いてあるように読めました(規格の誤読に定評と実績があるので、他の人にも確認してほしいです)。
この解釈が正しければ、現在の挙動である "...=0D\n..." は明確に否定されていると思います。
> 今からpack('M')の挙動を変えると、影響範囲が大きそうなので、バイナリをQuoted-Printableでエンコード
> するためのオプションがあれば、いいと思うのですが、packにどういうオプション名をつければよいか、
互換性は大切ですが、規格違反だとしたら(少なくともいつかは)直すべきであると思います。
また、テキストか非テキストかでエンコード結果を変えることは、規格によって事実上要求されているように読めました。
思いつきですが、できればオプションを増やしたくはないので、エンコード対象の文字列の文字コードが ASCII-8BIT かそれ以外かで切り替えるのはどうでしょうか。> 成瀬さん
----------------------------------------
Feature #14352: Array#pack("M") Quoted-Printable with binary mode
https://bugs.ruby-lang.org/issues/14352#change-69555
* Author: kirika (Toshio Maki)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
英語で書こうと思ったのですが、うまく伝えられないかもしれないので日本語で書かせてください。すみません。
mail libraryというgemを使ってメールをパースしたり、書きだしたりしているのですが、
Quoted-Printableでエンコードされたバイナリがメールに含まれていた場合に、メールを破壊する
可能性があるということが分かりました。
調査してみると、RubyのArray#Pack("M")を使ったときに、以下のように
\nは=0Dに変換してくれるのですが、\rは=0Aではなく、そのまま\rで維持するのが問題のようで、
mail libraryはパース前の処理に\rを\r\nに変換するという処理を加えるのですが、その時に\rが
\r\nに変換され、オリジナルのバイナリを破壊してしまうことが分かりました。
<pre>
puts ["あいうえお\r\nかきくけこ"].pack('M')
</pre>
実行結果
<pre>
=E3=81=82=E3=81=84=E3=81=86=E3=81=88=E3=81=8A=0D
=E3=81=8B=E3=81=8D=E3=81=8F=E3=81=91=E3=81=93=
</pre>
Quoted-Printableにおいては、レイアウトのための改行は=\r\nにする、ということが決まっているので、
このように\nが単独で残るということはないような気がするのですが、昨年末にまつもとさんにご質問
させていただいた際にPerlの実装を参考にした、ということを伺ったので、Perlについても調べて
みたのですが、Perlは$binmodeというフラグで、バイナリ時の挙動と分けているようです。
http://perldoc.perl.org/MIME/QuotedPrint.html
(もしかすると、参考にした実装とは関係ないかもしれません)
今からpack('M')の挙動を変えると、影響範囲が大きそうなので、バイナリをQuoted-Printableでエンコード
するためのオプションがあれば、いいと思うのですが、packにどういうオプション名をつければよいか、
またpack.cのqpencode関数にbinmode用の拡張しても良いかを含めてご相談させてください。
出来れば今使っているrubyのバージョンは2.3とかだったりするので、2.3.x, 2.4.xにバックポート可能かどうかも
含めて相談させてもらえれば、と思います。
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>