After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 432387 - [PATCH] 0.128 build failure on FreeBSD/amd64.
[PATCH] 0.128 build failure on FreeBSD/amd64.
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
pre-1.0 betas
Other All
: Normal normal
: 1.0
Assigned To: Charles Kerr
Pan QA Team
: 435271 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-04-22 20:48 UTC by Jeremy Messenger
Modified: 2007-05-06 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This patch was created by Pav Lucistnik <pav@FreeBSD.org> to fix the build/runtime. (400 bytes, patch)
2007-04-22 20:49 UTC, Jeremy Messenger
none Details | Review
stacktrace with message ids (2.90 KB, text/plain)
2007-05-06 06:37 UTC, Bernd Tegge
  Details
stacktrace with message ids (2.90 KB, text/plain)
2007-05-06 06:42 UTC, Bernd Tegge
  Details

Description Jeremy Messenger 2007-04-22 20:48:36 UTC
Please describe the problem:
The 0.128 doesn't build on FreeBSD/amd64, same report over at http://tinyurl.com/2zp87g .. Pav Lucistnik <pav@FreeBSD.org> has helped and created the patch that will be attach in here. It works in the runtime.

gmake[4]: Entering directory 
`/pkg_comp/obj/pkgsrc/news/pan-devel/default/pan-0.128/pan/data'
if c++ -DHAVE_CONFIG_H -I. -I. -I../..  -I../.. -I/usr/pkg/include/gmime-2.0 
-I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/lib/glib-2.0/include   -pthread 
-I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/lib/glib-2.0/include   
-DPNG_NO_ASSEMBLER_CODE -I/usr/pkg/include -I/usr/include 
-I/usr/pkg/include/freetype2 -I/usr/X11R6/include  -O2 -I/usr/pkg/include 
-I/usr/include -I/usr/pkg/include/freetype2 -I/usr/X11R6/include -MT article.o 
-MD -MP -MF ".deps/article.Tpo" -c -o article.o article.cc; \
        then mv -f ".deps/article.Tpo" ".deps/article.Po"; else rm -f 
".deps/article.Tpo"; exit 1; fi
article.cc: In member function `void pan::Article::Part::set_message_id(const
   pan::Quark&, const pan::StringView&)':
article.cc:156: error: no matching function for call to `max(int&, unsigned int
   )'

Steps to reproduce:
1. Try to build 0.128 on FreeBSD/amd64.


Actual results:


Expected results:


Does this happen every time?
yes

Other information:
Comment 1 Jeremy Messenger 2007-04-22 20:49:37 UTC
Created attachment 86798 [details] [review]
This patch was created by Pav Lucistnik <pav@FreeBSD.org> to fix the build/runtime.
Comment 2 Charles Kerr 2007-04-22 22:18:30 UTC
Thanks for filing this ticket.

IMO the patch at http://lists.gnu.org/archive/html/pan-users/2007-04/msg00063.html would be better, in case the message-id length goes longer than CHAR_MAX.
Comment 3 Pav Lucistnik 2007-04-22 22:25:26 UTC
The patch from comment #2 makes the program segfault trying to allocate pentabytes of memory (obvious int overrun).
Comment 4 Jeremy Messenger 2007-04-22 22:29:16 UTC
I didn't use this patch, because in the next two reply, Rhialto said that it doesn't work in the runtime. Crashed due to memory (looks like overrun?).

http://lists.gnu.org/archive/html/pan-users/2007-04/msg00065.html

Pav has tried:

std::max (int(b), (int)minlen - UCHAR_MAX); = can't build
std::max (b, minlen - UCHAR_MAX); = crash
std::max (b, minlen - (size_t)UCHAR_MAX); = crash
std::max ((char)b, (char)(minlen - UCHAR_MAX)); = no crash, it works.
Comment 5 Charles Kerr 2007-04-23 02:42:09 UTC
You're right about that.

Actually, looking at this line, I must have been on crack
when I wrote it.   "key.str + 1 + UCHAR_MAX" is meaningless
no matter how it's cast.  ke should be "key.str + 1 + b"
unless that's still more than UCHAR_MAX away from the end,
in which case it should be "key.str + key.len - UCHAR_MAX".

How does this work for you:


--- /tmp/pan-0.128/pan/data/article.cc  2007-04-21 11:26:39.000000000 -0500
+++ article.cc  2007-04-22 21:31:17.000000000 -0500
@@ -153,7 +153,8 @@
 
   kc = &key.back();
   mc = &mid.back();
-  ke = key.str + 1 + std::max (int(b), (int)minlen - UCHAR_MAX);
+  ke = std::max (key.str + b + 1,
+                 key.str + key.len - UCHAR_MAX);
   while (kc>ke)
     if (*kc-- != *mc--) { ++kc; break; }
   const size_t e (&key.back() - kc);
Comment 6 Pav Lucistnik 2007-04-23 18:14:47 UTC
The patch from comment #5 works fine for me.
Comment 7 Charles Kerr 2007-04-24 00:12:19 UTC
Thanks for your quick feedback on this.

http://svn.gnome.org/viewcvs/pan2?view=revision&revision=247
Comment 8 Charles Kerr 2007-05-02 19:54:06 UTC
*** Bug 435271 has been marked as a duplicate of this bug. ***
Comment 9 Bernd Tegge 2007-05-06 06:37:39 UTC
Created attachment 87644 [details]
stacktrace with message ids
Comment 10 Bernd Tegge 2007-05-06 06:42:14 UTC
Created attachment 87645 [details]
stacktrace with message ids
Comment 11 Bernd Tegge 2007-05-06 06:46:34 UTC
I have patched my 0.128 with above fix but pan still segfaults while retrieving
headers.
Platform is Kubuntu Feisty i386.
Sorry for the duplicate attachments #9 and #10, my browser timed out on the first one, so i hit submit again.
Comment 12 Charles Kerr 2007-05-06 16:55:33 UTC
Bernd: yep.  There's a better fix in 0.129.