pg.rb segmentation fault [Mojave upgrade]
As this issue is only occuring in the development environment, I made it conditional. This solution in puma.rb
works for me until the bug gets fixed.
workers ENV.fetch("WEB_CONCURRENCY") { 2 } unless Rails.env.development?
Segmentation Fault: 11 for small C program on macOS 10.14 Mojave
With this line
int arr[MAX - MIN];
... you are creating an array of 25 (122 - 97) integers. The valid array indices are 0 ... 24.First of all, since each array cell is dedicated to a lowercase letter, the array should have 26 cells.
Then, with this statement (and the next ones as well):
for (i = MIN; i <= MAX; i++) arr[i] = 0;
... you are writing into array cells arr[97]
to arr[122]
that do not exist, overwriting other parts of the program stack. That's why you get a segmentation fault. Why is static value getting corrupted inside IRB?
You can get this to work by ensuring Ruby keeps a reference to your objects and doesn’t try to GC (or compact) them. The simplest way is probably to use rb_global_variable
:
Notice:In your case it might look like this:GC
should know about global variables which refer to Ruby's objects, but are not exported to the Ruby world. You need to protect them byvoid rb_global_variable(VALUE *var)
void Init_utsname() {
init() ;
rb_global_variable(&machine);
rb_global_variable(&nodename);
rb_define_global_function("machine", getMachine, 0);
rb_define_global_function("nodename", getNodename, 0);
}
Error installing homebrew on MacOS 10.14 Beta Mojave
I believe the problem is that the Command Line Tools for Xcode 10 do not install headers in /usr/include, but the install script checks there:
https://github.com/Homebrew/install/blob/bbf4a3a8b247c7dba159c3d557cc3853dd764171/install#L110
Thankfully, the code that tries to run xcode-select --install
is bypassed if STDIN
is not a TTY. Try adding a 0<&-
after the install command to close STDIN
and skip this command. I just tried it and it worked for me.
As an aside, Homebrew does not officially support 10.14 yet, and the maintainers do not want you to file issues about any problems you find. (Pull requests seem welcome, though.) Unfortunately this means that the Homebrew issue tracker is not a place to discuss problems and solutions.
Related Topics
Pod Install in Xcode Bots Trigger
How to Use Reform to Prepopulate for Featured Objects
Ruby: Parse Excel 95-2003 Files
Are Rack-Based Web Servers Represent Fastcgi Protocol
Securely Display an Image Uploaded with Paperclip Gem
How to Deploy a Test App on Dreamhost Rails 3.0.4
How to Remove a Url's Trailing Slash in a Rails App? (In a Seo View)
Automatically Logging Exceptions in Ruby
Should I Move My Custom Methods to Model from Controller
Rails and JavaScript Minifier and Aggregator
Can't Get Paypal Encrypted Website Payments to Work in Rails
How to Access HTML Request Parameters for a .Rhtml Page Served by Webrick
Ruby - Generate All Two Letter Words
"Previous Post" and "Next Post" Link in Show View (Nested Resources)