public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH ncns v1 0/2] ncns fixes
@ 2022-08-17 13:35 Ammar Faizi
  2022-08-17 13:35 ` [PATCH ncns v1 1/2] chnet: Initialize `read_ret_` to zero Ammar Faizi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ammar Faizi @ 2022-08-17 13:35 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan; +Cc: Ammar Faizi, GNU/Weeb Mailing List

Hi Al,

Yet another small series for ncns.

1) Initialize `read_ret_` to zero.

We can't rely on read_ret_ value being random at initialization. This
caused a real crash where @ret value being random (83382480 in this
case):

  ret = 83382480
  [0817/093957.227555:FATAL:scoped_refptr.h(272)] Check failed: ptr_.
  #0 0x7fa9a8a6b62c <unknown>
  #1 0x7fa9a87cb30a <unknown>
  #2 0x7fa9a87cb2c5 <unknown>
  #3 0x7fa9a881c799 <unknown>
  #4 0x7fa9a881cfa9 <unknown>
  #5 0x7fa9a878537b <unknown>
  #6 0x7fa9a93866b6 <unknown>
  #7 0x7fa9a93121fa <unknown>
  #8 0x7fa9a931debd <unknown>
  #9 0x000000b0deed <unknown>
  #10 0x000000d972d0 <unknown>
  #11 0x000000d9880f <unknown>
  #12 0x0000016dabb9 <unknown>

2) Set error string when the Chromium hits net error.

Translate the error code to string when the Chromium hits a net error.
This makes debugging easier for the callers because now we can know
what the returned error code means, easily.

Signed-off-by: Ammar Faizi <[email protected]>
---
Ammar Faizi (2):
  chnet: Initialize `read_ret_` to zero
  chnet: Set error string when the Chromium hits net error

 chnet/chnet.cc | 12 ++++++++++++
 chnet/chnet.h  |  2 ++
 2 files changed, 14 insertions(+)


base-commit: 971f49f53c730aa82466b251a2b682c0827c3ec4
-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH ncns v1 0/2] ncns fixes
@ 2022-08-17  1:09 Ammar Faizi
  2022-08-17  1:14 ` Alviro Iskandar Setiawan
  0 siblings, 1 reply; 7+ messages in thread
From: Ammar Faizi @ 2022-08-17  1:09 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan; +Cc: Ammar Faizi, GNU/Weeb Mailing List

Hi Al,

Two fixes this time:

1) Only take the pointer of buffer when available.

The call to `ch->ch_.read_buf()` may be undefined behavior if the
buffer hasn't been initialized. Don't touch this buffer and return
null if it's not guaranteed to be initialized.

2) Fix unused variable warning.

Fix this:

  ../chnet/chnet_node.cc: In function ‘void CHN_RingWaitCQE(const Napi::CallbackInfo&)’:
  ../chnet/chnet_node.cc:146:19: warning: variable ‘env’ set but not used [-Wunused-but-set-variable]
    146 |         Napi::Env env = info.Env();
        |                   ^~~

Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (2):
  chnet: node: Only take the pointer of buffer when available
  chnet: node: Fix unused variable warning

 chnet/chnet_node.cc | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)


base-commit: 2b40ff58ef9007013ec741d2d599869e4c0b46f2
-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-17 13:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-17 13:35 [PATCH ncns v1 0/2] ncns fixes Ammar Faizi
2022-08-17 13:35 ` [PATCH ncns v1 1/2] chnet: Initialize `read_ret_` to zero Ammar Faizi
2022-08-17 13:40   ` Alviro Iskandar Setiawan
2022-08-17 13:35 ` [PATCH ncns v1 2/2] chnet: Set error string when the Chromium hits net error Ammar Faizi
2022-08-17 13:41 ` [PATCH ncns v1 0/2] ncns fixes Alviro Iskandar Setiawan
  -- strict thread matches above, loose matches on Subject: below --
2022-08-17  1:09 Ammar Faizi
2022-08-17  1:14 ` Alviro Iskandar Setiawan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox