animetosho / Nyuu

Flexible usenet binary posting tool
215 stars 30 forks source link

Posting error on Nyuu #87

Closed MS-design-ui closed 3 years ago

MS-design-ui commented 3 years ago

node -v v15.7.0

nyuu --version 0.4.0

Nyuu was compiled directly from source, not via npm install.

When posting I sometimes get an error which I'm not sure how to re-produce since it seems random

Command to post nyuu -O -o "XXX.nzb" "XXX"

It gets to a very high % (99.98 in this instance)

Nyuu[30356]: ../src/stream_base.cc:534:virtual void node::CustomBufferJSListener::OnStreamRead(ssize_t, const uv_buf_t&): Assertion(buf.base) == (buffer_.base)' failed. 1: 0xa73180 node::Abort() [Nyuu] 2: 0xa731fe [Nyuu] 3: 0xb4b8da [Nyuu] 4: 0xc1c69e node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [Nyuu] 5: 0xb58728 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const) [Nyuu] 6: 0x1469a21 [Nyuu] 7: 0x146a1f0 [Nyuu] 8: 0x1470be5 [Nyuu] 9: 0x145ea38 uv_run [Nyuu] 10: 0x9c0025 node::SpinEventLoop(node::Environment) [Nyuu] 11: 0xab4760 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [Nyuu] 12: 0xa3a6ba node::Start(int, char**) [Nyuu] 13: 0x7fa13f29609b __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6] 14: 0x9bcfcc [Nyuu]`

MS-design-ui commented 3 years ago

Also OS info

Linux 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64

animetosho commented 3 years ago

Thanks for all the info!

This looks like a NodeJS bug, and I've reported a similar issue in the past. I'm unable to reproduce such a case on 15.7.0 on my side, but if you're interested in trying to diagnose the problem, you can try the suggestion here.

Otherwise, you can try the following workaround - in lib/nntp.js, find:

var supportsOnread = (
    +process.version.replace(/\.\d+$/, '').replace(/^v/, '') >= 13.13
    || /^v12\.(16\.[3-9]|1[789]\.|[2-9]\d\.)/.test(process.version)
);

replace with

var supportsOnread = false;

Also, if you're willing to post your config (mask out anything you want to keep private), that might help too.

MS-design-ui commented 3 years ago

I saw your post, and I reverted to the LTS version and built everything again, I'll let you know if I have the same issue with v14. Else I'll try adjusting the variables like you mentioned and post findings :)

Like you it was random, no clear way for me to reproduce...

MS-design-ui commented 3 years ago

@animetosho Despite having moved to LTS, this issue still persists.

Regarding the adjustment of the variable, would I notice and performance drop?

animetosho commented 3 years ago

Thanks for the update.

In theory, performance should be worse, but I'd expect it to be unnoticeable. It's disabled on older Node versions due to instability anyway.

Considering this issue you've reported, I'm likely going to disable it on all Node versions - the benefit is tiny and certainly not worth the cost to stability.

MS-design-ui commented 3 years ago

I've made the code edits, I'll ping if any slowdown/weird issues still persist.

Appreciate your work on this, this is honestly a great tool :)

MS-design-ui commented 3 years ago

@animetosho For the sake of organisation, I'll close this ticket. There's been no issues so far with the new variable and no speed loss at all :)

animetosho commented 3 years ago

Thanks for the info!