Merge lp:~zeitgeist/zeitgeist/bluebird-sig-crash into lp:~zeitgeist/zeitgeist/bluebird
- bluebird-sig-crash
- Merge into bluebird
Status: | Rejected |
---|---|
Rejected by: | Siegfried Gevatter |
Proposed branch: | lp:~zeitgeist/zeitgeist/bluebird-sig-crash |
Merge into: | lp:~zeitgeist/zeitgeist/bluebird |
Diff against target: |
224 lines (+63/-21) 6 files modified
extensions/blacklist.vala (+13/-3) extensions/ds-registry.vala (+15/-2) extensions/storage-monitor.vala (+14/-6) src/datamodel.vala (+19/-9) src/errors.vala (+1/-0) src/sql.vala (+1/-1) |
To merge this branch: | bzr merge lp:~zeitgeist/zeitgeist/bluebird-sig-crash |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michal Hruby (community) | Needs Fixing | ||
Review via email: mp+74091@code.launchpad.net |
Commit message
Description of the change
So, how will we do this?
(Consider this merge proposal a cheap blueprint.)
- 226. By Siegfried Gevatter
-
Blacklist: implement D-Bus methods.
- 227. By Michal Hruby
-
Pass Engine instance to extensions
- 228. By Michal Hruby
-
Add Histogram extension
- 229. By Siegfried Gevatter
-
GetEvents: make sure event_ids[] isn't empty
- 230. By Michal Hruby
-
Fix more warnings
- 231. By Michal Hruby
-
Prettify make output
- 232. By Michal Hruby
-
Flow-analyse this Vala\!
- 233. By Michal Hruby
-
Remove debug on event insertion
- 234. By Seif Lotfy
-
added name_changed logic
- 235. By Seif Lotfy
-
set print for debugging the signal issue
- 236. By Siegfried Gevatter
-
Fix signal test cases so extensions are detected correctly.
- 237. By Seif Lotfy
-
Added destinction rules based on the old ZG
- 238. By Michal Hruby
-
Add a little bit of profiling
- 239. By Michal Hruby
-
Merge lp:~zeitgeist/zeitgeist/some-fixes branch with more fixes
- 240. By Michal Hruby
-
Fix up some issues with DSR
- 241. By Michal Hruby
-
Use find_custom instead of index, this will actually work with strings
- 242. By Michal Hruby
-
Hook up version info to config.h
- 243. By Seif Lotfy
-
remove fixed FIXMEs
- 244. By Seif Lotfy
-
replaced some asaasay with Utils.SIG_EVENT
- 245. By Seif Lotfy
-
removed unecessary fixme
- 246. By Seif Lotfy
-
removed unecessary fixme since the timestamp sanity is cecked upon converting the the event from variant to an Event object
- 247. By Michal Hruby
-
Fix payload marshalling (hopefully)
- 248. By Seif Lotfy
-
implement payload insertion
implement payload retrieval - 249. By Seif Lotfy
-
fix payload insertion by referfing to the dat in the byte array
added FIXME to check if extension is disabled - 250. By Seif Lotfy
-
merged with trunk
- 251. By Siegfried Gevatter
-
Make some code nicer.
- 252. By Michal Hruby
-
The nicer the better
- 253. By Siegfried Gevatter
-
Update extension base class docstring.
- 254. By Seif Lotfy
-
fixed critical error where timerange = null and we try to look for the start and end, this was due to the intersection returning null
- 255. By Seif Lotfy
-
removed redundant fixme -> this will be fixed in update_callback
- 256. By Siegfried Gevatter
-
Update TableLookup caches upon event deletion.
- 257. By Seif Lotfy
-
removed peers and made a hashtable with generic array
- 258. By Seif Lotfy
-
fix remove issue in notify.vala and replaced it with remove_index
- 259. By Seif Lotfy
-
move connections.lookup (peer) outside the loop
- 260. By Seif Lotfy
-
rename peerse to paths and use remove_index_fast instead of remove_index
- 261. By Seif Lotfy
-
added missing ;
- 262. By Seif Lotfy
-
prohibit the datamodel from assiging the current_uri if not set
- 263. By Siegfried Gevatter
-
testFindTwoOfTh
reeEvents: move event declarations to a new three_events.js - 264. By Siegfried Gevatter
-
engine.vala: add comment about subject templates being AND'ed
- 265. By Siegfried Gevatter
-
Add test cases for events with multiple subjects and FindEvents (re DISTINCT)
- 266. By Siegfried Gevatter
-
Add FIXME about --replace
- 267. By Siegfried Gevatter
-
exit -> Posix.exit
- 268. By Seif Lotfy
-
added new extensions_conf table for extensions to store their data into
- 269. By Siegfried Gevatter
-
Handle SIGINT properly.
- 270. By Seif Lotfy
-
remove faulty fixme notice
- 271. By Siegfried Gevatter
-
Avoid using event_view's subqueries in WHERE clauses.
- 272. By Siegfried Gevatter
-
Add actor_uri field to event_view.
- 273. By Siegfried Gevatter
-
Fix segmentation fault removing a blacklist that doesn't exist.
- 274. By Siegfried Gevatter
-
datamodel: style fixes
- 275. By Siegfried Gevatter
-
Add API enabling extensions to store their state in the database. Use it
for blacklist. - 276. By Siegfried Gevatter
-
- Remove Extension.get_name method, use get_type().name() instead.
- Document the store_config and retrieve_config functions. - 277. By Siegfried Gevatter
-
* DataSourceRegistry:
- implement saving to (and restoring from) database.
- fix use of dirty flag (backported to Zeitgeist) and some cleanup.
- register_data_source( ): require sender!=null
* Engine:
- Fix shutdown order (unload extensions, close DB, destroy engine). - 278. By Siegfried Gevatter
-
Start implementing storage monitor extension.
- 279. By Seif Lotfy
-
add missing ';'
- 280. By Seif Lotfy
-
added temp fts solution
NEEDS FIXING - 281. By Seif Lotfy
-
some more fixes
- 282. By Siegfried Gevatter
-
Add missing symlink and stuff.
- 283. By Michal Hruby
-
Workaround a Vala bug
- 284. By Michal Hruby
-
Fix the unique name
- 285. By Michal Hruby
-
And also fix the interface name
- 286. By Seif Lotfy
-
added print for search
- 287. By Michal Hruby
-
Fix the marshalling mess
- 288. By Michal Hruby
-
Catch ExtensionStore error
- 289. By Michal Hruby
-
A few small fixes
- 290. By Michal Hruby
-
Merge in the standalone fts indexer
- 291. By Michal Hruby
-
Damned typo
- 292. By Michal Hruby
-
Let fts write into bluebird directory
- 293. By Michal Hruby
-
Added missing file
- 294. By Seif Lotfy
-
use children of interpretations while generating queries
- 295. By Michal Hruby
-
Don't overuse Variants if we can just use a struct
- 296. By Seif Lotfy
-
fixed mutliple symbol negation with children
- 297. By Michal Hruby
-
Finish up command line options
- 298. By Michal Hruby
-
Throw exception all the way up to Engine
- 299. By Michal Hruby
-
Get rid of useless warning
- 300. By Michal Hruby
-
Let's require latest Vala
- 301. By Michal Hruby
-
Fix FTS handling
- 302. By Michal Hruby
-
Added copyright
- 303. By Siegfried Gevatter
-
Change copyright line to the format used everywhere else.
- 304. By Michal Hruby
-
Add one more test
- 305. By Michal Hruby
-
Speed up marshalling! Now 3% faster!
- 306. By Michal Hruby
-
Little fixes
- 307. By Seif Lotfy
-
fix double negation problem
- 308. By Michal Hruby
-
Make the bus name owning more robust
- 309. By Siegfried Gevatter
-
Change error acquiring name to descriptive string like in Python.
- 310. By Siegfried Gevatter
-
Fix test case.
- 311. By Michal Hruby
-
Merge from my branch
- 312. By Seif Lotfy
-
reverted changes from r237
- 313. By Michal Hruby
-
Make FTS quit when ZG disappears
- 314. By Seif Lotfy
-
added WAL pragma
- 315. By Siegfried Gevatter
-
Remove old comment, move PRAGMA to the right place.
- 316. By Michal Hruby
-
Fix distcheck
- 317. By Michal Hruby
-
A couple of fixes
- 318. By Michal Hruby
-
Don't create a copy when using get_value
- 319. By Siegfried Gevatter
-
Remove the post_get_events in prevision of possible direct-access.
- 320. By Michal Hruby
- 321. By Michal Hruby
-
Handle null events in event array properly
- 322. By Manish Sinha (मनीष सिन्हा)
-
Added enable for AM_MAINTAINER_MODE
Our build system contains AM_MAINTAINER_MODE without enable. Changed it to
AM_MAINTAINER_MODE([enable] )
Please see these links for better explanation
* https://mail.gnome. org/archives/ desktop- devel-list/ 2011-September/ msg00064. html
* http://blogs.gnome. org/desrt/ 2011/09/ 08/am_maintaine r_mode- is-not- cool/ - 323. By Siegfried Gevatter
-
Merge Seif's lp:~seif/zeitgeist/bb-extract-methods:
Extract event and subj generation out of get_events into
get_event_from_row and get_subject_ from_row. - 324. By Siegfried Gevatter
-
Add Zeitgeist Python module.
- 325. By Siegfried Gevatter
-
Include Python tests in tarball. Change version number to include ~alpha.
- 326. By Siegfried Gevatter
-
And forgot a file.
- 327. By Michal Hruby
-
Add config.vapi to EXTRADIST
- 328. By Siegfried Gevatter
-
Include a copy of the LGPL, don't install everything into usr/doc,
rename test to test-dbus so it doesn't run by default. - 329. By Siegfried Gevatter
-
It's cold and the birds fly away. But the Zeitgeist won't change.
- 330. By Siegfried Gevatter
-
Binary: zeitgeist -> zeitgeist-daemon
- 331. By Siegfried Gevatter
-
Forgot one change.
- 332. By Siegfried Gevatter
-
Add manpage.
- 333. By Siegfried Gevatter
-
autohell should burn in fire
- 334. By Siegfried Gevatter
-
Add TODO.
- 335. By Michal Hruby
-
Dont mark some fts scripts as executable
- 336. By Siegfried Gevatter
-
More TODO.
- 337. By Seif Lotfy
-
add missing import of NULL_EVENT in fts.py
- 338. By Michal Hruby
-
Don't create both gzip and bz2
- 339. By Siegfried Gevatter
-
Merge Stefano Candori's branch implementing network status
monitoring in storage-monitor. - 340. By Siegfried Gevatter
-
Cleanup some stuff.
- 341. By Siegfried Gevatter
-
Add "+" as prefix operator for exact matches (not expanding
symbols to include their childs). - 342. By Stefano Candori
-
[Histogram extension] Fix timezone's hell.
This commit fixes the timezone problem in the histogram extension and adds
the test for checking this. - 343. By Stefano Candori
-
Updated TODO list.
- 344. By Seif Lotfy
-
Merged Stefano's work on fixing the history-extension
- 345. By Michal Hruby
-
Use statically allocated StringChunk to store the manifestations/
interpretations /mimetypes/ actors - 346. By Michal Hruby
-
Fix one minor unnecessary allocation
- 347. By Michal Hruby
-
Fix warning about delegate copying
- 348. By Siegfried Gevatter
-
Add interpretation_
for_mimetype and manifestation_ for_uri functions,
ported from libzeitgeist.This is needed to implement https:/
/bugs.launchpad .net/zeitgeist/ +bug/899602 - 349. By Siegfried Gevatter
-
Use compact classes instead of structs, return unowned strings and
sort mimetypes alphabetically. - 350. By Siegfried Gevatter
-
Add test case to reproduce "Inserting event with two subjects with the same
URI breaks the following event" (LP: #909708). - 351. By Siegfried Gevatter
-
- Automatically determine interpretation from mime-type when it's empty
- Automatically determine manifestation from URI when it's empty - 352. By Siegfried Gevatter
-
Updated to shared-
desktop- ontologies version 0.8.1. This introduces
WebDataObject and makes MusicPiece a child of Audio.
- 353. By Siegfried Gevatter
-
Merge Seif's lp:~zeitgeist/zeitgeist/benchmark-tools branch, which adds an
extension to get timing information from FindEventsId and some plotting
tools. - 354. By Siegfried Gevatter
-
Some test cases cleanup:
- Rename marshalling to marshalling-test and add copyright header.
- Make all tests exit with 0 on success.
- Use :memory: database in query-operators-test (it's not used, but
it's connected to). - 355. By Siegfried Gevatter
-
benchmark-tools: fix symlink and usage example.
- 356. By Michal Hruby
-
Move stuff around
- 357. By Michal Hruby
-
Add a define to explain query plans
- 358. By Michal Hruby
- 359. By Seif Lotfy
-
Add Exclusive lock for secure writing
- 360. By Michal Hruby
-
Add real-world query samples
- 361. By Michal Hruby
-
Don't use fts when using in-memory database
- 362. By Michal Hruby
-
Don't display debug messages by default
- 363. By Michal Hruby
-
Add a way to disable extensions
- 364. By Seif Lotfy
-
Fix bug 909708 where inserting and event with 2 subjects.
Since we already parse the subjects before insertion I added a list with subj_uris to find if there is a duplicate and return 0 if one is found - 365. By Michal Hruby
-
Fix Reindex in FTS indexer
- 366. By Michal Hruby
-
Disable the VolumeMonitor in StorageMonitor extension to avoid weird races
- 367. By Seif Lotfy
-
optimize allocations of variants
- 368. By Seif Lotfy
-
Seperate the allocation optimization into a new method optimize_
variant_ allocation.
This optimization effects marshalling by slowint it down by around 0.06s for 10k
events yet saves us 10MB in memory consumption. - 369. By Siegfried Gevatter
-
Merge Seif's FTS changes removing database writes.
- 370. By Siegfried Gevatter
-
Change event structure assertions to errors so D-Bus doesn't crash Zeitgeist
Michal Hruby (mhr3) wrote : | # |
156 assert (event_
157 Utils.SIG_EVENT + ")");
Let's turn this into assert_sig as well.
161 - assert (iter.n_children () >= 3);
Shouldn't this throw the error as well, instead of just removing it?
Michal Hruby (mhr3) wrote : | # |
Also, some tests pls...
Siegfried Gevatter (rainct) wrote : | # |
Unmerged revisions
- 370. By Siegfried Gevatter
-
Change event structure assertions to errors so D-Bus doesn't crash Zeitgeist
Preview Diff
1 | === modified file 'extensions/blacklist.vala' |
2 | --- extensions/blacklist.vala 2011-10-20 14:20:17 +0000 |
3 | +++ extensions/blacklist.vala 2012-01-25 11:54:25 +0000 |
4 | @@ -47,7 +47,7 @@ |
5 | private const string SIG_BLACKLIST = "a{s("+Utils.SIG_EVENT+")}"; |
6 | |
7 | private static HashTable<string, Event> from_variant ( |
8 | - Variant templates_variant) |
9 | + Variant templates_variant) throws EngineError |
10 | { |
11 | var blacklist = new HashTable<string, Event> (str_hash, str_equal); |
12 | |
13 | @@ -100,8 +100,18 @@ |
14 | Variant? templates = retrieve_config ("blacklist", |
15 | BlacklistTemplates.SIG_BLACKLIST); |
16 | if (templates != null) |
17 | - blacklist = BlacklistTemplates.from_variant (templates); |
18 | - else |
19 | + { |
20 | + try |
21 | + { |
22 | + blacklist = BlacklistTemplates.from_variant (templates); |
23 | + warning ("The blacklist database is corrupt. Overwriting it."); |
24 | + } |
25 | + catch (EngineError err) |
26 | + { |
27 | + templates = null; |
28 | + } |
29 | + } |
30 | + if (templates != null) |
31 | blacklist = new HashTable<string, Event> (str_hash, str_equal); |
32 | |
33 | // This will be called after bus is acquired, so it shouldn't block |
34 | |
35 | === modified file 'extensions/ds-registry.vala' |
36 | --- extensions/ds-registry.vala 2011-09-28 12:51:08 +0000 |
37 | +++ extensions/ds-registry.vala 2012-01-25 11:54:25 +0000 |
38 | @@ -73,6 +73,7 @@ |
39 | |
40 | public DataSource.from_variant (Variant variant, |
41 | bool reset_running=false) |
42 | + throws EngineError |
43 | { |
44 | warn_if_fail ( |
45 | variant.get_type_string () == "(sssa("+Utils.SIG_EVENT+")bxb)" |
46 | @@ -128,6 +129,7 @@ |
47 | |
48 | private static HashTable<string, DataSource> from_variant ( |
49 | Variant sources_variant, bool reset_running=false) |
50 | + throws EngineError |
51 | { |
52 | var registry = new HashTable<string, DataSource> ( |
53 | str_hash, str_equal); |
54 | @@ -186,8 +188,18 @@ |
55 | Variant? registry = retrieve_config ("registry", |
56 | DataSources.SIG_DATASOURCES); |
57 | if (registry != null) |
58 | - sources = DataSources.from_variant (registry, true); |
59 | - else |
60 | + { |
61 | + try |
62 | + { |
63 | + sources = DataSources.from_variant (registry, true); |
64 | + warning ("The data-source registry is corrupt. Overwriting it."); |
65 | + } |
66 | + catch (EngineError.INVALID_SIGNATURE err) |
67 | + { |
68 | + registry = null; |
69 | + } |
70 | + } |
71 | + if (registry == null) |
72 | sources = new HashTable<string, DataSource> ( |
73 | str_hash, str_equal); |
74 | |
75 | @@ -250,6 +262,7 @@ |
76 | |
77 | public bool register_data_source (string unique_id, string name, |
78 | string description, Variant event_templates, BusName? sender) |
79 | + throws Error |
80 | { |
81 | debug ("%s: %s, %s, %s", Log.METHOD, unique_id, name, description); |
82 | if (sender == null) |
83 | |
84 | === modified file 'extensions/storage-monitor.vala' |
85 | --- extensions/storage-monitor.vala 2012-01-06 10:20:42 +0000 |
86 | +++ extensions/storage-monitor.vala 2012-01-25 11:54:25 +0000 |
87 | @@ -333,9 +333,13 @@ |
88 | store_storage_medium_stmt.bind_text (3, icon); |
89 | store_storage_medium_stmt.bind_text (4, display_name); |
90 | |
91 | - int rc = store_storage_medium_stmt.step (); |
92 | - database.assert_query_success (rc, "add_storage_medium", |
93 | - Sqlite.DONE); |
94 | + try |
95 | + { |
96 | + int rc = store_storage_medium_stmt.step (); |
97 | + database.assert_query_success (rc, "add_storage_medium", |
98 | + Sqlite.DONE); |
99 | + } |
100 | + catch (EngineError err) {} |
101 | |
102 | storage_available (medium_name, StorageMedia.to_variant ( |
103 | medium_name, true, icon, display_name)); |
104 | @@ -352,9 +356,13 @@ |
105 | update_medium_state_stmt.reset (); |
106 | update_medium_state_stmt.bind_int (1, 0); |
107 | update_medium_state_stmt.bind_text (2, medium_name); |
108 | - int rc = update_medium_state_stmt.step (); |
109 | - database.assert_query_success (rc, "remove_storage_medium", |
110 | - Sqlite.DONE); |
111 | + try |
112 | + { |
113 | + int rc = update_medium_state_stmt.step (); |
114 | + database.assert_query_success (rc, "remove_storage_medium", |
115 | + Sqlite.DONE); |
116 | + } |
117 | + catch (EngineError err) {} |
118 | } |
119 | storage_unavailable (medium_name); |
120 | } |
121 | |
122 | === modified file 'src/datamodel.vala' |
123 | --- src/datamodel.vala 2012-01-16 12:25:29 +0000 |
124 | +++ src/datamodel.vala 2012-01-25 11:54:25 +0000 |
125 | @@ -22,6 +22,13 @@ |
126 | |
127 | namespace Zeitgeist |
128 | { |
129 | + private void assert_sig (bool condition, string error_message) |
130 | + throws EngineError.INVALID_SIGNATURE |
131 | + { |
132 | + if (unlikely (!condition)) |
133 | + throw new EngineError.INVALID_SIGNATURE (error_message); |
134 | + } |
135 | + |
136 | namespace Timestamp |
137 | { |
138 | public static int64 now () |
139 | @@ -252,7 +259,7 @@ |
140 | // must be immediately available to the user |
141 | ANY = 2 // The event subjects may or may not be available |
142 | } |
143 | - |
144 | + |
145 | private bool check_field_match (string property, |
146 | string template_property, bool is_symbol = false, |
147 | bool can_wildcard = false) |
148 | @@ -334,21 +341,22 @@ |
149 | subjects.add (subject); |
150 | } |
151 | |
152 | - public Event.from_variant (Variant event_variant) { |
153 | + public Event.from_variant (Variant event_variant) |
154 | + throws EngineError.INVALID_SIGNATURE |
155 | + { |
156 | assert (event_variant.get_type_string () == "(" + |
157 | Utils.SIG_EVENT + ")"); |
158 | |
159 | VariantIter iter = event_variant.iterator (); |
160 | |
161 | - assert (iter.n_children () >= 3); |
162 | - VariantIter event_array = iter.next_value ().iterator (); |
163 | - VariantIter subjects_array = iter.next_value ().iterator (); |
164 | + VariantIter event_array = iter.next_value().iterator(); |
165 | + VariantIter subjects_array = iter.next_value().iterator(); |
166 | Variant payload_variant = iter.next_value (); |
167 | |
168 | var event_props = event_array.n_children (); |
169 | - assert (event_props >= 5); |
170 | - id = (uint32) uint64.parse (event_array.next_value ().get_string ()); |
171 | - var str_timestamp = event_array.next_value ().get_string (); |
172 | + assert_sig (event_props >= 5, "Missing event information."); |
173 | + id = (uint32) uint64.parse (event_array.next_value().get_string ()); |
174 | + var str_timestamp = event_array.next_value().get_string (); |
175 | if (str_timestamp == "") |
176 | timestamp = Timestamp.now (); |
177 | else |
178 | @@ -504,6 +512,7 @@ |
179 | { |
180 | |
181 | public static GenericArray<Event> from_variant (Variant vevents) |
182 | + throws EngineError.INVALID_SIGNATURE |
183 | { |
184 | GenericArray<Event> events = new GenericArray<Event> (); |
185 | |
186 | @@ -588,11 +597,12 @@ |
187 | } |
188 | |
189 | public Subject.from_variant (Variant subject_variant) |
190 | + throws EngineError.INVALID_SIGNATURE |
191 | { |
192 | VariantIter iter = subject_variant.iterator(); |
193 | |
194 | var subject_props = iter.n_children (); |
195 | - assert (subject_props >= 7); |
196 | + assert_sig (subject_props >= 7, "Missing subject information"); |
197 | uri = iter.next_value().get_string (); |
198 | interpretation = iter.next_value().get_string (); |
199 | manifestation = iter.next_value().get_string (); |
200 | |
201 | === modified file 'src/errors.vala' |
202 | --- src/errors.vala 2011-10-20 13:32:51 +0000 |
203 | +++ src/errors.vala 2012-01-25 11:54:25 +0000 |
204 | @@ -27,6 +27,7 @@ |
205 | INVALID_ARGUMENT, |
206 | INVALID_KEY, |
207 | BACKUP_FAILED, |
208 | + INVALID_SIGNATURE, // FIXME: change from EngineError to sth. + public? |
209 | } |
210 | |
211 | // vala doesn't include proper headers, this fixes it |
212 | |
213 | === modified file 'src/sql.vala' |
214 | --- src/sql.vala 2012-01-02 19:30:51 +0000 |
215 | +++ src/sql.vala 2012-01-25 11:54:25 +0000 |
216 | @@ -225,7 +225,7 @@ |
217 | public void assert_query_success (int rc, string msg, |
218 | int success_code=Sqlite.OK) throws EngineError |
219 | { |
220 | - if (rc != success_code) |
221 | + if (unlikely (rc != success_code)) |
222 | { |
223 | string error_message = "%s: %d, %s".printf( |
224 | msg, rc, database.errmsg ()); |
Let's change the warn_if_fail to the assert_sig and merge this