This (rather trivial) shader crashes for me. Is it just me?

27 views
Skip to first unread message

Master Zap

unread,
Mar 6, 2020, 3:59:34 AM3/6/20
to OSL Developers
I'm on 1.10.7 currently, about to update.

// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
//
// MaterialX specification (c) 2017 Lucasfilm Ltd.

#include "mx_funcs.h"

shader mx_modulo_float_color
    [[ string help = "Color"" The remaining fraction after dividing the incoming \
                     float/color/vector by the constant amount and subtracting the integer portion.\
                     The modula amount cannot be 0." ]]
  (
    color in1 = 0,
    float in2 = 1.0,
    output color out = 0
  )
{
    out = fmod(in1, in2); 
}


/Z

Larry Gritz

unread,
Mar 6, 2020, 11:25:23 AM3/6/20
to OSL Developers List
"crashes for me"

Does it crash in oslc, while compiling? When loading in the renderer? While actually executing the shader? Does it only crash inside a full renderer or can you reproduce it with testshade? Is there any core dump or stack trace that might indicate where the crash is?

Did it work with 1.10.7 but not in the version you are trying to update to? What tag are you updating to?


--
Larry Gritz




Zap Andersson

unread,
Mar 6, 2020, 5:22:37 PM3/6/20
to osl...@googlegroups.com
Compiles fine. Doesn't execute.

Actually it seems to fail in testshade too....

d:\osscicd\workspace\osl-3dsmax-1_10_9\src\liboslexec\llvm_util.cpp:1087: class llvm::Value *__cdecl OSL_v1_10::pvt::LLVM_Util::call_function(class llvm::Value *,class llvm::Value **,int): Assertion 'func' failed.

/Z


--
You received this message because you are subscribed to the Google Groups "OSL Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osl-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osl-dev/13AC279E-94C1-45D4-AAEB-B1F07EEAB5B8%40larrygritz.com.


--
--
Håkan "Zap" Andersson - http://twitter.com/MasterZap - the man, the myth, the concept.
--

Zap Andersson

unread,
Mar 6, 2020, 5:23:44 PM3/6/20
to osl...@googlegroups.com
And "Couldn't find function osl_fmod_vvf"

/Z

On Fri, Mar 6, 2020 at 5:25 PM Larry Gritz <l...@larrygritz.com> wrote:
--
You received this message because you are subscribed to the Google Groups "OSL Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osl-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osl-dev/13AC279E-94C1-45D4-AAEB-B1F07EEAB5B8%40larrygritz.com.

Larry Gritz

unread,
Mar 6, 2020, 6:17:12 PM3/6/20
to OSL Developers List
AHA, now that's a clue!

Looking...


Larry Gritz

unread,
Mar 6, 2020, 6:47:35 PM3/6/20
to OSL Developers List
Ooh, yeah, definitely a problem. I will post a patch soon.


Larry Gritz

unread,
Mar 8, 2020, 2:24:05 PM3/8/20
to OSL Developers List
Forget what I said, I wasn't looking carefully. Now that I am, I'm unable to reproduce, and I see exactly where osl_fmod_vvf is defined, not sure how it can be missing.

Can you tell me the exact version (tag or commit) of OSL you are using, and the testshade command line arguments that make it crash?

-- lg
--
Larry Gritz




Master Zap

unread,
Mar 9, 2020, 4:02:35 AM3/9/20
to OSL Developers
Attaching the compiled OSO

Command line is trivial: 

testshade mx_modulo_float_color.oso -o foo.jpg

My OSL is as far as I can tell plain 1.10.7 (on Windows)

/Z
-- lg


To unsubscribe from this group and stop receiving emails from it, send an email to osl...@googlegroups.com.


--
--
Håkan "Zap" Andersson - http://twitter.com/MasterZap - the man, the myth, the concept.
--


--
Larry Gritz




mx_modulo_float_color.oso

Larry Gritz

unread,
Mar 21, 2020, 5:43:09 PM3/21/20
to OSL Developers List
Full fix is here: https://github.com/imageworks/OpenShadingLanguage/pull/1131

After approval, I will backport to the release branch as well.

-- lg


To unsubscribe from this group and stop receiving emails from it, send an email to osl-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osl-dev/7521343e-5cce-4751-98a9-b037006757fa%40googlegroups.com.
<mx_modulo_float_color.oso>

--
Larry Gritz




Reply all
Reply to author
Forward
0 new messages