parnoldx / nasc

Do maths like a normal person
http://parnoldx.github.io/nasc/
GNU General Public License v3.0
560 stars 37 forks source link

Segmentation fault #149

Closed ontimond closed 3 years ago

ontimond commented 4 years ago

I can't open NaSC, through the terminal application it shows me the following output:

$ com.github.parnold-x.nasc
[INFO 22:19:57.199074] Application.vala:156: NaSC version: 0.6.0
[INFO 22:19:57.199104] Application.vala:158: Kernel version: 5.3.0-53-generic
Segmentation fault
parnoldx commented 4 years ago

Thanks but not enough information to do anything.

dadaphl commented 4 years ago

I have the same issue. Installed 0.6.0 on Manjaro from AUR. It ran exactly once and after closing it it would not start any more with this

➜  ~ com.github.parnold-x.nasc -d
[INFO 18:11:33.385476] Application.vala:156: NaSC version: 0.6.0
[INFO 18:11:33.385512] Application.vala:158: Kernel version: 5.4.43-1-MANJARO
[DEBUG 18:11:33.403196] [GLib-GIO] _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
[DEBUG 18:11:33.436201] [GLib] unsetenv() is not thread-safe and should not be used after threads are created
[DEBUG 18:11:33.437898] [GLib-GIO] _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[DEBUG 18:11:33.437982] Settings.vala:164: Loading settings from schema 'com.github.parnold-x.nasc'
[DEBUG 18:11:33.465948] Controller.vala:156: loading sheets
[DEBUG 18:11:33.466015] Controller.vala:172: getting sheets
[DEBUG 18:11:33.466087] Controller.vala:175: set last sheet
[1]    30466 segmentation fault (core dumped)  com.github.parnold-x.nasc -d
➜  ~ uname -a
Linux rex 5.4.43-1-MANJARO #1 SMP PREEMPT Wed May 27 20:25:12 UTC 2020 x86_64 GNU/Linux

I ran it with strace. Here are the last couple of lines

mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fa94d2de000
mprotect(0x7fa94d2df000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7fa94dadd9b0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[31665], tls=0x7fa94dade700, child_tidptr=0x7fa94dade9d0) = 31665
futex(0x7fa953c07038, FUTEX_WAKE_PRIVATE, 2147483647) = 0
lstat("/home/philipp/.local/share/nasc/nasc.sheets", {st_mode=S_IFREG|0644, st_size=123, ...}) = 0
lstat("/home/philipp/.local/share/nasc/nasc.sheets", {st_mode=S_IFREG|0644, st_size=123, ...}) = 0
openat(AT_FDCWD, "/home/philipp/.local/share/nasc/nasc.sheets", O_RDONLY) = 11
fstat(11, {st_mode=S_IFREG|0644, st_size=123, ...}) = 0
read(11, "sheet-\302\247-a = 30\\na + 20\\nsin (45"..., 4096) = 123
read(11, "", 3973)                      = 0
read(11, "", 4096)                      = 0
close(11)                               = 0
futex(0x7fa953c07038, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7fa953c07038, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7fa953c07038, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7fa953c07038, FUTEX_WAKE_PRIVATE, 2147483647) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x1e30} ---
+++ killed by SIGSEGV (core dumped) +++
[1]    31657 segmentation fault (core dumped)  strace com.github.parnold-x.nasc

basically i just removed the nasc.sheets

rm /home/philipp/.local/share/nasc/nasc.sheets

and it runs again.

parnoldx commented 4 years ago

@dadaphl Thanks. Ok it seems to be something in stored sheet. Strange. Can someone post a nasc.sheets that leads to a crash so I can start from there.

rythmkraze commented 4 years ago

Same problem here. Ran once after install and then segmentation fault. Also pasting contents of nasc.sheets

$ com.github.parnold-x.nasc 
[INFO 05:46:15.186413] Application.vala:156: NaSC version: 0.7.1
[INFO 05:46:15.186446] Application.vala:158: Kernel version: 5.3.0-53-generic
Exception: com.github.parnold-x.nasc killed by signal segmentation fault
$ cat ~/.local/share/nasc/nasc.sheets
sheet-§-today\n\n⏎   
parnoldx commented 4 years ago

@rythmkraze Thanks. Pushed a fix.

KarimMahboub commented 3 years ago

Hello, I am having segmentation faults on regular occasions. The only way to work it out is to remove the nasc.sheets file. For the seg fault to occur, one needs to run the program and click on the "Open Sheets" icon on the top left.

Here is the command line:

(19:42) $ com.github.parnold-x.nasc -d
[INFO 19:43:30.311454] Application.vala:156: NaSC version: 0.7.6
[INFO 19:43:30.311469] Application.vala:158: Kernel version: 5.11.0-25-generic
[DEBUG 19:43:30.318786] [GLib] unsetenv() is not thread-safe and should not be used after threads are created
[DEBUG 19:43:30.322354] [GLib-GIO] _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
[DEBUG 19:43:30.563141] [GLib-GIO] _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[DEBUG 19:43:30.623965] Controller.vala:156: loading sheets
[DEBUG 19:43:30.623995] Controller.vala:172: getting sheets
[DEBUG 19:43:30.624090] Controller.vala:175: set last sheet
Segmentation fault (core dumped)

Here is the content of nasc.sheets:

sheet1-§-5500 * 3 + 9600 + 7100\n\n9600 + 10%\n\n2^44 / 1000 / 86400 / 365\n\n52650 / 81\n\n15000 * 12 / 3.657\n\n8000 * 12 * 40\n\n\n300 * 7 * 0.03\n95 / 300\n\naccounts = 8000 + 22400|§§|sheet2-§-42|§§|sheet3-§-43
parnoldx commented 3 years ago

Thanks for the sheet. I think it's fixed now

newbthenewbd commented 2 years ago

Unfortunately, it still crashes for me more often than it doesn't with pretty much any sheet, e.g.:

sheet-§-dddd|§§|sheet-§-

Still is my instant favorite calc. Thank You!!