khenriks / mp3fs

FUSE-based transcoding filesystem from FLAC to MP3
http://khenriks.github.io/mp3fs/
GNU General Public License v3.0
382 stars 46 forks source link

mp3fs segfault when sharing files via samba #57

Closed salnajjar closed 5 years ago

salnajjar commented 6 years ago

mp3fs is working perfectly on accessing and copying the files via the local server, however, if I share the mp3fs directory via samba, the moment I try to access one of the mp3 files mp3fs segfaults on me requiring samba to be restarted and the mp3fs mount point to be unmounted and mounted again.

Mounting with the command: mp3fs -o allow_other -b 256 --quality=2 -d /data/music/flac /data/music/mp3

Produces a clean mount:

[2017-11-01 11:58:04] DEBUG: LAME ready to initialize.
[2017-11-01 11:58:04] DEBUG: MP3FS options:
basepath:       /data/music/flac
bitrate:        256
desttype:       mp3
gainmode:       1
gainref:        89.000000
log_maxlevel:   DEBUG
log_stderr:     1
log_syslog:     0
logfile:
quality:        2
statcachesize:  0
vbr:            0

FUSE library version: 2.9.4
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.23
flags=0x0003fffb
max_readahead=0x00020000
   INIT: 7.19
   flags=0x00000010
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40

But as soon as I try to access a file via the samba share I get:

unique: 35, opcode: LOOKUP (1), nodeid: 1, insize: 56, pid: 23678                                                                                             [345/1925]
LOOKUP /Vampire Weekend
getattr /Vampire Weekend
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend
   NODEID: 2
   unique: 35, success, outsize: 144
unique: 36, opcode: LOOKUP (1), nodeid: 2, insize: 56, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend
getattr /Vampire Weekend/Vampire Weekend
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend
   NODEID: 3
   unique: 36, success, outsize: 144
unique: 37, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 23678
getattr /
[2017-11-01 12:02:52] DEBUG: getattr /
   unique: 37, success, outsize: 120
unique: 38, opcode: OPENDIR (27), nodeid: 3, insize: 48, pid: 23678
   unique: 38, success, outsize: 32
unique: 39, opcode: READDIR (28), nodeid: 3, insize: 80, pid: 23678
readdir[0] from 0
[2017-11-01 12:02:52] DEBUG: readdir /Vampire Weekend/Vampire Weekend
   unique: 39, success, outsize: 696
unique: 40, opcode: GETATTR (3), nodeid: 3, insize: 56, pid: 23678
getattr /Vampire Weekend/Vampire Weekend
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend
   unique: 40, success, outsize: 120
unique: 41, opcode: LOOKUP (1), nodeid: 3, insize: 70, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/04 Cape Cod Kwassa Kwassa.mp3
getattr /Vampire Weekend/Vampire Weekend/04 Cape Cod Kwassa Kwassa.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/04 Cape Cod Kwassa Kwassa.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/04 Cape Cod Kwassa Kwassa.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97c007110 ; 0 -> 301
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97c007110 -> 0x7fe97c065af0 ; 301 -> 6872513
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.                                                                                                           [302/1925]
   NODEID: 4
   unique: 41, success, outsize: 144
unique: 42, opcode: LOOKUP (1), nodeid: 3, insize: 61, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/01 Mansford Roof.mp3
getattr /Vampire Weekend/Vampire Weekend/01 Mansford Roof.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/01 Mansford Roof.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/01 Mansford Roof.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97401c130 ; 0 -> 292
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97401c130 -> 0x7fe974064df0 ; 292 -> 4087224
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 5
   unique: 42, success, outsize: 144
unique: 43, opcode: LOOKUP (1), nodeid: 3, insize: 60, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/02 Oxford Comma.mp3
getattr /Vampire Weekend/Vampire Weekend/02 Oxford Comma.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/02 Oxford Comma.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/02 Oxford Comma.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97c000b40 ; 0 -> 291
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97c000b40 -> 0x7fe97c065530 ; 291 -> 6264791
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 6
   unique: 43, success, outsize: 144
unique: 44, opcode: LOOKUP (1), nodeid: 3, insize: 54, pid: 23678                                                                                             [259/1925]
LOOKUP /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3
getattr /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/03 A-Punk.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97401c130 ; 0 -> 285
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97401c130 -> 0x7fe974064dd0 ; 285 -> 4409882
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 7
   unique: 44, success, outsize: 144
unique: 45, opcode: LOOKUP (1), nodeid: 3, insize: 54, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/06 Campus.mp3
getattr /Vampire Weekend/Vampire Weekend/06 Campus.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/06 Campus.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/06 Campus.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97c006370 ; 0 -> 237
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97c006370 -> 0x7fe97c065530 ; 237 -> 5648665
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 8
   unique: 45, success, outsize: 144
unique: 46, opcode: LOOKUP (1), nodeid: 3, insize: 51, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/05 M79.mp3
getattr /Vampire Weekend/Vampire Weekend/05 M79.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/05 M79.mp3                                                                              [216/1925]
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/05 M79.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97401c150 ; 0 -> 282
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97401c150 -> 0x7fe974064d90 ; 282 -> 8185722
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 9
   unique: 46, success, outsize: 144
unique: 47, opcode: LOOKUP (1), nodeid: 3, insize: 55, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/10 Walcott.mp3
getattr /Vampire Weekend/Vampire Weekend/10 Walcott.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/10 Walcott.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/10 Walcott.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97c000f10 ; 0 -> 287
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97c000f10 -> 0x7fe97c066030 ; 287 -> 7093182
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 10
   unique: 47, success, outsize: 144
unique: 48, opcode: LOOKUP (1), nodeid: 3, insize: 52, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/07 Bryn.mp3
getattr /Vampire Weekend/Vampire Weekend/07 Bryn.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/07 Bryn.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/07 Bryn.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.                                                                                                        [173/1925]
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97401c150 ; 0 -> 229
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97401c150 -> 0x7fe974064c60 ; 229 -> 4263540
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 11
   unique: 48, success, outsize: 144
unique: 49, opcode: LOOKUP (1), nodeid: 3, insize: 77, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/11 The Kids Don't Stand A Chance.mp3
getattr /Vampire Weekend/Vampire Weekend/11 The Kids Don't Stand A Chance.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/11 The Kids Don't Stand A Chance.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/11 The Kids Don't Stand A Chance.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97c002f90 ; 0 -> 309
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97c002f90 -> 0x7fe97c066030 ; 309 -> 7777821
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 12
   unique: 49, success, outsize: 144
unique: 50, opcode: LOOKUP (1), nodeid: 3, insize: 76, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/08 One (Blake's Got A New Face).mp3
getattr /Vampire Weekend/Vampire Weekend/08 One (Blake's Got A New Face).mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/08 One (Blake's Got A New Face).mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/08 One (Blake's Got A New Face).flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.                                                                                                        [130/1925]
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97401c150 ; 0 -> 326
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97401c150 -> 0x7fe974064fa0 ; 326 -> 6177890
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 13
   unique: 50, success, outsize: 144
unique: 51, opcode: LOOKUP (1), nodeid: 3, insize: 65, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/09 I Stand Corrected.mp3
getattr /Vampire Weekend/Vampire Weekend/09 I Stand Corrected.mp3
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/09 I Stand Corrected.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/09 I Stand Corrected.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97c006950 ; 0 -> 296
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97c006950 -> 0x7fe97c065530 ; 296 -> 5113736
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   NODEID: 14
   unique: 51, success, outsize: 144
unique: 52, opcode: LOOKUP (1), nodeid: 3, insize: 58, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/AlbumArtSmall.jpg
getattr /Vampire Weekend/Vampire Weekend/AlbumArtSmall.jpg
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/AlbumArtSmall.jpg
   NODEID: 15
   unique: 52, success, outsize: 144
unique: 53, opcode: LOOKUP (1), nodeid: 3, insize: 51, pid: 23678
LOOKUP /Vampire Weekend/Vampire Weekend/Folder.jpg
getattr /Vampire Weekend/Vampire Weekend/Folder.jpg
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend/Folder.jpg
   NODEID: 16
   unique: 53, success, outsize: 144
unique: 54, opcode: READDIR (28), nodeid: 3, insize: 80, pid: 23678                                                                                            [87/1925]
   unique: 54, success, outsize: 16
unique: 55, opcode: RELEASEDIR (29), nodeid: 3, insize: 64, pid: 0
   unique: 55, success, outsize: 16
unique: 56, opcode: GETATTR (3), nodeid: 3, insize: 56, pid: 23678
getattr /Vampire Weekend/Vampire Weekend
[2017-11-01 12:02:52] DEBUG: getattr /Vampire Weekend/Vampire Weekend
   unique: 56, success, outsize: 120
unique: 57, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 23678
   unique: 57, success, outsize: 32
unique: 58, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 58, success, outsize: 16
unique: 59, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 23678
   unique: 59, success, outsize: 32
unique: 60, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 23678
statfs /
[2017-11-01 12:02:52] DEBUG: statfs /
   unique: 60, success, outsize: 96
unique: 61, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 23678
LOOKUP /mp3fs
getattr /mp3fs
[2017-11-01 12:02:52] DEBUG: getattr /mp3fs
   unique: 61, error: -2 (No such file or directory), outsize: 16
unique: 62, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 23678
LOOKUP /mp3fs
getattr /mp3fs
[2017-11-01 12:02:52] DEBUG: getattr /mp3fs
   unique: 62, error: -2 (No such file or directory), outsize: 16
unique: 63, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 23678
LOOKUP /mp3fs
getattr /mp3fs
[2017-11-01 12:02:52] DEBUG: getattr /mp3fs
   unique: 63, error: -2 (No such file or directory), outsize: 16
unique: 64, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 23678
LOOKUP /mp3fs
getattr /mp3fs
[2017-11-01 12:02:52] DEBUG: getattr /mp3fs
   unique: 64, error: -2 (No such file or directory), outsize: 16
unique: 65, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 23678
LOOKUP /mp3fs
getattr /mp3fs
[2017-11-01 12:02:52] DEBUG: getattr /mp3fs
   unique: 65, error: -2 (No such file or directory), outsize: 16
unique: 66, opcode: LOOKUP (1), nodeid: 1, insize: 46, pid: 23678                                                                                              [44/1925]
LOOKUP /mp3fs
getattr /mp3fs
[2017-11-01 12:02:52] DEBUG: getattr /mp3fs
   unique: 66, error: -2 (No such file or directory), outsize: 16
unique: 67, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 67, success, outsize: 16
unique: 68, opcode: OPEN (14), nodeid: 7, insize: 48, pid: 23678
open flags: 0x28000 /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3
[2017-11-01 12:02:52] DEBUG: open /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3
[2017-11-01 12:02:52] DEBUG: Creating transcoder object for /data/music/flac/Vampire Weekend/Vampire Weekend/03 A-Punk.flac
[2017-11-01 12:02:52] DEBUG: Ready to initialize decoder.
[2017-11-01 12:02:52] DEBUG: FLAC ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC initialized successfully.
[2017-11-01 12:02:52] DEBUG: Decoder initialized successfully.
[2017-11-01 12:02:52] DEBUG: LAME ready to initialize.
[2017-11-01 12:02:52] DEBUG: FLAC processing STREAMINFO
[2017-11-01 12:02:52] DEBUG: FLAC processing VORBIS_COMMENT
[2017-11-01 12:02:52] DEBUG: LAME partially initialized.
[2017-11-01 12:02:52] DEBUG: LAME initialized.
[2017-11-01 12:02:52] DEBUG: Metadata processing finished.
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: (nil) -> 0x7fe97403d260 ; 0 -> 285
[2017-11-01 12:02:52] DEBUG: Buffer reallocate: 0x7fe97403d260 -> 0x7fe974085e90 ; 285 -> 4409882
[2017-11-01 12:02:52] DEBUG: Tag written to Buffer.
   open[140640650267152] flags: 0x28000 /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3
   unique: 68, success, outsize: 32
unique: 69, opcode: READ (15), nodeid: 7, insize: 80, pid: 23687
read[140640650267152] 131072 bytes from 0 flags: 0x28000
unique: 70, opcode: READ (15), nodeid: 7, insize: 80, pid: 23688
read[140640650267152] 131072 bytes from 524288 flags: 0x28000
[2017-11-01 12:02:52] DEBUG: read /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3: 131072 bytes from 0
[2017-11-01 12:02:52] DEBUG: read /Vampire Weekend/Vampire Weekend/03 A-Punk.mp3: 131072 bytes from 524288
[2017-11-01 12:02:52] DEBUG: Reading 131072 bytes from offset 0.
[2017-11-01 12:02:52] DEBUG: Reading 131072 bytes from offset 524288.
[2017-11-01 12:02:52] ERROR: FLAC error: FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER
[2017-11-01 12:02:52] ERROR: FLAC error: FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
[2017-11-01 12:02:52] ERROR: FLAC error: FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER
[2017-11-01 12:02:52] ERROR: FLAC error: FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
[2017-11-01 12:02:52] ERROR: FLAC error: FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCHunique: 71, opcode: READ (15), nodeid: 7, insize: 80, pid: 23690

[2017-11-01 12:02:52] ERROR: FLAC error: FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADERread[140640650267152] 131072 bytes from 1048576 flags: 0x28000

Segmentation fault (core dumped)

dmesg shows:

[619512.442457] mp3fs[21534]: segfault at 7f9d751df8b0 ip 00007f9e69d2f849 sp 00007f9e63ffe788 error 6
[619512.442461] traps: mp3fs[11686] general protection ip:7f9e6ab320ba sp:7f9e694321f0 error:0 in libmp3lame.so.0.0.0[7f9e6ab18000+45000]
[619512.442462]  in libc-2.23.so[7f9e69c90000+1c0000]

[619655.318252] mp3fs[23686]: segfault at 0 ip 00007fe984276294 sp 00007fe9829909d8 error 6 in libc-2.23.so[7fe9841e7000+1c0000]

I've tried with the 0.9.1 release from source and via a git clone of the repository with the same results.

sdgathman commented 6 years ago

The best way to approach this is to come up with a test case. What is unique about the samba access pattern? The first thing that jumps out at me are the failed attempts to LOOKUP /mp3fs. Is samba doing that? Or is another process doing so? Maybe this is a bug that shows up with two processes accessing the fuse filesystem.

If you can think of another process that is doing the /mp3fs lookups, then stop that process and see if the samba access starts working. That would narrow down what is going on.

khenriks commented 6 years ago

I believe this is a problem with the Vampire Weekend/Vampire Weekend/03 A-Punk.flac file. Notice all of the errors from FLAC right before the segfault. Is there a way you can share that file with me? It seems I'm not properly handling errors.

viertelb commented 5 years ago

Hi, I have the same issue and added the file. I have this problem a lot. I was pointed here by an answer to my question here.

On my clients I use Lubuntu 18.04 and 18.10. I did however successfully copy this file (and others) the last time with Lubuntu 16.04. Not sure if this makes sense.

I was not able to compress my flac, so I made three files with ZIP that had the names

file.zip.001 file.zip.002 file.zip.003

I had to strip the 000-part to be able to upload it as a supported file format (ZIP). Please remove the 000-part from the front and put it at the end, as seen above.

file001.zip file002.zip file003.zip

khenriks commented 5 years ago

I'm trying to reproduce this, and I'm having trouble, even with the file you provided. Can you please try the following:

  1. Instead of mounting mp3fs from /etc/fstab, please run catchsegv mp3fs -d <args> where you replace <args> with appropriate arguments.
  2. Please reproduce the segfault and paste the last 100 lines or so here. There will (hopefully) be a backtrace in the output that I can use to see what's happening.

Thanks!

khenriks commented 5 years ago

Aha! I found the issue, it has to do with concurrent reads from the same file, and mp3fs not being properly thread-safe. I'll look into the issue some more.

viertelb commented 5 years ago

Do you still need something? I think it still works well with Lubuntu 16.04.05 LTS on an ASUS F205 laptop (Intel Atom). I have issues on my Shuttle Barebone PC with a powerfull CPU. But even there I was able to use it withou problems under Lubuntu 16.04 or 16.10. The change in behaviour came with my upgrade to 18.04 I guess. Maybe this is related to the way CIFS works now.

khenriks commented 5 years ago

I don't need anything else, I'm able to reproduce the issue, thanks. I just need to implement a fix now.

khenriks commented 5 years ago

This should now be resolved with the latest commit pushed to master.