lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] "Not enough room for even the first column" messagebox


From: Greg Chicares
Subject: [lmi] "Not enough room for even the first column" messagebox
Date: Thu, 2 May 2019 01:20:24 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Vadim--there's probably nothing you can do to help now with the
problem at hand, but perhaps you have some suggestions for logo
resizing and making messagebox text copyable, or maybe you can
point out some obvious mistake in my attempt to print element
zero of an array that I thought couldn't be empty.

The reason I was running the census described here:
  https://lists.nongnu.org/archive/html/lmi/2019-05/msg00002.html
is that the end user saw this messagebox:
  Not enough room for even the first column.
  [report_table.cpp : 132]
when trying to do
  Census | Print case to PDF

I checked to see whether I could reproduce the problem more
easily by doing
  Census | Run cell
  File | Print to PDF
but that produced a different messagebox:
  Assertion 'height <= get_total_height() - y' failed.
  [pdf_writer_wx.cpp : 338]

Because it's so much faster to run this case with x86_64-*-gcc-8.x,
I added some debugging code and rebuilt. The second messagebox
turned out to be a dogs-in-orbit issue:

[install_msw.sh]
for z in company_logo.png group_quote_banner.png ;
  do cp --archive /opt/lmi/src/lmi/gwc/$z /opt/lmi/data/ ;
done

That recently-added command unconditionally copies public PNG
files, to prevent problems with a brand-new installation. It
would be better to install proprietary files if available,
though, because the 'company_logo.png' with Ugolyok and
Veterok is larger. But any random person who builds lmi from
the savannah site alone should get a working system; would it
be possible to resize that file dynamically if it is larger
than the maximum size implicit in our PDF generation?

The original problem isn't solved by copying proprietary PNG
files from a production release. Here's the code I added
(for both issues):

---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index 423a93eb..4b16577d 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -335,7 +335,16 @@ int pdf_writer_wx::output_html
             // When rendering, all the text should have fit on this page,
             // otherwise this is not the right overload to use -- call
             // paginate_html() and the generic overload above instead.
-            LMI_ASSERT(height <= get_total_height() - y);
+            if((get_total_height() - y) < height)
+                warning()
+                    << "assertion would fail: 'height <= get_total_height() - 
y'\n"
+                    << get_total_height() << " get_total_height()\n"
+                    << y << " y\n"
+                    << (get_total_height() - y) << " (get_total_height() - 
y)\n"
+                    << height << " height\n"
+                    << LMI_FLUSH
+                    ;
+//          LMI_ASSERT(height <= get_total_height() - y);
             break;
         case oe_only_measure:
             // It's fine if the output doesn't fit when measuring it, as this
diff --git a/report_table.cpp b/report_table.cpp
index 29e30ef4..018d99b1 100644
--- a/report_table.cpp
+++ b/report_table.cpp
@@ -129,7 +129,19 @@ std::vector<int> set_column_widths
 
     if(0 == n_columns_to_show)
         {
-        alarum() << "Not enough room for even the first column." << LMI_FLUSH;
+        warning()
+            << "BIG TROUBLE\n"
+            << max_table_width << " max_table_width\n"
+            << desired_margin << " desired_margin\n"
+            << minimum_margin << " minimum_margin\n"
+            << cardinality << " cardinality\n"
+            << all_columns[0].col_width() << " all_columns[0].col_width()\n"
+            << data_width << " data_width\n"
+//          << z << " z\n"
+            << LMI_FLUSH
+            ;
+        warning() << "Not enough room for even the first column." << LMI_FLUSH;
+alarum() << "EXIT NOW OR LMI CRASHES" << LMI_FLUSH;
         }
 
     // These two are boolean, but vector<bool> isn't a Container.
--------->8-------->8-------->8-------->8-------->8-------->8-------->8-------

I rebuilt with that patch, using 32-bit gcc-8.x, and tried this:
  Census | Run case
  File | Print to PDF
which is like the "Run case to PDF" command in the end-user report,
but omits creating a PDF file for each individual cell (the only
PDF will be for the composite of all cells). It crashed thus:

  Unhandled exception: page fault on read access to 0x00000018 in 32-bit code 
(0x00869292).

and I was surprised to see:

PE        400000-  4b8000       Dwarf           lmi_wx_shared
PE        6c0000- 77b2000       Dwarf           liblmi
PE       77c0000- a2ca000       Dwarf           skeleton

because i686 builds use SJLJ, and the 'file' command reports:

/opt/lmi/gcc_i686-w64-mingw32/build/ship/libgcc_s_sjlj-1.dll: PE32 executable 
(DLL) (console) Intel 80386, for MS Windows
/opt/lmi/gcc_i686-w64-mingw32/build/ship/lmi_wx_shared.exe: PE32 executable 
(GUI) Intel 80386, for MS Windows
/opt/lmi/gcc_i686-w64-mingw32/build/ship/liblmi.dll:        PE32 executable 
(DLL) (console) Intel 80386, for MS Windows
/opt/lmi/gcc_i686-w64-mingw32/build/ship/skeleton.dll:      PE32 executable 
(DLL) (GUI) Intel 80386, for MS Windows

but maybe that's just an artifact of the wine crash dump.

Anyway, I rebuilt with x86_86 instead, and it still crashed.
I don't yet know why, and maybe it's because I hadn't yet added
  +alarum() << "EXIT NOW OR LMI CRASHES" << LMI_FLUSH;
to the patch above. I.e., I had suppressed the original code
that threw an exception at that point, hoping that execution
might continue and give me a flawed PDF that I might fruitfully
study, but instead it crashed, thus:

/opt/lmi/src/lmi[0]$wine /opt/lmi/bin/lmi_wx_shared --ash_nazg 
--data_path=/opt/lmi/data &
[1] 3967
/opt/lmi/src/lmi[0]$wine: Unhandled page fault on read access to 0x00000020 at 
address 0x60f03c (thread 0149), starting debugger...
00df:fixme:dbghelp:elf_search_auxv can't find symbol in module
00df:fixme:dbghelp:elf_search_auxv can't find symbol in module
00df:fixme:dbghelp:elf_search_auxv can't find symbol in module
[...snip many more repeats of that same line...]
Unhandled exception: page fault on read access to 0x00000020 in 64-bit code 
(0x000000000060f03c).
00df:fixme:dbghelp:elf_search_auxv can't find symbol in module
00df:fixme:dbghelp:interpret_function_table_entry PUSH_MACHFRAME 6
Register dump:
 rip:000000000060f03c rsp:000000000032c500 rbp:0000000000000000 eflags:00010206 
(  R- --  I   - -P- )

It seems weird that it crashed without showing me any messagebox,
so I rebuilt with
  +alarum() << "EXIT NOW OR LMI CRASHES" << LMI_FLUSH;
as shown above, and it crashed again:
  Unhandled exception: page fault on read access to 0x00000020 in 64-bit code 
(0x000000000060f039).

Reasoning that the only thing in that patch that could crash is:
+            << all_columns[0].col_width() << " all_columns[0].col_width()\n"
I modified the patch as follows:

---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index 423a93eb..c438325b 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -335,6 +335,15 @@ int pdf_writer_wx::output_html
             // When rendering, all the text should have fit on this page,
             // otherwise this is not the right overload to use -- call
             // paginate_html() and the generic overload above instead.
+            if((get_total_height() - y) < height)
+                warning()
+                    << "assertion would fail: 'height <= get_total_height() - 
y'\n"
+                    << get_total_height() << " get_total_height()\n"
+                    << y << " y\n"
+                    << (get_total_height() - y) << " (get_total_height() - 
y)\n"
+                    << height << " height\n"
+                    << LMI_FLUSH
+                    ;
             LMI_ASSERT(height <= get_total_height() - y);
             break;
         case oe_only_measure:
diff --git a/report_table.cpp b/report_table.cpp
index 29e30ef4..4f137592 100644
--- a/report_table.cpp
+++ b/report_table.cpp
@@ -129,7 +129,19 @@ std::vector<int> set_column_widths
 
     if(0 == n_columns_to_show)
         {
-        alarum() << "Not enough room for even the first column." << LMI_FLUSH;
+        warning()
+            << "BIG TROUBLE\n"
+            << max_table_width << " max_table_width\n"
+            << desired_margin << " desired_margin\n"
+            << minimum_margin << " minimum_margin\n"
+            << cardinality << " cardinality\n"
+//          << all_columns[0].col_width() << " all_columns[0].col_width()\n"
+            << data_width << " data_width\n"
+//          << z << " z\n"
+            << LMI_FLUSH
+            ;
+        warning() << "Not enough room for even the first column." << LMI_FLUSH;
+alarum() << "EXIT NOW OR LMI CRASHES" << LMI_FLUSH;
         }
 
     // These two are boolean, but vector<bool> isn't a Container.
--------->8-------->8-------->8-------->8-------->8-------->8-------->8-------

and rebuilt with 64-bit gcc-8. This time I get:

  BIG TROUBLE
  576 max_table_width
  14 desired_margin
  3 minimum_margin
  0 cardinality
  0 data_width

so at least I can try to think of a way to print out more useful data.

If I can't figure it out myself (tomorrow), I'll purge all "personally
identifiable information" from the census and share it, or try to create
a minimal test case that fails similarly.

BTW, in msw I could copy the contents of a messagebox with Ctrl-C
or something, but that doesn't work in wine, so I have to transcribe
diagnostics manually. Fixing wine sounds hard; maybe the answer is
to print a copy of any messagebox's contents on the console.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]