Skip to content

Segmentation fault in irrad::getBackSurfaceIrradiances with bifacial modules #562

@tkelman

Description

@tkelman

Describe the bug
Originally noticed in a Matlab R2019b simulation (on both Windows and Linux), but managed to reproduce in pysam (latest 2.2.2 release, ubuntu 20.04) with a script similar to #558.

To Reproduce
Steps to reproduce the behavior:
python crash.py
crash.zip

Expected behavior
Successful run or descriptive error message, not a segmentation fault.

Desktop (please complete the following information):

  • OS: ubuntu 20.04
  • Version 2.2.2

Additional context
Backtrace from gdb --args python crash.py (the build from pip wheel doesn't look like it has detailed debuginfo included)

(gdb) r
Starting program: /home/tkelman/code/envs/pysam-latest/bin/python crash.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2.2.2

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff579c5a9 in irrad::getBackSurfaceIrradiances(double, double, double, double, double, double, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >&, double&) ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libssc.so
(gdb) bt
#0  0x00007ffff579c5a9 in irrad::getBackSurfaceIrradiances(double, double, double, double, double, double, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >&, double&) ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libssc.so
#1  0x00007ffff579e88f in irrad::calc_rear_side(double, double, double) ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libssc.so
#2  0x00007ffff50b9c5d in cm_pvsamv1::exec() ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libssc.so
#3  0x00007ffff52bb2b3 in compute_module::compute(handler_interface*, var_table*) ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libssc.so
#4  0x00007ffff52daf47 in ssc_module_exec_with_handler ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libssc.so
#5  0x00007ffff6393630 in SAM_module_exec ()
   from /home/tkelman/code/envs/pysam-latest/lib/python3.8/site-packages/PySAM/libSAM_api.so
#6  0x00007ffff741c507 in Pvsamv1_execute (self=0x7ffff77f4a20, args=<optimized out>) at modules/Pvsamv1.c:14251
#7  0x00000000005f305a in PyCFunction_Call ()
#8  0x00000000005f3446 in _PyObject_MakeTpCall ()
#9  0x000000000056f600 in _PyEval_EvalFrameDefault ()
#10 0x000000000056822a in _PyEval_EvalCodeWithName ()
#11 0x000000000068c1e7 in PyEval_EvalCode ()
#12 0x000000000067d5a1 in ?? ()
#13 0x000000000067d61f in ?? ()
#14 0x000000000067d6db in PyRun_FileExFlags ()
#15 0x000000000067da6e in PyRun_SimpleFileExFlags ()
#16 0x00000000006b6132 in Py_RunMain ()
#17 0x00000000006b64bd in Py_BytesMain ()
#18 0x00007ffff7deb0b3 in __libc_start_main (main=0x4eec80 <main>, argc=2, argv=0x7fffffffdca8, init=<optimized out>,
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdc98) at ../csu/libc-start.c:308
#19 0x00000000005f927e in _start ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    pvphotovoltaic, pvsam, pvwatts

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions