<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 204: Crash when using PLPlot in MacOS Bundle</title><link href="https://sourceforge.net/p/plplot/bugs/204/" rel="alternate"/><link href="https://sourceforge.net/p/plplot/bugs/204/feed.atom" rel="self"/><id>https://sourceforge.net/p/plplot/bugs/204/</id><updated>2022-12-08T00:17:49.655000Z</updated><subtitle>Recent changes to 204: Crash when using PLPlot in MacOS Bundle</subtitle><entry><title>Crash when using PLPlot in MacOS Bundle</title><link href="https://sourceforge.net/p/plplot/bugs/204/" rel="alternate"/><published>2022-12-08T00:17:49.655000Z</published><updated>2022-12-08T00:17:49.655000Z</updated><author><name>Jeremy Nesbitt</name><uri>https://sourceforge.net/u/jeremy-nesbitt/</uri></author><id>https://sourceforge.netb168b7d7e86d2930ce49c30577d4a3f12d5ee004</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am working on a Fortran application that uses PLPlot to graph data on MacOS.  If I run the application from the terminal, everything works fine.  But when I create a MacOS bundle, the application crashes every time during the first call to plbox with a null pointer error (see crash log below).&lt;/p&gt;
&lt;p&gt;After some debugging, it seemslike the issue is that the call to register the cairo context is failing: &lt;br/&gt;
call pl_cmd(PLESC_DEVINIT, cairo_context).  &lt;/p&gt;
&lt;p&gt;If I remove this line from the application, it fails the same way whether I run it in terminal or as a MacOS bundle.&lt;/p&gt;
&lt;p&gt;As I understand the documentation, I need to make this call to get the "extcairo" driver to work, but I cannot find a way around this issue if I want to distribute an application as a MacOS bundle that uses PLPlot.  Any suggestions to deal with this would be appreciated.&lt;/p&gt;
&lt;p&gt;Crash Log&lt;br/&gt;
Process:               ZOA &lt;span&gt;[9389]&lt;/span&gt;&lt;br/&gt;
Path:                  /Users/USER/Library/Mobile Documents/com~apple~CloudDocs/*/ZOA&lt;br/&gt;
Identifier:            ZOA&lt;br/&gt;
Version:               ???&lt;br/&gt;
Code Type:             ARM-64 (Native)&lt;br/&gt;
Parent Process:        zsh &lt;span&gt;[611]&lt;/span&gt;&lt;br/&gt;
Responsible:           Terminal &lt;span&gt;[510]&lt;/span&gt;&lt;br/&gt;
User ID:               502&lt;/p&gt;
&lt;p&gt;Date/Time:             2022-12-07 15:59:40.5134 -0800&lt;br/&gt;
OS Version:            macOS 12.5.1 (21G83)&lt;br/&gt;
Report Version:        12&lt;br/&gt;
Anonymous UUID:        64AC6177-EDD0-B543-05D4-32CEDE8BFCA6&lt;/p&gt;
&lt;p&gt;Sleep/Wake UUID:       34BCD013-C8A1-4B12-A855-FBE312FF5D5E&lt;/p&gt;
&lt;p&gt;Time Awake Since Boot: 1000000 seconds&lt;br/&gt;
Time Since Wake:       1157 seconds&lt;/p&gt;
&lt;p&gt;System Integrity Protection: enabled&lt;/p&gt;
&lt;p&gt;Crashed Thread:        0  Dispatch queue: com.apple.main-thread&lt;/p&gt;
&lt;p&gt;Exception Type:        EXC_BAD_ACCESS (SIGSEGV)&lt;br/&gt;
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000004&lt;br/&gt;
Exception Codes:       0x0000000000000001, 0x0000000000000004&lt;br/&gt;
Exception Note:        EXC_CORPSE_NOTIFY&lt;/p&gt;
&lt;p&gt;VM Region Info: 0x4 is not in any region.  Bytes before following region: 105553518919676&lt;br/&gt;
      REGION TYPE                    START - END         &lt;span&gt;[ VSIZE]&lt;/span&gt; PRT/MAX SHRMOD  REGION DETAIL&lt;br/&gt;
      UNUSED SPACE AT START&lt;br/&gt;
---&amp;gt;&lt;br/&gt;
      MALLOC_NANO (reserved)   600018000000-600020000000 &lt;span&gt;[128.0M]&lt;/span&gt; rw-/rwx SM=NUL  ...(unallocated)&lt;/p&gt;
&lt;p&gt;Thread 0 Crashed::  Dispatch queue: com.apple.main-thread&lt;br/&gt;
0   libcairo.2.dylib                       0x10eaed3d0 cairo_set_source_rgba + 12&lt;br/&gt;
1   cairo.so                               0x11565f468 set_current_context + 104&lt;br/&gt;
2   cairo.so                               0x11565f468 set_current_context + 104&lt;br/&gt;
3   cairo.so                               0x11565f348 plD_line_cairo + 52&lt;br/&gt;
4   libplplot.17.0.0.dylib                 0x10ee0ae00 grline + 108&lt;br/&gt;
5   libplplot.17.0.0.dylib                 0x10ee0ad88 plP_line + 316&lt;br/&gt;
6   libplplot.17.0.0.dylib                 0x10ee2487c genlin + 72&lt;br/&gt;
7   libplplot.17.0.0.dylib                 0x10ee240ec plP_pllclp + 1084&lt;br/&gt;
8   libplplot.17.0.0.dylib                 0x10ee23b9c pllclp + 88&lt;br/&gt;
9   libplplot.17.0.0.dylib                 0x10ee23144 plP_draphy + 108&lt;br/&gt;
10  libplplot.17.0.0.dylib                 0x10edfe028 c_plaxes + 2940&lt;br/&gt;
11  libplplot.17.0.0.dylib                 0x10edfd4a0 c_plbox + 72&lt;br/&gt;
12  libplplotfortran.0.2.0.dylib           0x10ed86174 __plplot_double_MOD_plbox_impl + 372&lt;br/&gt;
13  ZOA                                    0x104b53ca0 __handlers_MOD_plot1 + 1888 (zzhandlers.f90:558)&lt;/p&gt;
&lt;p&gt;Line that triggered the crash:&lt;br/&gt;
call plbox('bclnst', 0.0_plflt, 0, 'bnstv', 0.0_plflt, 0)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>