comparison Sphinx/source/faq/debugging.rst @ 244:26b0d7ece4af

debugging
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 13 May 2019 15:29:09 +0200
parents
children b742e44113d4
comparison
equal deleted inserted replaced
243:57ecb27d1851 244:26b0d7ece4af
1 .. _debugging:
2
3 Debugging Orthanc
4 =================
5
6 If you experience an error within Orthanc (or one of its plugins), that
7 the troubleshooting sections (cf. :ref:`here <troubleshooting>` and
8 :ref:`here <dicom>`) do not help, and that you can't provide a robust
9 way to reproduce your issue by third-party developers, you'll have to
10 analyze the backtrace of Orthanc.
11
12 If you observe a **fatal crash** of Orthanc, where Orthanc stops
13 abruptly (e.g. by creating a so-called "core dumped" or reporting an
14 invalid memory access), which rarely occurs, please check the
15 :ref:`dedicated section <crash>`). The present FAQ entry is rather
16 about C++ exceptions that are thrown by Orthanc, typically as a
17 consequence of invalid inputs, and that result in an error message
18 reported by Orthanc (not in a crash), and for which the :ref:`log
19 files in verbose mode <log>` do not provide meaningful information.
20
21 **Important reminder:** Most issues with Orthanc can be solved by
22 carefully looking at the :ref:`Orthanc logs <log>` in ``--verbose``
23 mode!
24
25
26 Any system
27 ----------
28
29 First :ref:`compile Orthanc by yourself <compiling>`, in debug mode by
30 setting ``-DCMAKE_BUILD_TYPE=Debug`` when invoking CMake.
31
32 Then, learn how to use the debugger that is best suited to your
33 platform (e.g. Microsoft Visual Studio, gdb or Xcode).
34
35
36 GNU/Linux system using gdb
37 --------------------------
38
39 .. highlight:: bash
40
41 The Orthanc project provides precompiled debug binaries that can be
42 run on almost any recent GNU/Linux system (generated thanks to the
43 `LSB - Linux Standard Base SDK
44 <https://en.wikipedia.org/wiki/Linux_Standard_Base>`__). This allows
45 to debug Orthanc without compiling from sources. Here is a sample
46 debug session::
47
48 $ wget http://lsb.orthanc-server.com/orthanc/debug/1.5.6/Orthanc
49 $ chmod +x ./Orthanc
50 $ gdb ./Orthanc Configuration.json
51 (gdb) catch throw
52 Catchpoint 1 (throw)
53 (gdb) run
54 W0513 15:24:42.374349 main.cpp:1436] Orthanc version: 1.5.6
55 ---> Reproduce your error case <---
56 Thread 15 "Orthanc" hit Catchpoint 1 (exception thrown), 0x00007ffff6de68bd in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
57 (gdb) backtrace
58 #0 0x00007ffff6de68bd in __cxa_throw ()
59 from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
60 ...
61
62 If you are unable to analyze such a backtrace by yourself, feel free
63 to post your ``core`` file on the `Orthanc forum
64 <https://groups.google.com/forum/#!forum/orthanc-users>`__.
65
66 **Important:** The Orthanc developers will only be able to analyze the
67 ``core`` files generated by our own precompiled binaries!
68
69 **Plugins:** Besides the Orthanc core, debug binaries of the official
70 plugins precompiled using the LSB are also available at the following
71 locations:
72
73 * `Orthanc core <http://lsb.orthanc-server.com/orthanc/debug/>`__
74 * `DICOMweb plugin <http://lsb.orthanc-server.com/plugin-dicom-web/debug/>`__
75 * `MySQL plugin <http://lsb.orthanc-server.com/plugin-mysql/debug/>`__
76 * `Orthanc Web viewer <http://lsb.orthanc-server.com/plugin-webviewer/debug/>`__
77 * `PostgreSQL plugin <http://lsb.orthanc-server.com/plugin-postgresql/debug/>`__
78 * `Transfers accelerator plugin <http://lsb.orthanc-server.com/plugin-transfers/debug/>`__
79 * `Whole-slide imaging <http://lsb.orthanc-server.com/whole-slide-imaging/debug/>`__
80
81
82 Docker
83 ------
84
85 To be written.