Skip to content

multi-threaded tabfs.c#29

Merged
osnr merged 2 commits into
osnr:masterfrom
huglovefan:master
Jan 4, 2021
Merged

multi-threaded tabfs.c#29
osnr merged 2 commits into
osnr:masterfrom
huglovefan:master

Conversation

@huglovefan

@huglovefan huglovefan commented Jan 3, 2021

Copy link
Copy Markdown
Contributor

plz test

it's the same as before but it can interleave requests now

closes: #7
closes: #14
closes: #18
closes: #27

@gavinlaking

Copy link
Copy Markdown

Can confirm that it closes #27 by removing the usage output altogether.

@bjesus

bjesus commented Jan 3, 2021

Copy link
Copy Markdown

Also confirming it fixes #7, #18 and #14 here. Awesome work!

@osnr

osnr commented Jan 3, 2021

Copy link
Copy Markdown
Owner

wow, brilliant work! I'll look at this & hopefully merge it today.

@osnr

osnr commented Jan 4, 2021

Copy link
Copy Markdown
Owner

Still looking at this, but I wanted to post an update:

Are the folks who have it working all on Linux? On my Mac, I had to remove -oauto_unmount -- although maybe newer macFUSE supports it and I just need to update? -- and now have an error at runtime:

* thread #3, stop reason = EXC_BAD_ACCESS (code=2, address=0x70000155cff8)
  * frame #0: 0x00007fff68477bc7 libsystem_pthread.dylib`___chkstk_darwin + 55
    frame #1: 0x0000000100007bee tabfs
    frame #2: 0x00000001000068d2 tabfs`tabfs_getattr(path=<unavailable>, stbuf=0x00007000015dcdd0) at tabfs.c:209:5 [opt]

plus a bunch of instances of this warning on compile

tabfs.c:209:5: warning: incompatible pointer to integer conversion initializing 'unsigned int' with an expression of type
      'pthread_t _Nonnull' (aka 'struct _opaque_pthread_t *') [-Wint-conversion]
    exchange_json(&rdata, &rsize,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tabfs.c:178:22: note: expanded from macro 'exchange_json'
        unsigned int id = pthread_self(); \
                     ^    ~~~~~~~~~~~~~~

@bjesus

bjesus commented Jan 4, 2021

Copy link
Copy Markdown

Confirming that I only tested it with FF Developer and Arch Linux.

@huglovefan

Copy link
Copy Markdown
Contributor Author

@osnr: can you try it now with commit 57331e2?

i might've fixed the EXC_BAD_ACCESS if it was a stack overflow like i suspect (converted the 1MB stack array to a heap-allocated one)

I had to remove -oauto_unmount -- although maybe newer macFUSE supports it and I just need to update?

i'm on linux so don't know, need a macfuse user to confirm this

@osnr osnr merged commit 6e829c1 into osnr:master Jan 4, 2021
@osnr

osnr commented Jan 4, 2021

Copy link
Copy Markdown
Owner

Works great now. This is really excellent stuff, and you've solved a lot of problems I was dreading having to think through. I'm also glad the design was clear enough that you were able to figure it all out. Thanks again! 🙂

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong program name? Changing symlinks compgen breaks tabs/last-focused by-title symbolic links contain corrupted text

4 participants