Patch Set 2: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/gsm_04_11.c
File openbsc/src/libmsc/gsm_04_11.c:

Line 637:       rc = sms_route_mt_sms(conn, sms_report);
> if mem is up, the program will likely not do *anything* useful anymore. Ins
It is our general practise/consensus that we should not try to resolve memory 
allocation failures.  There is some old code that does try to cope with it, and 
most probably in a bad way.  So indeed, I think the best approach to deal with 
allocation failures is to terminate the program.  WE don't allocate large 
amounts of memory anyway, and if our small allocations fail, the system is 
beyond hope.  The difference to the kernel is that the NITB/MSC/... process 
will simply be restarted very quickly, without having an impact on other 
processes on the system.  And if we have a leak, we should fix it, and users 
should complain with a meaningful error message (e.g. the assert).

We could consider moving the ASSERT()s into the allocator, or have something 
like talloc macros that assert if they fail. But that's outside of the scope of 
this patch.


-- 
To view, visit https://gerrit.osmocom.org/3434
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso <pa...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Holger Freyther <hol...@freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte <ke...@rhizomatica.org>
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Pablo Neira Ayuso <pa...@gnumonks.org>
Gerrit-HasComments: Yes

Reply via email to