Missing Filament color config causes crash on startup #2858

pzl opened this Issue May 26, 2015 · 6 comments


None yet

4 participants

pzl commented May 26, 2015

Slic3r version: aa8b6af (bug introduced in this commit -- previous commits work fine).
wxWidgets version wxWidgets 3.0.2, Wx version 0.9927

Platform: Arch Linux

Steps to reproduce:

Method 1:

  1. Use a .Slic3r directory, and slic3r.ini from a previous installation of Slic3r before this commit
  2. Make sure 'expert' mode is enabled in slic3r.ini
  3. install version aa8b6af or 310212e
  4. Run slic3r.pl

Method 2:
(Backup your existing .Slic3r data directory somewhere else)

  1. Completely remove your .Slic3r directory
  2. install version aa8b6af or 310212e
  3. Run slic3r.pl
    • This should run successfully, and ask setup questions about your machine. Defaults are fine, or click cancel
  4. Enable Expert Mode, and exit.
  5. Run slic3r.pl again


Program immediately stops/crashes (no GUI ever shows), and gives the output:
Can't call method "config" on an undefined value at /usr/share/perl5/vendor_perl/Slic3r/GUI/Tab.pm line 407.

From what I can gather, at some point during filament config loading, the second parameter given to get_preset_config, that is, preset is null or empty, and the program crashes.

The resulting slic3r.ini from the second method is pasted below, which should trigger the behavior:

# generated by Slic3r 1.2.8-dev on Tue May 26 13:19:04 2015
autocenter = 1
background_processing = 1
main_frame_maximized = 
main_frame_pos = 6,26
main_frame_size = 1341,509
mode = expert
version = 1.2.8-dev
version_check = 1

filament = 
print = 
printer =

And yes, it's commit aa8b6af that causes this behavior. Reverting the commit clears the symptoms.


I think what needs to happen is we need a clean way to assume some kind of default (or leave it blank and notify the user).
I had a small patch that simply returned undef in MainFrame and Tab.pm , but that causes other problems, as everything would need to be able to understand if it got handed an undefined value. I was able to get the UI to load and saved a color to the filament. I haven't seen any other new options that would be causing a crash.

And my slic3r.ini has the presets configured.

alexrj commented May 27, 2015

I think this is not actually related to the color option. Slic3r handles new options gracefully (we add them all the time). This is probably a Linux-specific issue related to #2613. I can't reproduce it so far :(


It's possible, although reverting the commit that added color filaments also unbroke things. So something related to that commit seems to be the culprit. My experimentation indicates that an undefined variable ($preset) is being passed to the get_preset_config subroutine. I don't know from where.


I got a close, but not quite the same error:
Can't call method "filament_colour" on an undefined value at /Users/mikenew/Projects/third-party/Slic3r/lib/Slic3r/GUI/Plater.pm line 449.

I noticed that under the filament directory in settings I had a file called
PLA (white) (Michael’s MacBook Pro's conflicted copy 2015-05-27).ini (I have my settings folder symlinked to Dropbox). Shortening the name to PLA (white) (conflicted).ini fixed it. I assume it's the ' in the filename that caused the problem.

Worth noting I'm on OS X 10.10, not Linux. Commit 0d08c18

alexrj commented May 28, 2015

Yes @mikenew12, I think it's the ’ and this is not actually related to the Linux issue.

@alexrj alexrj pushed a commit that closed this issue Jun 1, 2015
@darenschwenke darenschwenke Fixes #2858 23119e3
@alexrj alexrj closed this in 23119e3 Jun 1, 2015
@born2b born2b added a commit to born2b/Slic3r that referenced this issue Jun 10, 2015
@darenschwenke @born2b darenschwenke + born2b Fixes #2858 c0aa510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment