Project

General

Profile

Feature #2720

Segfault during multiple calls to C embedded Ruby wrapped with dl library

Added by marchaland (David MARCHALAND) over 9 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
[ruby-core:28096]

Description

=begin
Hi Ruby developpers,

I embedded a Ruby interpreter into a C application through a shared library. This application can call more than one time Ruby interpreter during its execution. In attached testcase that illustrates my issue, this is done through a for loop : first call works as expected but next calls returns [BUG] Segmentation fault and also that some constants are already defined.

What I suppose is that calling ruby_cleanup(0) and close shared library (dlclose) is not sufficient to properly clean application memory from Ruby execution stack.

Thanks for your consideration,
David
=end


Files

testcase.txt (2.17 KB) testcase.txt marchaland (David MARCHALAND), 02/08/2010 01:33 AM

Related issues

Is duplicate of Backport187 - Bug #2719: Segfault during multiple calls to C embedded Ruby interpreter through dlopenRejected02/07/2010Actions

History

#1

Updated by marchaland (David MARCHALAND) over 9 years ago

=begin
Well, I idenfitied that this bug is due to an unexpected behavior with dlclose().

My question is : why require 'fileutils' for instance do not allow dlclose() to close immediatly libruby.so and waits for end of program execution? Is there a way to unload libraries loaded by require?

Regards,
David
=end

#2

Updated by naruse (Yui NARUSE) over 9 years ago

  • Status changed from Open to Rejected

=begin

why require 'fileutils' for instance do not allow dlclose() to close immediatly libruby.so and waits for end of program execution?

That's because we don't need.

Is there a way to unload libraries loaded by require?

You can know loaded library files by get_loaded_features().
=end

Also available in: Atom PDF