bugGNU TeXmacs - Bugs: bug #66768, Editing a "with" tag...

 
 

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

bug #66768: Editing a "with" tag which changes the language crashes the editor

Submitter:  Massimiliano Gubinelli <mgubi>
Submitted:  Sun 09 Feb 2025 12:29:35 PM UTC
   
 
Category:  Editor Priority:  5 - Normal
Item Group:  None Status:  Ready For Test
Privacy:  Public Assigned to:  lizabelos
Originator Name:  Open/Closed:  Open
Release:  None Release: 
Fixed Release:  None Fixed Release: 
Keywords: 

Tue 11 Feb 2025 05:51:09 PM UTC, comment #3: 

However note that even with the fix I propose in the previous comment, the warning will be reissued every time the function is invoked with the wrong argument. It might be annoying and time-consuming.

Not sure if this is important however. So we might want to ignore this.

Massimiliano Gubinelli <mgubi>
Group administrator
Tue 11 Feb 2025 05:48:34 PM UTC, comment #2: 

I looked at the fix in r14646 and I do not think it is complete (but I might be wrong). If I understand correctly how TeXmacs resources work, the current solution will not cache correctly the result. It might not be really important but each time the function is run a new verbatim language is created, while ideally one would like to cache it. Maybe a better fix is to return

return text_language("verbatim");



Massimiliano Gubinelli <mgubi>
Group administrator
Tue 11 Feb 2025 10:08:58 AM UTC, comment #1: 

It's a FAILED and I agree with Max that it should only be a warning. Without the FAILED, the code would already gracefully handle the unexpected language, treating it as verbatim, indeed.

AFAIU the backtrace shows it occurs while setting the footer relative to the inactive tag...

Philippe Joyez <pjoyez>
Group Member
Sun 09 Feb 2025 12:29:35 PM UTC, original submission:  

To reproduce, insert a "with" tag with arguments "language" and "XXX" (or anything else than a valid language), then try to write something in the third argument of the (inactive) with, at this point there is a crash due to

FAILED ("unknown language");

in text_language. On my Mac the relevant backtrace is:

Backtrace of C++ stack:
  1   texmacs.bin                         0x00000001016dba78 : get_crash_report(char const*) + 320
  2   texmacs.bin                         0x0000000100d6f1b4 : tm_throw(char const*) + 164
  3   texmacs.bin                         0x00000001016c6854 : text_language(string) + 3052
  4   texmacs.bin                         0x0000000101078adc : edit_typeset_rep::get_env_language() + 204
  5   texmacs.bin                         0x0000000100f9e9f4 : edit_interface_rep::compute_text_footer(tree) + 112
  6   texmacs.bin                         0x0000000100fa5314 : edit_interface_rep::set_right_footer() + 672
  7   texmacs.bin                         0x0000000100fa7850 : edit_interface_rep::set_footer() + 1412
  8   texmacs.bin                         0x0000000100fbf0ac : edit_interface_rep::update_menus() + 3960
  9   texmacs.bin                         0x0000000100fc01dc : edit_interface_rep::apply_changes() + 1952
  10  texmacs.bin                         0x00000001016e8dfc : tm_server_rep::interpose_handler() + 220

There are two aspects in this bug: the first is that the with is inactive, so this should really not happen and it is not clear to me with the LANGUAGE environment variable is wrong at this point. (I would be happy if somebody explains to me why this happens)

The second is that, anyway it should not fail, but possibly instantiate an "error" language, which should just alias to verbatim, and report the problem to the user in some way, e.g. with a warning.


Massimiliano Gubinelli <mgubi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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 lizabelos (Updated the item)
  • -email is unavailable- added by pjoyez (Posted a comment)
  • -email is unavailable- added by mgubi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-02-11 lizabelos StatusConfirmed Ready For Test
        Assigned toNone lizabelos

    Back to the top

    Powered by Savane 3.14-962f.
    Corresponding source code