Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemStackError -Logging error with require 'dicom' + include DICOM #73

Open
vas1468 opened this issue Jun 4, 2018 · 6 comments
Open

Comments

@vas1468
Copy link

vas1468 commented Jun 4, 2018

That's the only log I am getting.

SystemStackError (stack level too deep): dicom (0.9.6) lib/dicom/general/logging.rb:148

Ruby 1.9.3
dicom 0.9.6
Ubuntu 16.04.3

@dicom
Copy link
Owner

dicom commented Jun 4, 2018

I've never seen this behaviour before. Quite strange. Are you able to try with a more recent version of Ruby?

Regards,
Chris

@vijendra
Copy link

vijendra commented Jun 9, 2018

Even I am getting this error, though not sure if it is ruby-dicom error. Rails 4.0.9 application using ruby-dicom was working fine. Recently added code to upload the files to AWS-S3 and started getting this error.
Here is the trace from console.

Loading production environment (Rails 4.0.9)
2.2.9 :001 > s3 = Aws::S3::Resource.new
SystemStackError: stack level too deep
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger' from /usr/local/rvm/gems/ruby-2.2.9/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in logger'
... 10030 levels...
from /usr/local/rvm/rubies/ruby-2.2.9/lib/ruby/2.2.0/set.rb:283:in each' from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-core-3.14.0/lib/seahorse/client/configuration.rb:189:in resolve'
from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-core-3.14.0/lib/seahorse/client/configuration.rb:177:in apply_defaults' from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-core-3.14.0/lib/seahorse/client/configuration.rb:150:in build!'
from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-core-3.14.0/lib/seahorse/client/base.rb:62:in build_config' from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-core-3.14.0/lib/seahorse/client/base.rb:19:in initialize'
from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-s3-1.8.0/lib/aws-sdk-s3/client.rb:197:in initialize' from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-core-3.14.0/lib/seahorse/client/base.rb:99:in new'
from /usr/local/rvm/gems/ruby-2.2.9/gems/aws-sdk-s3-1.8.0/lib/aws-sdk-s3/resource.rb:14:in initialize' from (irb):1:in new'
from (irb):1
from /usr/local/rvm/gems/ruby-2.2.9/gems/railties-4.0.9/lib/rails/commands/console.rb:90:in start' from /usr/local/rvm/gems/ruby-2.2.9/gems/railties-4.0.9/lib/rails/commands/console.rb:9:in start'
from /usr/local/rvm/gems/ruby-2.2.9/gems/railties-4.0.9/lib/rails/commands.rb:62:in <top (required)>' from bin/rails:4:in require'
from bin/rails:4:in `

'

@raulperezalejo
Copy link

raulperezalejo commented Dec 17, 2018

I am having this same issue, currently working on a Rake task to send a DICOM file to a server

ruby 2.3.1
rails 5.0.0
ruby-dicom 0.9.8

UPDATE:

Including include DICOM::Logging remove the error

@dicom
Copy link
Owner

dicom commented Dec 18, 2018

What is your Operating system, Raul?

And can you also paste your exception trace?

@raulperezalejo
Copy link

i am using ubuntu 16.04

/home/raul/.rvm/gems/ruby-2.3.1/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in `logger'
.
.
.
/home/raul/.rvm/gems/ruby-2.3.1/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in `logger'
/home/raul/.rvm/gems/ruby-2.3.1/gems/dicom-0.9.8/lib/dicom/general/logging.rb:148:in `logger'
/home/raul/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.1/lib/action_controller/railtie.rb:39:in `block in <class:Railtie>'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `instance_exec'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `run'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:44:in `each'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:54:in `run_initializers'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/application.rb:352:in `initialize!'
/home/raul/work/ingsw/my-fertility-ror-backend/config/environment.rb:5:in `<top (required)>'
/home/raul/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/home/raul/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
/home/raul/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
/home/raul/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/application.rb:328:in `require_environment!'
/home/raul/.rvm/gems/ruby-2.3.1/gems/railties-5.0.1/lib/rails/application.rb:448:in `block in run_tasks_blocks'
/home/raul/.rvm/gems/ruby-2.3.1/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/raul/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/home/raul/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => dicom:send_file_to_server => environment
(See full trace by running task with --trace)

the problem occurs here:

    def logger
      self.class.logger
    end

self.class return an ActiveSupport::OrderedOptions and when asking for the logger method it gets a #<SystemStackError: stack level too deep>

in rails console i get this:

2.3.1 :001 > ActiveSupport::OrderedOptions.logger
NoMethodError: undefined method `logger' for ActiveSupport::OrderedOptions:Class

@dicom
Copy link
Owner

dicom commented Dec 19, 2018

I wonder if this is related to Rails 4.

My own project is still on Rails 3, so that may be why I havent experienced this issue.

I am actually planning to upgrade Rails on my project soon, so I will probably encounter it and (hopefully) fix it soonish.

That being said, please feel free to submit a fix yourself, if you are able to. That would definitely be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants