NordicPlayground / nRF51-ble-bcast-mesh

Other
323 stars 121 forks source link

After applying the reference counter race condition patch, sending a value enters the app error handler #163

Closed thedjnK closed 7 years ago

thedjnK commented 7 years ago

After applying the counter race condition patch, https://github.com/NordicSemiconductor/nRF51-ble-bcast-mesh/commit/3391f7006804e2fdac5b63244091cb32331f0940 I am no longer able to send data either manually with the push of a button or using a BLE device, doing so causes the 'check for rollover and 0-inc' in mesh_packet.c to fail.

#0  error_loop () at ../main.c:107
#1  0x0001f888 in app_error_fault_handler (id=16385, pc=0, info=536907348) at ../main.c:146
#2  0x0002003e in app_error_handler (error_code=4, line_num=98, p_file_name=0x27410 "../../../rbc_mesh/src/mesh_packet.c") at ../../../../../../components/libraries/util/app_error.c:48
#3  0x0002505a in mesh_packet_ref_count_inc (p_packet=0x20003f68 <g_packet_pool+120>) at ../../../rbc_mesh/src/mesh_packet.c:98
#4  0x00024e5a in handle_storage_tx_packets_get (time_now=4258419, pp_packets=0x20008ec0, p_count=0x20008ebc) at ../../../rbc_mesh/src/handle_storage.c:673
#5  0x000238ca in transmit_all_instances (timestamp=4258419, p_context=0x0) at ../../../rbc_mesh/src/version_handler.c:150
#6  0x0002351a in async_event_execute (p_evt=0x20008f20) at ../../../rbc_mesh/src/event_handler.c:121
#7  0x00023552 in event_fifo_pop (evt_fifo=0x20003c24 <g_async_evt_fifo>) at ../../../rbc_mesh/src/event_handler.c:140
#8  0x00023570 in QDEC_IRQHandler () at ../../../rbc_mesh/src/event_handler.c:157
#9  <signal handler called>
#10 0x00012476 in ?? ()
#11 0x00012474 in ?? ()

Removing the patch resolves the problem and the application stops freezing. Compiling using GCC 6.3

Edit: nevermind, one of the lines was duplicated, upon removing that extra line it's working fine!