<div dir="ltr"><div>Hi,</div><div><br></div>This mail is redirected from NM list.<div><br></div><div>Best Regards!</div><div>Quentin Li<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Àî½ú</b> <span dir="ltr"><<a href="mailto:snowmanli88@gmail.com">snowmanli88@gmail.com</a>></span><br>
Date: 2013/8/8<br>Subject: Re: [ISSUE] Modem manager SMS storages assert<br>To: Dan Williams <<a href="mailto:dcbw@redhat.com">dcbw@redhat.com</a>><br><br><br><div dir="ltr">Dear Dan,<div>Because there may be more than 1 UNKNOWN SMS storages in the array, </div>
<div>so just once skipping still got the same assert. </div><div>I have tried patch below and it works well until now.</div>
<div><br></div><div><div>--- /home/user/×ÀÃæ/ModemManager-1.0.0/src/mm-iface-modem-messaging.c<span style="white-space:pre-wrap"> </span>2013-07-19 16:00:01.000000000 +0800</div><div>+++ /home/user/ModemManager-1.0.0/src/mm-iface-modem-messaging.c<span style="white-space:pre-wrap"> </span>2013-08-08 16:10:30.004191341 +0800</div>
<div>@@ -795,13 +795,29 @@</div><div class="im"><div> </div><div> if (!storage_ctx->supported_mem1 || ctx->mem1_storage_index >= storage_ctx->supported_mem1->len)</div><div> all_loaded = TRUE;</div>
<div>- /* We'll skip the 'MT' storage, as that is a combination of 'SM' and 'ME' */</div>
<div>- else if (g_array_index (storage_ctx->supported_mem1,</div><div>- MMSmsStorage,</div><div>- ctx->mem1_storage_index) == MM_SMS_STORAGE_MT) {</div><div>
- ctx->mem1_storage_index++;</div>
<div>- if (ctx->mem1_storage_index >= storage_ctx->supported_mem1->len)</div><div>- all_loaded = TRUE;</div></div><div class="im"><div>+ /* We'll skip the 'MT' storage, as that is a combination of 'SM' and</div>
<div>+ * 'ME'. Also skip unknown storages since they can't be handled.</div><div>+ */</div></div><div>+ else </div><div class="im"><div>+ {</div><div>+ MMSmsStorage s;</div><div>+ </div>
</div><div>+ while(1)</div><div class="im">
<div>+ {</div><div>+ s = g_array_index (storage_ctx->supported_mem1,</div><div>+ MMSmsStorage,</div><div>+ ctx->mem1_storage_index);</div>
</div><div>+ if(s == MM_SMS_STORAGE_MT || s == MM_SMS_STORAGE_UNKNOWN) {</div><div class="im"><div>+ ctx->mem1_storage_index++;</div><div>+ if (ctx->mem1_storage_index >= storage_ctx->supported_mem1->len)</div>
</div><div>+ { </div><div>+ all_loaded = TRUE;</div><div>+ break;</div><div>+ }</div><div>+ }</div><div>+ else</div><div>+ break;</div>
<div>+ }</div><div> }</div><div> </div><div> if (all_loaded) {</div></div></div><div class=""><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/8 Dan Williams <span dir="ltr"><<a href="mailto:dcbw@redhat.com" target="_blank">dcbw@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>On Wed, 2013-08-07 at 16:44 +0800, Àî½ú wrote:<br>
> Hi,<br>
> When I use MediaTek data card device with MM v1.0.0, after I send command<br>
> "mmcli -m 0 -e", MM stopped and assert happened.<br>
> The assert is in function "mm_broadband_modem_lock_sms_storages" in<br>
> mm-broadband-modem.c.<br>
> When I trace the log, I found the root cause:<br>
> Our device response "AT+CMPS?" with some words like "SM_P" and "ME_P",<br>
> these words are parsed by mm_3gpp_parse_cpms_test_response and recognized<br>
> as "MM_SMS_STORAGE_UNKNOWN". So in this case, there were two "UNKNOWN"<br>
> members in storage_ctx->supported_mem1. When modem enabling operation go to<br>
> function "load_initial_sms_parts_from_storages", it try to do<br>
> load_initial_sms_parts but the second param is "MM_SMS_STORAGE_UNKNOWN",<br>
> assertion happen.<br>
> I think maybe for these UNKNOWN storage, load_initial_sms_parts shouldn't<br>
> try to read SMS from it. Instead, just do as "MM_SMS_STORAGE_MT" in<br>
> function "load_initial_sms_parts_from_storages", skipping them and just try<br>
> to read known storage.<br>
<br>
</div></div>Does this patch work?<br>
<br>
Dan<br>
<br>
diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c<br>
index 143d7ef..97ab8fb 100644<br>
--- a/src/mm-iface-modem-messaging.c<br>
+++ b/src/mm-iface-modem-messaging.c<br>
@@ -795,13 +795,20 @@ load_initial_sms_parts_from_storages (EnablingContext *ctx)<br>
<br>
if (!storage_ctx->supported_mem1 || ctx->mem1_storage_index >= storage_ctx->supported_mem1->len)<br>
all_loaded = TRUE;<br>
- /* We'll skip the 'MT' storage, as that is a combination of 'SM' and 'ME' */<br>
- else if (g_array_index (storage_ctx->supported_mem1,<br>
- MMSmsStorage,<br>
- ctx->mem1_storage_index) == MM_SMS_STORAGE_MT) {<br>
- ctx->mem1_storage_index++;<br>
- if (ctx->mem1_storage_index >= storage_ctx->supported_mem1->len)<br>
- all_loaded = TRUE;<br>
+ else {<br>
+ MMSmsStorage s;<br>
+<br>
+ s = g_array_index (storage_ctx->supported_mem1,<br>
+ MMSmsStorage,<br>
+ ctx->mem1_storage_index);<br>
+ /* We'll skip the 'MT' storage, as that is a combination of 'SM' and<br>
+ * 'ME'. Also skip unknown storages since they can't be handled.<br>
+ */<br>
+ if (s == MM_SMS_STORAGE_MT || s == MM_SMS_STORAGE_UNKNOWN) {<br>
+ ctx->mem1_storage_index++;<br>
+ if (ctx->mem1_storage_index >= storage_ctx->supported_mem1->len)<br>
+ all_loaded = TRUE;<br>
+ }<br>
}<br>
<br>
if (all_loaded) {<br>
<br>
<br>
</blockquote></div><br></div>
</div></div></div><br></div></div>