community/pipermail-archives/sup-talk/2012-06.txt (5171B) - raw
1 From helgedt@tihlde.org Thu Jun 21 20:26:19 2012
2 From: helgedt@tihlde.org (Helge Titlestad)
3 Date: Thu, 21 Jun 2012 22:26:19 +0200
4 Subject: [sup-talk] [PATCH] detect and set charset on text/* attachments
5 Message-ID: <1340310366-sup-4562@tihlde.org>
6
7 I got some feedback from non-suppers that my utf-8 text attachments were
8 messed up. When I checked they (the MIME headers) lacked any info on charset,
9 which I believe should be set for text/*.
10
11 Here's a patch that uses the chardet gem to (try to) detect the appropriate charset
12 and sets it in the Content-Type header.
13
14 From eg@gaute.vetsj.com Fri Jun 22 08:48:41 2012
15 From: eg@gaute.vetsj.com (Gaute Hope)
16 Date: Fri, 22 Jun 2012 10:48:41 +0200
17 Subject: [sup-talk] [PATCH] detect and set charset on text/* attachments
18 In-Reply-To: <1340310366-sup-4562@tihlde.org>
19 References: <1340310366-sup-4562@tihlde.org>
20 Message-ID: <1340354870-sup-6182@qwerzila>
21
22 Hi,
23
24 Would be interested; but where's the patch ? ;)
25
26 - Gaute
27
28 Excerpts from Helge Titlestad's message of 2012-06-21 22:26:19 +0200:
29 > I got some feedback from non-suppers that my utf-8 text attachments were
30 > messed up. When I checked they (the MIME headers) lacked any info on charset,
31 > which I believe should be set for text/*.
32 >
33 > Here's a patch that uses the chardet gem to (try to) detect the appropriate charset
34 > and sets it in the Content-Type header.
35
36 From helgedt@tihlde.org Fri Jun 22 10:29:21 2012
37 From: helgedt@tihlde.org (Helge Titlestad)
38 Date: Fri, 22 Jun 2012 12:29:21 +0200
39 Subject: [sup-talk] [PATCH] detect and set charset on text/* attachments
40 In-Reply-To: <1340354870-sup-6182@qwerzila>
41 References: <1340310366-sup-4562@tihlde.org> <1340354870-sup-6182@qwerzila>
42 Message-ID: <1340360491-sup-9159@tihlde.org>
43
44 Excerpts from Gaute Hope's message of Fri Jun 22 10:48:41 +0200 2012:
45 > Would be interested; but where's the patch ? ;)
46
47 Hah, sorry guys. Someone tried to send an email from my sup last night[1],
48 and managed to re-send this oooold mail instead. I think the utf-8 stuff
49 was fixed a long time ago. (=
50
51 --
52 alge
53 [1]: Yeah, alcohol was involved.
54
55 From kljohann@gmail.com Sun Jun 24 12:00:39 2012
56 From: kljohann@gmail.com (=?UTF-8?Q?Johann_Kl=C3=A4hn?=)
57 Date: Sun, 24 Jun 2012 14:00:39 +0200
58 Subject: [sup-talk] [sup-devel] [heliotrope] crashes while importing
59 In-Reply-To: <CAE+8KM0SqqLfGKnTTAw6TDRdb0eTBftJdueBghGxnoXE+wN3hg@mail.gmail.com>
60 References: <20120301151701.23555.84803@localhost> <1330985181-sup-8598@typhon>
61 <CAE+8KM0gu1UD=gGXfiEwmceW82AxF02Y+=Y-AZTW3SR5hToXZg@mail.gmail.com>
62 <CAE+8KM3BeubqLWAZFYOYjEiVUYpQT3vhwhaf37r1BzVECngbJA@mail.gmail.com>
63 <1334932275-turnsole-49140@terminus-est>
64 <CAE+8KM0SqqLfGKnTTAw6TDRdb0eTBftJdueBghGxnoXE+wN3hg@mail.gmail.com>
65 Message-ID: <CAE+8KM1J_Q-N+2Sopq7Ta0nebk85MfK9DzxnerKHgpLz68-Rzg@mail.gmail.com>
66
67 I just tried this again and the source of this problem does not seem
68 to be memcpy vs memmove but that Append tries to copy data to
69 unallocated memory.
70 Note below that limit_ points to a string "wp/labels". This may
71 indicate a stack overflow, I guess (Though I'm not too proficient in
72 debugging C++).
73
74 My test machine is running x86_64 (intel), ruby 1.9.3p194 and
75 leveldb-ruby built from git HEAD.
76
77 Program received signal SIGBUS, Bus error.
78 0x00007ffff7753ceb in __memcpy_ssse3_back () from /lib/libc.so.6
79 (gdb) bt
80 #0 0x00007ffff7753ceb in __memcpy_ssse3_back () from /lib/libc.so.6
81 #1 0x00007ffff3777181 in leveldb::(anonymous
82 namespace)::PosixMmapFile::Append (this=0x107d760, data=...) at
83 util/env_posix.cc:227
84 #2 0x00007ffff3757cbc in leveldb::log::Writer::EmitPhysicalRecord
85 (this=0x1009af0, t=leveldb::log::kFullType,
86 ptr=0x10065d8 "\264\n", n=150) at db/log_writer.cc:93
87 #3 0x00007ffff3757a9a in leveldb::log::Writer::AddRecord
88 (this=0x1009af0, slice=...) at db/log_writer.cc:67
89 #4 0x00007ffff374980e in leveldb::DBImpl::Write (this=0x107aa40,
90 options=..., my_batch=0x7fffffffdb00) at db/db_impl.cc:1140
91 #5 0x00007ffff374a90a in leveldb::DB::Put (this=0x107aa40, opt=...,
92 key=..., value=...) at db/db_impl.cc:1369
93 #6 0x00007ffff3749573 in leveldb::DBImpl::Put (this=0x107aa40, o=...,
94 key=..., val=...) at db/db_impl.cc:1103
95
96 (gdb) up
97 #1 0x00007ffff3777181 in leveldb::(anonymous
98 namespace)::PosixMmapFile::Append (this=0x107d760, data=...) at
99 util/env_posix.cc:227
100 227 memcpy(dst_, src, n);
101
102 (gdb) print dst_
103 $34 = 0x7ffff7e69fb5 ""
104
105 (gdb) print n
106 $11 = 150
107
108 (gdb) print dst_ + (n-1)
109 $1 = 0x7ffff7e6a04a <Address 0x7ffff7e6a04a out of bounds>
110 (gdb) print dst_ + (n-2)
111 $2 = 0x7ffff7e6a049 <Address 0x7ffff7e6a049 out of bounds>
112
113 (gdb) print dst_ + 80
114 $16 = 0x7ffff7e6a005 <Address 0x7ffff7e6a005 out of bounds>
115 (gdb) print dst_ + 74
116 $22 = 0x7ffff7e69fff ""
117 (gdb) print dst_ + 75
118 $23 = 0x7ffff7e6a000 <Address 0x7ffff7e6a000 out of bounds>
119
120 (gdb) print limit_
121 $24 = 0x7ffff7e78000 "wp/labels"
122 (gdb) print limit_ + 1
123 $25 = 0x7ffff7e78001 "p/labels"
124 (gdb) print limit_ - 1
125 $26 = 0x7ffff7e77fff <Address 0x7ffff7e77fff out of bounds>
126
127 (gdb) print map_size_
128 $28 = 65536
129 (gdb) print page_size_
130 $29 = 4096
131 (gdb) print base_
132 $30 = 0x7ffff7e68000 "\247T\210\024\036"
133 (gdb) print last_sync_
134 $31 = 0x7ffff7e68000 "\247T\210\024\036"
135 (gdb) print file_offset_
136 $32 = 0
137