bugGNU TeXmacs - Bugs: bug #49162, new page breaker causes SEGV with...


You are not allowed to post comments on this tracker with your current authentication level.

bug #49162: new page breaker causes SEGV with existing documents

Submitted by:  Karl Hegbloom <karlhegbloom>
Submitted on:  Fri 23 Sep 2016 04:57:55 AM UTC  
Category:  Typesetter Priority:  5 - Normal
Item Group:  Error Status:  Fixed
Privacy:  Public Assigned to:  Joris van der Hoeven <vdhoeven>
Originator Name:  Open/Closed:  Closed
Release:  1.99.5 (svn trunk r10588) Release:  None
Fixed Release:  1.99.12 Fixed Release: 

( Jump to the original submission)

Sat 19 Oct 2019 01:56:12 AM UTC, comment #7: 

I am closing this bug.

Please re-open it if you still have problems,
but please attach a file to reproduce the bug in that case.

Joris van der Hoeven <vdhoeven>
Project AdministratorIn charge of this item.
Thu 22 Jun 2017 08:16:04 PM UTC, comment #6: 

I corrected several bugs concerning the new page breaker.
Please tell me whether this bug is still open or whether I can close it.

Joris van der Hoeven <vdhoeven>
Project AdministratorIn charge of this item.
Sat 04 Mar 2017 02:59:00 PM UTC, comment #5: 

Does commit 10624 fix this issue?

Philippe Joyez <pjoyez>
Project Member
Sun 20 Nov 2016 01:26:39 PM UTC, comment #4: 

clarify title

Philippe Joyez <pjoyez>
Project Member
Sun 02 Oct 2016 06:56:05 PM UTC, comment #3: 

I confirm that unchecking the setting for whether to use the new page breaker causes it to be possible to open and edit the same document that crashes it when the new breaker is used.

Karl Hegbloom <karlhegbloom>
Fri 30 Sep 2016 05:06:58 PM UTC, comment #2: 

I found that when I change <associate|page-medium|paper> to <associate|page-medium|papyrus> inside a copy of the document that causes the crash, the newer svn build will open the document. When I switch it to paper, causing it to page-break for display, it crashes as before.

I discovered this when trying other older documents to see if any of the simpler ones will crash it. I found one that consists mostly of a nested itemized list, but a very long one that spans pages. When I opened it, it worked, but was in papyrus display mode. I switched to paper, and it instantly crashed TeXmacs with the same error. I then changed paper to papyrus in the first document, and it can be opened and edited now, but switching to paper causes the crash.

I will probably switch to the older build for a while. I've put a note on my "releases" pre-release builds' page on github about it with this information and a link to here.

Karl Hegbloom <karlhegbloom>
Fri 30 Sep 2016 04:44:24 PM UTC, comment #1: 

I have determined that svn 10438 will open the document. (Confirmed using texmacs_1.99.4-1-svn-10438-git-10448-5d08e11_amd64.deb from my github git-svn mirror "releases/" directory pre-release builds.)

When time permits, I promise to try and track this down and help fix it... but today I need to work on the document that made it crash!

With some error printouts inserted into the pager code above where the segv happens, I found that nr_pages is 0, and thus ny is 0, and so yy is a zero-length array, and so has a NULL pointer inside, and so yy[0]= 0 causes a segv in the inline operator [] for (TeXmacs own) array<T>.

For a blank document, nr_pages is 1 and ny is 1. The document that I opened is the only one I've found that makes it crash. I do not know what it was about it that caused it to crash. Today there is not time for further debugging. I must get on with the writing project using this older build. After the writing is done, I will get back to this unless yous fix it before then. It will be several weeks or even months from now!

I will preserve the document that caused the crash. I can not post it publicly at this time. If I get any time for it, I'll try and produce a test document that causes the crash...

... which is probably easier to find knowing that this older svn release opens it, but the later one doesn't. I would begin by looking up the stack trace and finding where the wrong thing got handed down causing the crash... but I don't understand the page breaker at all, and it's in flux... so I think this isn't my problem anyway.

I hope this helped.

Karl Hegbloom <karlhegbloom>
Fri 23 Sep 2016 04:57:55 AM UTC, original submission:  

When I open an older document which was finished being written in February, 2016--and I've been using svn trunk the entire time, updating regularly--TeXmacs crashes. The same thing happens when I build from my github "mirror" on my work branch and when I build from the svn trunk, which I did just to be sure. The crash backtrace here is from the svn trunk build.

I think it may be due to nr_pages = 0 here, causing ny = 0... and so what does that do where it constructs yy?

What's weird is that the document has over 150 pages, not 0.

I will preserve the document as is, and I can send it via direct email on request. It's a large legal document and I can't post it here. I have no way of knowing what it is about it that is causing this. Newer documents appear to work fine.

The diff to add the --gdb switch to the texmacs wrapper script is:

--- a/src/misc/scripts/texmacs.in
+++ b/src/misc/scripts/texmacs.in
@@ -35,4 +35,11 @@ PATH="$TEXMACS_BIN_PATH/bin:$PATH"

-exec texmacs.bin "$@" < /dev/null
+if [ "$1" = "--gdb" ]; then
+    shift
+    stty -tostop
+    exec gdb -s /usr/lib/debug$TEXMACS_BIN_PATH/bin/texmacs.bin \
+         -args $TEXMACS_BIN_PATH/bin/texmacs.bin "$@"
+    exec texmacs.bin "$@" < /dev/null

So now I can start it with it running under gdb. I used the debian build that's in svn trunk, except that I had to re-run ./configure adding the --enable-debug option, then re-run debian/rules binary; also, I've got the pkg-create-dbgsym package installed, and I have:

export DEB_BUILD_OPTIONS=parallel=8 nostrip

So it builds a texmacs-dbgsym package also, which you see gdb loading, below.

 % texmacs --gdb 2016-02-18_104906439_Petition_for_Writ_of_Error_Coram_Nobis.tm
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/texmacs/TeXmacs/bin/texmacs.bin...Reading symbols from /usr/lib/debug//usr/lib/texmacs/TeXmacs/bin/texmacs.bin...done.
(gdb) run
Starting program: /usr/lib/texmacs/TeXmacs/bin/texmacs.bin 2016-02-18_104906439_Petition_for_Writ_of_Error_Coram_Nobis.tm
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Gtk-Message: Failed to load module "/home/karlheg/gail"
Gtk-Message: Failed to load module "unity-gtk-moduleil"

    • (texmacs.bin:7009): WARNING **: (bridge.c:991):atk_bridge_adaptor_init: runtime check failed: (root)

[New Thread 0x7fffbd577700 (LWP 7019)]
[New Thread 0x7fff77fff700 (LWP 7020)]
[New Thread 0x7fff2ffff700 (LWP 7021)]
[New Thread 0x7ffee7fff700 (LWP 7023)]
[Thread 0x7fff2ffff700 (LWP 7021) exited]
running my-init-texmacs
TeXmacs] With linked TrueType support
[New Thread 0x7fff2ffff700 (LWP 7084)]
TeXmacs] missing 'calligraphic' master
TeXmacs] warning, missing font, loading global substitution list
[Thread 0x7ffee7fff700 (LWP 7023) exited]

Thread 1 "texmacs.bin" received signal SIGSEGV, Segmentation fault.
0x0000000000b98537 in pager_rep::make_pages (this=0x8fbad28) at ./Typeset/Page/pager.cpp:291
291   yy[0]= 0;
(gdb) where full
#0  0x0000000000b98537 in pager_rep::make_pages() (this=0x8fbad28) at ./Typeset/Page/pager.cpp:291
        nr_pages = 0
        nx = 1
        d = 0
        ny = 0
        pixel = 756
        pg = {rep = 0x8f8a5e0}
        xx = {rep = 0x8fa8f80}
        yy = {rep = 0x94a03a8}
        x = {rep = 0x7fffffffc350}
        y = {rep = 0x7fffffffc3c0}
#1  0x0000000000e2504d in typesetter_rep::typeset() (this=0x34f51a8) at ./Typeset/Bridge/typesetter.cpp:169
        st = {rep = 0x2f457f0}
        i = 1
        n = 566
        ppp = 0x8fbad28
        rb = {rep = 0xffffc730}
#2  0x0000000000e253e4 in typesetter_rep::typeset(int&, int&, int&, int&) (this=0x34f51a8, x1b=@0x7fffffffcd80: 43499232, y1b=@0x7fffffffcd90: 21098928, x2b=@0x7fffffffcda0: 41165328, y2b=@0x7fffffffcdb0: 46576512) at ./Typeset/Bridge/typesetter.cpp:179
        b = {rep = 0xffffc730}
        r = {rep = 0x0}
        new_bgs = {rep = 0x0}
        rs = {rep = 0x2bf1768}
#3  0x0000000000e26c06 in typeset(typesetter_rep*, int&, int&, int&, int&) (ttt=0x34f51a8, x1=@0x7fffffffcd80: 43499232, y1=@0x7fffffffcd90: 21098928, x2=@0x7fffffffcda0: 41165328, y2=@0x7fffffffcdb0: 46576512) at ./Typeset/Bridge/typesetter.cpp:274
#4  0x000000000081f937 in edit_typeset_rep::typeset_sub(int&, int&, int&, int&) (this=this@entry=
    0x363f960, x1=@0x7fffffffcd80: 43499232, y1=@0x7fffffffcd90: 21098928, x2=@0x7fffffffcda0: 41165328, y2=@0x7fffffffcdb0: 46576512)
    at ./Edit/Editor/edit_typeset.cpp:797
#5  0x0000000000822d51 in edit_typeset_rep::typeset(int&, int&, int&, int&) (this=0x363f960, x1=@0x7fffffffcd80: 43499232, y1=@0x7fffffffcd90: 21098928, x2=@0x7fffffffcda0: 41165328, y2=@0x7fffffffcdb0: 46576512) at ./Edit/Editor/edit_typeset.cpp:853
        missing_nr = 2147483647
        redefined_nr = 2147483647
#6  0x0000000000789b74 in edit_interface_rep::apply_changes() (this=0x363f778) at ./Edit/Interface/edit_interface.cpp:648
        x1 = 43499232
        y1 = 21098928
        x2 = 41165328
        y2 = 46576512
        sb = <optimized out>
        wb = <optimized out>
#7  0x0000000000d8b2d1 in tm_server_rep::interpose_handler() (this=<optimized out>) at ./Texmacs/Server/tm_server.cpp:157
        vw = <optimized out>
        buf = 0x34f5058
        i = 1
        j = 0
#8  0x0000000000c6b1b2 in qt_gui_rep::update() (this=0x1985700) at ./Plugins/Qt/qt_gui.cpp:776
        count_events = 1
        now = 4992
        delay = <optimized out>
#9  0x0000000000c6b360 in gui_start_loop() (this=<optimized out>) at ./Plugins/Qt/qt_gui.cpp:459
#10 0x0000000000c6b360 in gui_start_loop() () at ./Plugins/Qt/qt_gui.cpp:483
#11 0x0000000000d51e51 in TeXmacs_main(int, char**) (argc=2, argv=<optimized out>) at ./Texmacs/Texmacs/texmacs.cpp:434
        sv = {rep = 0x1985808}
        where = {rep = 0x1b362a0}
        i = <optimized out>
        flag = <optimized out>
        the_default_font = {rep = 0x178f860}
#12 0x00000036586669bf in invoke_main_func (body_data=0x7fffffffd8b0) at init.c:367
        closure = 0x7fffffffd8b0
#13 0x000000365863ddca in c_body (d=d@entry=0x7fffffffd850) at continuations.c:349
        data = 0x7fffffffd850
#14 0x00000036586a4a10 in scm_c_catch (tag=tag@entry=0x104, body=body@entry=0x365863ddc0 <c_body>, body_data=body_data@entry=0x7fffffffd850, handler=handler@entry=0x365863dde0 <c_handler>, handler_data=handler_data@entry=0x7fffffffd850, pre_unwind_handler=pre_unwind_handler@entry=0x36586a4ff0 <scm_handle_by_message_noexit>, pre_unwind_handler_data=0x0) at throw.c:203
        jbr =
          {buf = {{__jmpbuf = {233414067120, -8118987530126333125, 0, 233411596272, 21776592, 140735296232736, -8118987530120041669, 8124705867859913531}, __mask_was_saved = 0, __saved_mask = {__val = {0, 0, 0, 0, 0, 4278190080, 0, 0, 0, 6510615555426900570, 6510615555426900570, 0, 0, 2314885530818453536, 2314885530818453536, 0}}}}, throw_tag = 0x0, retval = 0xffffff00ffffff00}
        jmpbuf = 0x7fff7d56dd20
        answer = 0x404
        pre_unwind = {handler = 0x36586a4ff0 <scm_handle_by_message_noexit>, handler_data = 0x0, running = 0, lazy_catch_p = 0}
#15 0x000000365863e3a4 in scm_i_with_continuation_barrier (body=body@entry=0x365863ddc0 <c_body>, body_data=body_data@entry=0x7fffffffd850, handler=handler@entry=0x365863dde0 <c_handler>, handler_data=handler_data@entry=0x7fffffffd850, pre_unwind_handler=0x36586a4ff0 <scm_handle_by_message_noexit>, pre_unwind_handler_data=pre_unwind_handler_data@entry=0x0) at continuations.c:325
        stack_item = 233411173824
        thread = 0x14c48d0
        old_controot = 0x7fffbf034490
        old_contbase = 0x7fffffffd880
        old_lastframe = 0x0
        result = <optimized out>
#16 0x000000365863e480 in scm_c_with_continuation_barrier (func=func@entry=0x36586669a0 <invoke_main_func>, data=data@entry=0x7fffffffd8b0) at continuations.c:367
        c_data = {func = 0x36586669a0 <invoke_main_func>, data = 0x7fffffffd8b0, result = 0x36586669a0 <invoke_main_func>}
#17 0x00000036586a2d96 in scm_i_with_guile_and_parent (func=0x36586669a0 <invoke_main_func>, data=0x7fffffffd8b0, parent=<optimized out>) at threads.c:733
        res = <optimized out>
        really_entered = 1
        base_item = 0
#18 0x0000003658666b25 in scm_boot_guile (argc=<optimized out>, argv=argv@entry=0x7fffffffda18, main_func=main_func@entry=0xa38dc0 <new_call_back(void*, int, char**)>, closure=closure@entry=0x0) at init.c:350
        res = <optimized out>
        c = {main_func = 0xa38dc0 <new_call_back(void*, int, char**)>, closure = 0x0, argc = 2, argv = 0x7fffffffda18}
#19 0x0000000000a39180 in start_scheme(int, char**, void (*)(int, char**)) (argc=<optimized out>, argv=argv@entry=0x7fffffffda18, call_back=call_back@entry=0xd50ef0 <TeXmacs_main(int, char**)>) at ./Scheme/Guile/guile_tm.cpp:49
#20 0x0000000000436c49 in main(int, char**) (argc=2, argv=0x7fffffffda18) at ./Texmacs/Texmacs/texmacs.cpp:593

Karl Hegbloom <karlhegbloom>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by vdhoeven (Posted a comment)
  • -email is unavailable- added by pjoyez (Posted a comment)
  • -email is unavailable- added by karlhegbloom (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-10-19 vdhoeven StatusNone => Fixed
        Assigned toNone => vdhoeven
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 1.99.12
    2016-11-20 pjoyez SummaryOlder document causes SEGV in pager_rep::make_pages (this=0x8fbad28) at ./Typeset/Page/pager.cpp:291 => new page breaker causes SEGV with existing documents

    Back to the top

    Powered by Savane 3.5