https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112011-06-22T13:38:40ZRuby Issue Tracking SystemRuby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=181392011-06-22T13:38:40Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Assignee</strong> set to <i>MartinBosslet (Martin Bosslet)</i></li></ul><p>openssl-0.9.7 does not have ASN1_put_eoc. Martin, can you handle this?</p>
<p>Dropping 0.9.7 support could be an option if there're other missing functions hardly replace. Users?</p> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=181442011-06-22T17:49:41ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul></ul><p>Sure! I would put it in openssl_missing.c ?<br>
I'll find out whether there is more than ASN1_put_eoc missing in 0.9.7.</p>
<p>Regards,<br>
Martin</p> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=181452011-06-22T17:50:34ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=181982011-06-24T04:09:00ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul><li><strong>Assignee</strong> changed from <i>MartinBosslet (Martin Bosslet)</i> to <i>nahi (Hiroshi Nakamura)</i></li></ul><p>The missing ASN1_put_eoc is not the only problem with OpenSSL 0.9.7, unfortunately. ASN1_put_object and ASN1_object_size behave differently in >= 0.9.8 regarding the length parameter being passed to them when dealing with infinite length values.</p>
<p>What we could do is implement a wrapper in ext/openssl doing the right thing based on what OpenSSL version is available. If dropping 0.9.7 support is not an option I don't know whether the wrapper solution would be worth the effort (and additional #if-bracketed code) or if it wouldn't be easier to implement both functions in ext/openssl entirely (we would need to add ASN1_put_eoc anyway).</p>
<p>Hiroshi, what do you think?</p>
<p>Regards,<br>
Martin</p> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=182052011-06-24T19:09:57Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Assignee</strong> changed from <i>nahi (Hiroshi Nakamura)</i> to <i>MartinBosslet (Martin Bosslet)</i></li></ul><p>Martin Bosslet wrote:</p>
<blockquote>
<p>The missing ASN1_put_eoc is not the only problem with OpenSSL 0.9.7, unfortunately. ASN1_put_object and<br>
ASN1_object_size behave differently in >= 0.9.8 regarding the length parameter being passed to them when<br>
dealing with infinite length values.</p>
</blockquote>
<p>Thanks for investigation. Hmm. I don't remember if there was such a case in ext/openssl development.</p>
<blockquote>
<p>What we could do is implement a wrapper in ext/openssl doing the right thing based on what OpenSSL version is<br>
available. If dropping 0.9.7 support is not an option I don't know whether the wrapper solution would be worth the<br>
effort (and additional #if-bracketed code) or if it wouldn't be easier to implement both functions in ext/openssl<br>
entirely (we would need to add ASN1_put_eoc anyway).</p>
</blockquote>
<p>It's an additional feature of ASN1 which is added for this version (1.9.3). So it's OK that only 0.9.8+ users can use the new feature but we should try to keep existed features for 0.9.7- users. Do you think you can enable new feature only if 0.9.8+ given? Or, implementing wrapper functions (OSSL_ASN1_put_object and OSSL_ASN1_object_size) is easier?</p>
<p>Regards,<br>
// NaHi</p> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=182082011-06-24T21:40:09ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul><li><strong>Assignee</strong> changed from <i>MartinBosslet (Martin Bosslet)</i> to <i>nahi (Hiroshi Nakamura)</i></li></ul><p>Hiroshi NAKAMURA wrote:</p>
<blockquote>
<p>Martin Bosslet wrote:</p>
<blockquote>
<p>The missing ASN1_put_eoc is not the only problem with OpenSSL 0.9.7, unfortunately. ASN1_put_object and<br>
ASN1_object_size behave differently in >= 0.9.8 regarding the length parameter being passed to them when<br>
dealing with infinite length values.</p>
</blockquote>
<p>Thanks for investigation. Hmm. I don't remember if there was such a case in ext/openssl development.</p>
</blockquote>
<p>Infinite length support has been introduced with 1.9.3, in 1.9.2 decoding infinite length values already<br>
worked, but they were re-encoded using a definite length value (cf. <a href="http://redmine.ruby-lang.org/issues/4030" class="external">http://redmine.ruby-lang.org/issues/4030</a>).</p>
<blockquote>
<p>It's an additional feature of ASN1 which is added for this version (1.9.3). So it's OK that only 0.9.8+ users can use the new feature but we should try to >keep existed features for 0.9.7- users. Do you think you can enable new feature only if 0.9.8+ given? Or, implementing wrapper functions (OSSL_ASN1_put_object >and OSSL_ASN1_object_size) is easier?</p>
</blockquote>
<p>Unfortunately I can't imagine a way to hide the feature from 0.9.7 users as the feature is triggered<br>
externally, i.e. if a user tries to decode some ASN.1 data that contains an infinite length value and<br>
decides to encode it again.<br>
So I'm afraid the wrapper solution is the only clean solution I can imagine right now. Should I give it<br>
a try, what do you think? I could come up with something and we could discuss and refine it then?</p> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=182312011-06-26T10:32:04ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r32230.<br>
Hiroshi, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>
<p>ext/openssl/extconf.rb</p>
</li>
<li>
<p>ext/openssl/ossl_missing.h/.c: add ASN1_put_eoc if missing.</p>
</li>
<li>
<p>ext/openssl/ossl_asn1.c: introduce ossl_asn1_object_size and<br>
ossl_asn1_put_object to wrap functionality depending on OpenSSL<br>
version in use.<br>
Fixes [ Ruby 1.9 - Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eoc (Closed)" href="https://redmine.ruby-lang.org/issues/4916">#4916</a> ] reported by Hiroshi Nakamura.<br>
<a href="/issues/4916">[ruby-core:37286]</a></p>
</li>
</ul> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=182322011-06-26T10:43:50ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul></ul><p>I added the wrapper solution in r32230 and tested it with OpenSSL 0.9.7m and 1.0.0d on Fedora 15 32bit.<br>
Fortunately it turns out to be much less overhead than I initially thought.</p>
<p>Could you please verify that it works for you, too?</p>
<p>Regards,<br>
Martin</p> Ruby master - Bug #4916: [BUG] Segmentation fault - dyld: lazy symbol binding failed: Symbol not found: _ASN1_put_eochttps://redmine.ruby-lang.org/issues/4916?journal_id=183222011-06-26T15:59:07Zko1 (Koichi Sasada)
<ul><li><strong>ruby -v</strong> changed from <i>ruby 1.9.3dev (2011-06-22 trunk 32194) [i386-darwin9.8.0]</i> to <i>-</i></li></ul><p>(2011/06/26 10:43), Martin Bosslet wrote:</p>
<blockquote>
<p>Could you please verify that it works for you, too?</p>
</blockquote>
<p>It works. Thanks!</p>
<p>--<br>
// SASADA Koichi at atdot dot net</p>