Crash removing Format

Richard Kimberly Heck rikiheck at lyx.org
Mon Jul 6 00:14:27 UTC 2020


On 7/5/20 8:12 PM, Richard Kimberly Heck wrote:
> On 6/24/20 11:06 AM, Richard Kimberly Heck wrote:
>> On 6/24/20 6:19 AM, Kornel Benko wrote:
>>> Am Tue, 23 Jun 2020 22:01:03 -0400
>>> schrieb Scott Kostyshak <skostysh at lyx.org>:
>>>
>>>> On Mon, Jun 22, 2020 at 04:55:50PM +0200, Kornel Benko wrote:
>>>>> Am Mon, 22 Jun 2020 10:24:17 -0400
>>>>> schrieb Richard Kimberly Heck <rikiheck at lyx.org>:
>>>>>   
>>>>>> On 6/22/20 10:03 AM, Kornel Benko wrote:  
>>>>>>> Following lead to crash:
>>>>>>>
>>>>>>> 	1. Create new file-Format (for instance Epub, define a viewer)
>>>>>>> 	2. define conversion for docbook-xls -> Epub
>>>>>>> 	3. restart lyx
>>>>>>> 	4. remove the new conversion
>>>>>>> 	5. remove the format Epub --> crash
>>>>>>>
>>>>>>> There is no crash if
>>>>>>> 	5. restart lyx
>>>>>>> 	6. remove the format Epub    
>>>>>> I can't reproduce.  
>>>>> You probably need to recompile with "-D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_DEBUG"
>>>>>   
>>>>>> Can you post your preferences file as it exists after
>>>>>> (3)?  
>>>>>   
>>>>>> Do you save or apply after (4) or go right to step (5)?  
>>>>> Apply only. But with save it is the same.  
>>>> I can reproduce. In addition I get the following:
>>>>
>>>>   Error: attempt to subscript container with out-of-bounds index 21973, but 
>>>>   container only holds 99 elements.
>>>>
>>>> Scott
>>> Here the message is:
>>> /usr/include/c++/8/debug/vector:417:
>>> Error: attempt to subscript container with out-of-bounds index 1899910496, 
>>> but container only holds 98 elements.
>>>
>>> Objects involved in the operation:
>>>     sequence "this" @ 0x0x555f98a58bc8 {
>>>       type = std::__debug::vector<lyx::Graph::Vertex, std::allocator<lyx::Graph::Vertex>
>>>> ; }
>>> Abort (core dumped)
>>>
>>> If using attached, I got no crash, but the list of indexes used while removing the format
>>> is scarifying.
>>>
>>>  $ wc errors
>>>  1014  5060 35805 errors
>>>
>>>  $ sort my_list | uniq
>>> Graph.cpp (145): VERT-INDEX == 0
>>> Graph.cpp (145): VERT-INDEX == 11
>>> Graph.cpp (145): VERT-INDEX == 21972
>>> Graph.cpp (145): VERT-INDEX == 24
>>> Graph.cpp (145): VERT-INDEX == 32
>>> Graph.cpp (145): VERT-INDEX == 32757
>>> Graph.cpp (145): VERT-INDEX == 33
>>> Graph.cpp (145): VERT-INDEX == 71
>>> Graph.cpp (145): VERT-INDEX == 79
>>> Graph.cpp (145): VERT-INDEX == 8
>>> Graph.cpp (145): VERT-INDEX == 80
>>> Graph.cpp (145): VERT-INDEX == 83
>>>
>>>  $ egrep 21972 my_list | wc
>>>     377    1885   13949
>>>
>>>  $ egrep 32757 my_list | wc
>>>     134     670    4958
>> I will have a look.
> I was able to reproduce with the cmake setting mentioned above, but now
> I can't again. I have not been able to reproduce without those settings,
> nor do I see the weird values. But something is obviously suspicious.
>
> When I did see the crash, it was coming from Converters::isReachable().
> You could try something like the attached, which could yield more
> information.

Sorry, changed wrong routine. Try this patch.

Riki


-------------- next part --------------
diff --git a/src/Converter.cpp b/src/Converter.cpp
index 3487f4b45e..dc4be69cc3 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -982,8 +982,11 @@ FormatList const Converters::getReachable(string const & from,
 
 bool Converters::isReachable(string const & from, string const & to)
 {
-	return G_.isReachable(theFormats().getNumber(from),
-			      theFormats().getNumber(to));
+	int const f = theFormats().getNumber(from);
+	int const t = theFormats().getNumber(to);
+	LYXERR0("From " << from << "==" << f << " to " << to << "==" << t);
+	LATTEST(t < 1000 && f < 1000);
+	return G_.isReachable(t, f);
 }
 
 


More information about the lyx-devel mailing list