I got a segmentation fault when I attempted to upload an image to my site on Heroku using Carrierwave with Rmagick.
This is part of the error log output:
ruby: jpc_dec.c:1072: jpc_dec_tiledecode: Assertion `dec->numcomps == 3' failed.
/app/.bundle/gems/ruby/1.9.1/gems/carrierwave-0.5.4/lib/carrierwave/processing/rmagick.rb:248: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
After investigation, the segmentation fault occurs because I attempted to upload a JPEG2000 file with a .jpg extension instead of the correct .jp2 extension.
Is this a bug with Rmagick?
More importantly, is it possible to prevent the users of my site from triggering this segmentation fault by sending an image with the wrong extension?
Thanks!
I doubt this will be its only error.
You could use another tool, like 'file' to verify the file format.
Also you should think about a way that makes it possible to recover if ruby crashes.
You could just run an extra process in the background. But you should make sure that
you have extra checks in place so that you can respond when someone tries to repeatedly crash your software. Otherwise you're an easy denial of service target.
Related
Background: I decided a couple days ago that I was going to update Facebook SDK to FBSDKCoreKit from Facebook-iOS-SDK v3.24. I updated my Podfile accordingly and installed all libraries fine. I then began updating some of the code to work with the updated SDK spec.
After working on it for a short amount of time, I changed my mind and decided to rollback to the old version. I made all necessary cocoapods changes and installs, discarded all local changes in Xcode, recompiled and ran. Everything worked fine... or so I thought.
The Problem: Now, when I try to run on my old iOS7 test device, I get an error whenever the app launches. Below is the exact console output:
2015-10-15 20:14:31.271 hiatus[184:6003] [Error]: Failed to run command eventually with
error: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be
completed. (Cocoa error 3840.)" (JSON text did not start with array or object
and option to allow fragments not set.) UserInfo=0x14d67d20 {NSDebugDescription=
JSON text did not start with array or object and option to allow fragments not set.}
After this error is displayed in the console, no Parse functionality works. Which means, in my case, that a user is unable to login. An empty error is displayed instead.
Everything works fine on iOS8, and iOS9 (simulators and real devices). I'm working with Parse v1.9. I've tried cleaning the project, resetting, etc, but without any success.
I've been able to track this down to a specific function within PFEventuallyQueue.m. It seems to occur within (void)_runCommandsWithRetriesCount:. I just have no way of knowing how to fix it.
This is a known issue with SDK v1.9.0 (https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/388). It has been fixed but not released yet (it will be part of the 1.9.1 release).
You have 3 options :
Use 1.8.5 until 1.9.1 is released.
Fix the bug yourself by making this change : https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/commit/edde3bfa8a4476ba460dddbef6f75772960e1718
Use the master branch of the git repository to get the latest commits. If you're using cocoapods you can do it by setting your pod like this : pod 'Parse', :git => 'https://github.com/ParsePlatform/Parse-SDK-iOS-OSX.git'
Now is available Parse 1.9.1 but I recommend using CocoaPods for any Framework: https://cocoapods.org/pods/Parse
I've been testing imagesquish for a while and I can't seem to have it working.
It works with node.js, forever, express and knox and basically does image processing on the fly.
I'm trying to call an image on a server, it resizes, crops or whatever and then uploads to s3.
I've had permission issues but after creating a new s3 bucket, it seems I made some progress but then, the image doesn't get uploaded and I can't get any error.
I managed to go through it's code and go all the way to exports.uploadImage that would call img.toBuffer but apparently it doesn't get called.
At the end, I get the error:
events.js:72
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at errnoException (net.js:904:11)
at Object.afterWrite (net.js:720:19)
error: Forever detected script exited with code: 8
error: Script restart attempt #1
I need some help on this. Does anybody have any idea?
Luis. Not sure if you're still interested in an answer to this. I'm the author of ImageSquish. From the information you provide, this sounds like img.toBuffer is failing which is usually because graphicsmagick is not installed. The latest version of ImageSquish checks for the existence of this library on startup (see https://github.com/dmcquay/imagesquish/blob/master/check.js).
You might also find it easier to try it out using docker (https://registry.hub.docker.com/u/dmcquay/imagesquish/) so you don't have to worry about installing anything.
If this doesn't resolve your problem, you can find me via irc on freenode #imagesquish.
while trying to archive for submission I am getting this warning, if I try to do the validation or distribution, they hang. I am using Xcode4.3.2
The msg below suggests: try reinstalling the bundle - how to do that?
I did not find any useful suggestion among the existing posts
2012-07-14 14:15:00.935 Validation[1884:f07] Could not load framework
at
“file://localhost/Applications/Xcode.app/Contents/Applications/Application%20Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/”
(err = Error Domain=NSCocoaErrorDomain Code=3587 "The bundle
“ITunesSoftwareService” couldn’t be loaded because it is damaged or
missing necessary resources."
(dlopen_preflight(/Applications/Xcode.app/Contents/Applications/Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/ITunesSoftwareService):
Library not loaded:
#rpath/ITunesConnectFoundation.framework/Versions/A/ITunesConnectFoundation
Referenced from:
/Applications/Xcode.app/Contents/Applications/Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/ITunesSoftwareService
Reason: image not found) UserInfo=0x400419fe0
{NSLocalizedFailureReason=The bundle is damaged or missing necessary
resources., NSLocalizedRecoverySuggestion=Try reinstalling the
bundle.,
NSFilePath=/Applications/Xcode.app/Contents/Applications/Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/ITunesSoftwareService,
NSDebugDescription=dlopen_preflight(/Applications/Xcode.app/Contents/Applications/Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/ITunesSoftwareService):
Library not loaded:
#rpath/ITunesConnectFoundation.framework/Versions/A/ITunesConnectFoundation
Referenced from:
/Applications/Xcode.app/Contents/Applications/Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/ITunesSoftwareService
Reason: image not found,
NSBundlePath=/Applications/Xcode.app/Contents/Applications/Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework,
NSLocalizedDescription=The bundle “ITunesSoftwareService” couldn’t be
loaded because it is damaged or missing necessary resources.})
warning: Application validation was skipped.
Looks like re-installing xcode (or upgrading it) fixes the problem. Still puzzled why did it happen. I have ignored the offer to upgrade postponing it until the submission is done for few days, maybe Apple changed some links as it refers to itunes bundle? Anyhow it works now.
I try to use gem rest client to access some simple REST service, I have installed the rest-client following these instructions, but when try to use the library, I get the following error no such file to load -- rest_client.
It seems that the library is not recognized.
Did anyone have similar problems with this library?
Make sure you add it to your Gemfile, bundle install, restart server, and if required, require 'rest_client' or whatever the file name is.
I'm trying to create a custom model to interface with a database that isn't supported navtively by Rails or through the OpenLink ODBC driver. For some reason, I'm getting the following error:
no such file to load -- odbc
I'm at a lost as to why this is occurring as the ruby-odbc gem is in the GEM_PATH and I have a small script that tests this to ensure that the connection works and it worked perfectly. Does Rails ignore the gem_path? Is there something else I need to configure? I checked the GEM_PATH in Rails by writing it out to the browser and it matches what I saw in a terminal window.
FYI: I'm using rvm to manage ruby and all of my gems. Not sure if this makes any difference, though it really shouldn't from what I can tell.
Does your Gemfile include something like the following
gem 'ruby-odbc'