From: chrahunt@... Date: 2014-05-10T04:26:08+00:00 Subject: [ruby-core:62494] [ruby-trunk - Bug #9823] Segmentation fault using DL Issue #9823 has been updated by Christopher Hunt. Sorry, please find the gist here with the required files: https://gist.github.com/chrahunt/89bd596fdb8485556c64. ---------------------------------------- Bug #9823: Segmentation fault using DL https://bugs.ruby-lang.org/issues/9823#change-46656 * Author: Christopher Hunt * Status: Feedback * Priority: Normal * Assignee: Aaron Patterson * Category: ext * Target version: * ruby -v: ruby 1.9.3p545 (2014-02-24) [i386-mingw32] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- I receive a segmentation fault when calling OpenProcessToken from DL, demonstrated by running the attached 'runner.rb' file with the additional files in the same directory. This is a simplified representation, but perhaps not minimal, though with good reason. Doing any one of the following prevents a segmentation fault: Copying line 3 from runner.rb to the bottom of mwe.rb and running mwe.rb directly. Commenting out line 5 of mwe.rb or commenting out some large subset of errors.rb (e.g. commenting out lines 37 through 99 result in no segfault). Commenting out line 3 of runner.rb, in effect only requiring the other files and exiting. Commenting out a combination of the following from within Pageant::Win results in no segfault: - Calls to extern - Calls to struct - Constants - Class methods In the last case it is not necessary to comment out all of the items of a particular category. For instance, a segfault is avoided if I comment out TOKEN_USER and SECURITY_ATTRIBUTES. I may also prevent a segfault by commenting out TOKEN_USER and the extern statement associated with IsValidSecurityDescriptor. I have also tried this in the latest (ruby 2.1.2p95 (2014-05-08 revision 45867) [i386-mingw32]) with similar results. I've attached the error output for each of 1.9.3 and 2.1.2. ---Files-------------------------------- runner.rb (68 Bytes) -- https://bugs.ruby-lang.org/