Opened 10 years ago

Closed 10 years ago

#99 closed defect (fixed)

matreshka segfaults during objects finalization

Reported by: alexander.basov Owned by: vadim.godunko
Priority: major Milestone: 0.1.0
Component: Matreshka - XML Processor Version: 0.0.6
Keywords: Cc:


Here is backtrace:

gdb ./uim 
staGNU gdb (GDB) 7.1 for GNAT GPL 2010 (20100603) [rev=gdb-7.1-ref-90-g6d5b58a]
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
See your support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty for this version of GDB.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /mnt/work/programming/projects/uim/uim...done.
(gdb) start
Temporary breakpoint 1 at 0x414043: file /mnt/work/programming/projects/uim/source/ui/main.adb, line 47.
Starting program: /mnt/work/programming/projects/uim/uim 
warning: no loadable sections found in added symbol-file /usr/lib64/debug/lib64/
b exceo[Thread debugging using libthread_db enabled]
Temporary breakpoint 1, main () at /mnt/work/programming/projects/uim/source/ui/main.adb:47
47         UIM.Protocols.Drivers.Initialize;
(gdb) b exception
Catchpoint 2: all Ada exceptions
(gdb) c

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5ec601a in matreshka.internals.atomics.counters.decrement (self=0x0)
    at /mnt/work/programming/projects/matreshka/source/league/matreshka-internals-atomics-counters__gcc.adb:73
73            return Sync_Sub_And_Fetch_32 (Self.Value'Access, 1) = 0;
(gdb) bt
#0  0x00007ffff5ec601a in matreshka.internals.atomics.counters.decrement (self=0x0)
    at /mnt/work/programming/projects/matreshka/source/league/matreshka-internals-atomics-counters__gcc.adb:73
#1  matreshka.internals.strings.dereference (self=0x0) at /mnt/work/programming/projects/matreshka/source/league/matreshka-internals-strings.adb:210
#2  0x00007ffff5c0cce3 in xml.sax.simple_readers.scanner.finalize (self=...)
    at /mnt/work/programming/projects/matreshka/source/xml/xml/xml-sax-simple_readers-scanner.adb:100
#3  0x00007ffff5c3b7a9 in xml.sax.simple_readers.finalize (self=...) at /mnt/work/programming/projects/matreshka/source/xml/xml-sax-simple_readers.adb:155
#4  0x00007ffff5196b8b in system.finalization_implementation.finalize_list () from /opt/gnat/lib/gcc/x86_64-pc-linux-gnu/4.3.6/adalib/
#5  0x00007ffff5196b8b in system.finalization_implementation.finalize_list () from /opt/gnat/lib/gcc/x86_64-pc-linux-gnu/4.3.6/adalib/
#6  0x00007ffff5196d71 in system.finalization_implementation.finalize_one () from /opt/gnat/lib/gcc/x86_64-pc-linux-gnu/4.3.6/adalib/
#7  0x00007ffff5052945 in ada.finalization.list_controller.finalize () from /opt/gnat/lib/gcc/x86_64-pc-linux-gnu/4.3.6/adalib/
#8  0x00007ffff5196b8b in system.finalization_implementation.finalize_list () from /opt/gnat/lib/gcc/x86_64-pc-linux-gnu/4.3.6/adalib/
#9  0x00007ffff54a489c in system.tasking.stages.finalize_global_tasks () from /opt/gnat/lib/gcc/x86_64-pc-linux-gnu/4.3.6/adalib/
#10 0x0000000000414fdb in main (argc=1, argv=(system.address) 0x7fffffffd668, envp=(system.address) 0x7fffffffd678) at b__main.adb:1029
#11 0x00007ffff421fe8c in __libc_start_main () from /lib/
#12 0x0000000000413f69 in _start ()

Change History (3)

comment:1 by vadim.godunko, 10 years ago

Component: MatreshkaMatreshka - XML
Milestone: 0.1.0
Owner: set to vadim.godunko
Status: newassigned
Version: 0.0.6

comment:2 by vadim.godunko, 10 years ago

In [1604]:

Initialize object to store data by empty string, instead by null to
prevent crash of finalization of unused object.

Add automated test.

Refs #99.

comment:3 by vadim.godunko, 10 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.