<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Segmentation fault in FcFontMatch when attempting to render emoji"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107531">107531</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segmentation fault in FcFontMatch when attempting to render emoji
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>fontconfig
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>fc-match
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>fontconfig-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>krotov@iitp.ru
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>freedesktop@behdad.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=141016" name="attach_141016" title="A program to reproduce segmentation fault">attachment 141016</a> <a href="attachment.cgi?id=141016&action=edit" title="A program to reproduce segmentation fault">[details]</a></span>
A program to reproduce segmentation fault

dwm, dmenu and st (from <a href="https://suckless.org/">https://suckless.org/</a>) are known to segfault when
trying to render emoji.

I have reduced dmenu segfault down to a simple program that reproduces the bug.

To reproduce, compile the program attached with

gcc bug.c -lX11 -lXft -I /usr/include/freetype2 -lfontconfig

and run.

Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7821e71 in ?? () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
(gdb) bt
#0  0x00007ffff7821e71 in ?? () from
/usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#1  0x00007ffff7821fc8 in ?? () from
/usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#2  0x00007ffff7823028 in FcConfigSubstituteWithPat () from
/usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#3  0x00007ffff78329dd in FcFontRenderPrepare () from
/usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#4  0x00007ffff7832fc4 in FcFontMatch () from
/usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#5  0x000055555555531c in main ()

Software versions:

$ cat /etc/debian_version
buster/sid

$ apt show fontconfig
Package: fontconfig
Version: 2.13.0-5</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>