nitter icon indicating copy to clipboard operation
nitter copied to clipboard

Openning a user profile leads to a bus error

Open kdltr opened this issue 4 years ago • 12 comments

Trying to run Nitter on Alpine Linux armhf, with Nim compiled from source the same day (Nim Compiler Version 1.4.2 [Linux: arm]) Nitter seems to be working at first, but when I browse to a user profile, it crashes with a bus error. Here’s the backtrace from the core file:

#0  0x0056f464 in emitLiteral__bNsFv8RFni7H9bEPE9csAUSA ()
#1  0x0056f738 in compressFragment__UIYOGxv54fqicvKvwtiyPw ()
#2  0x7ebf4550 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

kdltr avatar Feb 17 '21 22:02 kdltr

Same here on a Raspberrypi 4b running raspbian (compiled with nim compiler version 1.5.1). Did you find any solution in the meantime?

girlwithnoname avatar Jun 05 '21 18:06 girlwithnoname

I had the same issues, and compiling with nimble build -y -d:release --opt:size --os:linux --gc:arc fixed it for me!

(i think it's the --gc:arc that does the job, but the other parameters don't hurt as well :shrug:

mdik avatar Sep 25 '21 07:09 mdik

PS: I still get bus error when I click the "load more" button on the bottom of a user page.

mdik avatar Sep 28 '21 22:09 mdik

I ran the build again with -d:checkAbi and it gave some errors regarding types:

/usr/lib/nim/pure/asyncstreams.nim(58, 13) Warning: ':env.future2.cb = (named, :env)' creates an uncollectable ref cycle; annotate 'future2' with .cursor [CycleCreated]                                                                                                      In file included from /home/nitter/.cache/nim/nitter_d/stdlib_os.nim.c:12:                                                             /usr/lib/nim/nimbase.h:271:35: error: static assertion failed: "backend & Nim disagree on size for: Dev{int} [declared in /usr/lib/nim/posix/posix_other.nim(153, 3)]"                                                                                                          271 | #define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
      |                                   ^~~~~~~~~~~~~~
/home/nitter/.cache/nim/nitter_d/stdlib_os.nim.c:174:1: note: in expansion of macro ‘NIM_STATIC_ASSERT’
  174 | NIM_STATIC_ASSERT(sizeof(dev_t) == 4, "backend & Nim disagree on size for: Dev{int} [declared in /usr/lib/nim/posix/posix_other
.nim(153, 3)]");
      | ^~~~~~~~~~~~~~~~~
/usr/lib/nim/nimbase.h:271:35: error: static assertion failed: "backend & Nim disagree on size for: Off{int64} [declared in /usr/lib/ni
m/posix/posix_other.nim(168, 3)]" 
  271 | #define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
      |                                   ^~~~~~~~~~~~~~
/home/nitter/.cache/nim/nitter_d/stdlib_os.nim.c:180:1: note: in expansion of macro ‘NIM_STATIC_ASSERT’
  180 | NIM_STATIC_ASSERT(sizeof(off_t) == 8, "backend & Nim disagree on size for: Off{int64} [declared in /usr/lib/nim/posix/posix_oth
er.nim(168, 3)]");
      | ^~~~~~~~~~~~~~~~~
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -Os -fno-ident   -I/usr/lib/nim -I/home/nitter/nitter/src -
o /home/nitter/.cache/nim/nitter_d/stdlib_os.nim.c.o /home/nitter/.cache/nim/nitter_d/stdlib_os.nim.c' failed with exit code: 1

Sorry for the messy formatting...

mdik avatar Oct 01 '21 12:10 mdik

i found what causes the issue. i compiled with -d:strip, and the errors pointed me towards https://github.com/zedeus/nitter/blob/25191f7c40efaa563d098092d04d6290affe28ba/src/formatters.nim#L25

after reverting the function to before https://github.com/zedeus/nitter/commit/2a2255d75ac5f67244064360fa42875c0ef19539 it works much better. now it sometimes appears to time out, but one has the opportunity to view a user profile before that happens.

i also compiled it with some of https://github.com/jackyzy823 's pull requests which seem to work fine!

mdik avatar Dec 07 '21 21:12 mdik

Is this still an issue?

zedeus avatar Jan 02 '22 10:01 zedeus

After commenting on #316 I discovered this issue. I would say theyre the same, if not related to each other (same platform, same kind of issue with bus error). I followed the hints that @mdik mentioned but even when reverting stripHtml to the older version I still get reliable crashes.

Missingmew avatar Jan 02 '22 13:01 Missingmew

After compiling latest main branch with nim 1.6.2, I have no crashes on user pages anymore. Thank you!

(Now the proxy setting that I merged from the pull request seems to not work anymore, but that might be due to Tor, and I'll open another issue if this persists.)

mdik avatar Jan 02 '22 17:01 mdik

Good to hear, let me know if the issue is still there with master compiled with Nim 1.6.2 @Missingmew @girlwithnoname @kdltr

zedeus avatar Jan 03 '22 00:01 zedeus

I just recompiled using 9a578b3 and nim 1.6.2 and still get a crash when attempting to visit a user profile, so it doesnt seem to be completely gone just yet.

Missingmew avatar Jan 04 '22 17:01 Missingmew

Ive been rebuilding nitter every so often to try and see if this bug persists. Even after getting nim 1.6.4 visiting a user profile crashes nitter. Is this possibly an issue with nim itself instead of just nitter? I unfortunately havent had the time to debug this in any more detail.

Missingmew avatar Mar 08 '22 18:03 Missingmew

I've got an armbian with nim 1.6.2 and fortunately still no problems anymore. I know, not incredibly helpful information, but maybe a little in terms of where to look, and where not :-/

mdik avatar Apr 11 '22 13:04 mdik