Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on nested functions. #371

Closed
tnymlr opened this issue Dec 26, 2019 · 13 comments
Closed

Segmentation fault on nested functions. #371

tnymlr opened this issue Dec 26, 2019 · 13 comments

Comments

@tnymlr
Copy link

tnymlr commented Dec 26, 2019

I don't know how to explain what I'm trying to do, I think the best was to explain it is with SQL query.

So I'm trying to do something like that: select name, sum(amount) from table1 where name is in table2.

So I go into a cell and add this function: @sum(H2:I7, @vlookup(Q2:R30, H2, 1)=@vlookup(Q2:R30, D6, 1)).

Q2:R30 is a range where first column is a name, second column is a numerical id.

H2:I7 is a range of name -> amount pairs, where single name can appear in multiple rows.

D6 contains the name I want the total amount for.

It segfaults on that expression.

Here is the file: https://pastebin.com/BktHzQfV

Just try to add that function above into any cell and it'll segfault. I don't think I have any circular deps here.

@tnymlr
Copy link
Author

tnymlr commented Dec 26, 2019

I just realised that what I'm trying to do looks like what :subtotal does but dynamic.

@andmarti1424
Copy link
Owner

this is the expression that segfaults to you:
@sum(H2:I7, @vlookup(Q2:R30, H2, 1)=@vlookup(Q2:R30, D6, 1)).
?
if so, where are you entering it? thanks

@andmarti1424
Copy link
Owner

@dikeert Please try this with latest git commit and report back.

@andmarti1424
Copy link
Owner

thanks!

@andmarti1424
Copy link
Owner

@dikeert could you try it? Thanks

@tnymlr
Copy link
Author

tnymlr commented Mar 31, 2021

Hello!

I'm a bit busy right now, I think I'll be able to get to that next week.

@tnymlr
Copy link
Author

tnymlr commented Apr 18, 2021

Hello!
Do you happen to know if scm-im-git on arch installs last commit? If yes then it still segfaults.

@tnymlr
Copy link
Author

tnymlr commented Apr 18, 2021

Version:

$ sc-im --version
SC-IM - version 0.8.2-dev
-DNCURSES
-DMAXROWS 65536
-DUNDO
-DXLSX
-DXLUA
-DDEFAULT_COPY_TO_CLIPBOARD_CMD="xclip -i -selection clipboard <"
-DDEFAULT_PASTE_FROM_CLIPBOARD_CMD="xclip -o -selection clipboard"
-DDEFAULT_OPEN_FILE_UNDER_CURSOR_CMD="scopen"
-DUSELOCALE
-DMOUSE
-DUSECOLORS
-D_XOPEN_SOURCE_EXTENDED
-D_GNU_SOURCE
-DSNAME="sc-im"
-DHELP_PATH="/usr/share/sc-im"
-DLIBDIR="/usr/share/doc/sc-im"
-DDFLT_PAGER="less"
-DDFLT_EDITOR="vim"
-DCONFIG_DIR=".config/sc-im"
-DCONFIG_FILE="scimrc"
-DHISTORY_DIR=".cache"
-DHISTORY_FILE="sc-iminfo"
-DINS_HISTORY_FILE="sc-iminfo"
-DHAVE_PTHREAD
-DAUTOBACKUP

I'll try to build it myself now...

@tnymlr
Copy link
Author

tnymlr commented Apr 18, 2021

Nope, HEAD of branch freeze still segfaults.

As to other questions that I totally missed, pardon me, I was really re-occupied with something else.

The expression that causes segfault is this:

@sum(H2:I7, @vlookup(Q2:R30, H2, 1)=@vlookup(Q2:R30, D6, 1))

Enter it in any free cell and it'll segfault. Use file from pastebin that I linked in the description.

@andmarti1424
Copy link
Owner

Hello!
Do you happen to know if scm-im-git on arch installs last commit? If yes then it still segfaults.

probably yes. but from freeze branch.

andmarti1424 added a commit that referenced this issue Apr 18, 2021
@andmarti1424
Copy link
Owner

@dikeert this segfaults in old sc too. Could you please update to my latest commit on the "new" branch and try again..??

@tnymlr
Copy link
Author

tnymlr commented Apr 19, 2021

Hello!

First of all, I had to edit my formula, the correct one is this: @sum(H2:I7, @vlookup(Q2:R30, $H2, 1)=@vlookup(Q2:R30, $D$6, 1)) one.

Second, both, the correct formula and incorrect formula now work properly without segfault. That is if you build from HEAD of new branch.

Third. I'm a stupid moron and that monstro of a formula can be replaced with @sum(H2:I17,@eqs($H2, @fixed D6)) (which also segfaults the "old" version")

Thank you very much!

@andmarti1424
Copy link
Owner

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants