# Stacktrace in prosqlite query

**URL:** <https://swi-prolog.discourse.group/t/stacktrace-in-prosqlite-query/4925>\
**Category:** Pack\
**Created:** [January 21, 2022, 7:24pm UTC](https://swi-prolog.discourse.group/t/stacktrace-in-prosqlite-query/4925 "2022-01-21T19:24:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdiestel](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/wdiestel/32/22_2.png) [@wdiestel](https://swi-prolog.discourse.group/u/wdiestel)\
**Post date:** [January 21, 2022, 7:24pm UTC](https://swi-prolog.discourse.group/t/stacktrace-in-prosqlite-query/4925/1 "2022-01-21T19:24:40Z")

</div>

Hello,

I’m not sure why I’m getting the below stacktrace - do you think it is an issue with prosqlite? The same code worked one month ago and I did not install updates meanwhile…?

How I could analyse (and fix) this issue in more detail?  
Thanks Wolfram.

```prolog
SWI-Prolog [thread 1 (main) at Fri Jan 21 19:17:11 2022]: received fatal signal 11 (segv)
C-stack trace labeled "crash":
sh: 1: addr2line: not found
  [0] /usr/lib/swipl/lib/x86_64-linux/libswipl.so.8(+0xb7d76) [0x7fd385844d76]
sh: 1: addr2line: not found
  [1] /usr/lib/swipl/lib/x86_64-linux/libswipl.so.8(+0xb7e1a) [0x7fd385844e1a]
sh: 1: addr2line: not found
  [2] /usr/lib/swipl/lib/x86_64-linux/libswipl.so.8(+0xb7f17) [0x7fd385844f17]
sh: 1: addr2line: not found
  [3] /lib/x86_64-linux-gnu/libc.so.6(+0x3bd60) [0x7fd385603d60]
sh: 1: addr2line: not found
  [4] /usr/share/swi-prolog/pack/prosqlite/lib/x86_64-linux/prosqlite.so(+0x2fa3) [0x7fd384fa7fa3]
sh: 1: addr2line: not found
  [5] /usr/lib/swipl/lib/x86_64-linux/libswipl.so.8(+0x277c0) [0x7fd3857b47c0]
sh: 1: addr2line: not found
  [6] /usr/lib/swipl/lib/x86_64-linux/libswipl.so.8(+0xfcfba) [0x7fd385889fba]
sh: 1: addr2line: not found
  [7] /usr/lib/swipl/lib/x86_64-linux/libswipl.so.8(+0xfce4b) [0x7fd385889e4b]
  [8] /usr/bin/swipl(+0x10b4) [0x562e62dc70b4]
sh: 1: addr2line: not found
  [9] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea) [0x7fd3855eed0a]
  [10] /usr/bin/swipl(+0x10fa) [0x562e62dc70fa]
Prolog stack:
  [146] prosqlite:c_sqlite_query/3 [PC=1 in supervisor]
  [143] system:<meta-call>/1 [PC=13 in clause -1]
  [142] system:once/1 [PC=3 in clause 1]
  [141] db_redaktantoj:editor_update/2 [PC=56 in clause 1]

```

---

<div class="post-metadata">

**Author:** ![wdiestel](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/wdiestel/32/22_2.png) [@wdiestel](https://swi-prolog.discourse.group/u/wdiestel)\
**Post date:** [January 21, 2022, 7:31pm UTC](https://swi-prolog.discourse.group/t/stacktrace-in-prosqlite-query/4925/2 "2022-01-21T19:31:48Z")

</div>

This could be related somehow to an update of Prolog-docker, maybe? I additionally installed binutils and now get a different stacktrace:

```prolog
SWI-Prolog [thread 1 (main) at Fri Jan 21 19:30:01 2022]: received fatal signal 11 (segv)
C-stack trace labeled "crash":
  [0] save_backtrace() at :? [0x7fc275cbfd76]
  [1] print_c_backtrace() at :? [0x7fc275cbfe1a]
  [2] sigCrashHandler() at :? [0x7fc275cbff17]
  [3] killpg() at ??:? [0x7fc275a7ed60]
  [4] get_query_string() at ??:? [0x7fc275422fa3]
  [5] PL_next_solution___LD.cold() at pl-wam.c:? [0x7fc275c2f7c0]
  [6] query_loop() at :? [0x7fc275d04fba]
  [7] prologToplevel() at :? [0x7fc275d04e4b]
  [8] /usr/bin/swipl(+0x10b4) [0x55ddcd5680b4]
  [9] __libc_start_main() at ??:? [0x7fc275a69d0a]
  [10] /usr/bin/swipl(+0x10fa) [0x55ddcd5680fa]
Prolog stack:
  [146] prosqlite:c_sqlite_query/3 [PC=1 in supervisor]
  [143] system:<meta-call>/1 [PC=13 in clause -1]
  [142] system:once/1 [PC=3 in clause 1]
  [141] db_redaktantoj:editor_update/2 [PC=56 in clause 1]

```

---

<div class="post-metadata">

**Author:** ![wdiestel](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/wdiestel/32/22_2.png) [@wdiestel](https://swi-prolog.discourse.group/u/wdiestel)\
**Post date:** [January 22, 2022, 11:48am UTC](https://swi-prolog.discourse.group/t/stacktrace-in-prosqlite-query/4925/3 "2022-01-22T11:48:52Z")

</div>

Seems it was caused by a missing file permission. This normally should not crash prosqlite somewhere midway, but the problem seems to be solved at least.
