roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Upgrade gem wicked_pdf to version higher than 2.1.0 when that is released

Open nicolasfranck opened this issue 4 years ago • 2 comments

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

3.0.1

Problem:

The current locked version of wicked_pdf (2.1.0) causes an infinite loop in some cases. The rails servers starts, but when you try to access any webpage of it, it enters and infinite loop, which eventually leads to a SystemStackError.

See:

  • https://github.com/mileszs/wicked_pdf/issues/823
  • https://github.com/mileszs/wicked_pdf/issues/810
  • https://github.com/mileszs/wicked_pdf/issues/845

I noticed this when adding the gem rails_admin to my Gemfile

I do not know why it does not happen in other cases, but apparently the latest master code seems to work.

Try changing this in the Gemfile

gem "wicked_pdf", git: "https://github.com/mileszs/wicked_pdf"

So in the next official version of wicked_pdf this should be resolved..

Steps to reproduce:

  • add for example rails_admin to the Gemfile
  • run `bundle install``
  • run bin/rails server
  • go to http://localhost:3000 in the web browser

nicolasfranck avatar Jan 27 '21 10:01 nicolasfranck

In a more recent version of roadmap (3.0.5 and 3.0.6) I get a even more weirdier error, this time a full ruby crash report (only part shown):

[73311] * Listening on http://0.0.0.0:3000
[73311] ! WARNING: Detected 1 Thread(s) started in app boot:
[73311] ! #<Thread:0x00007f88ec12a4b8@/Users/njfranck/git/roadmap-ugent/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:299 sleep> - /Users/njfranck/git/roadmap-ugent/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.6.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:301:in `sleep'
[73311] Use Ctrl-C to stop
[73311] - Worker 0 (PID: 73335) booted in 0.01s, phase: 0
[73311] - Worker 1 (PID: 73336) booted in 0.01s, phase: 0
/Users/njfranck/git/roadmap-ugent/vendor/bundle/ruby/2.6.0/gems/railties-5.2.6.2/lib/rails/railtie.rb:190: [BUG] vm_call_cfunc: cfp consistency error (0x000000010fbd7e08, 0x000000010fbd7d60)
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

...

After some digging around, I found out that again this outdated version of wicked_pdf is the culprit. So if you found a crash report that is telling you something about vm_call_cfunc: cfp consistency error, this is probably the cause. It removed the problem in my case. Again, I use rails_admin as an extra dependency. Without that this problem does not emerge if you use the outdated gem (from 2020).

nicolasfranck avatar Feb 28 '22 13:02 nicolasfranck

Thanks for reporting this @nicolasfranck

briri avatar Feb 28 '22 16:02 briri