IPS-LMU / emuR

The main R package for the EMU Speech Database Management System (EMU-SDMS)
http://ips-lmu.github.io/EMU.html
23 stars 15 forks source link

get_trackdata crashes when SSFF file is not found #261

Closed kirbyj closed 2 years ago

kirbyj commented 2 years ago

We just had a segment list with only one row and tried get_trackdata on an SSFF track without a corresponding file in the bundle. Instead of yielding an error message, it made the R session crashed.

kirbyj commented 2 years ago

Does add_ssffTrackDefinition() check whether the files exist for each bundle?

raphywink commented 2 years ago

add_ssffTrackDefinition() when used without "onTheFly" parameters only updates the DBconfig and doesn't perform any file checks. Implementing this shouldn't be 2 difficult though. Does it actually take down the entire R session if this happens? That would be a bit worrying...

kirbyj commented 2 years ago

It surely does, in fact so quickly that it doesn't even have time to throw an error ;) @MJochim walked us through some debugging to try and identify the offending bundle, but even that wasn't always consistent - sometimes get_trackdata() would "appear" to get a little further, when in fact the session was already segfaulting. In any case, the underlying issue seems to be attempting to access an SSFF track that doesn't actually exist.

raphywink commented 2 years ago
library(emuR)
create_emuRdemoData(dir = tempdir())
demo_data_dir = file.path(tempdir(), "emuR_demoData")
db_handle = load_emuDB(file.path(demo_data_dir, 'ae_emuDB'))
fps = list_files(db_handle, fileExtension = 'fms')

unlink(fps[1,]$absolute_file_path)
sl =query(db_handle, "Phonetic == n")
get_trackdata(db_handle, seglist = sl, "fm")

this is a reproducible example that crashed the R session. Damn...

raphywink commented 2 years ago

Temporary fix implemented! This doesn't address the underlying issue of wrassp::read.AsspDataObj('badPath') now crashing the entire R session though. I am 100% positive that this used to fail gracefully with an appropriate error message. Not sure, but guessing R changed something under the hood that changed this behavior...

raphywink commented 2 years ago

opened issue in wrassp repo and closing this one

MJochim commented 1 year ago

Yes, James and I wrote that issue together. It is a complete crash with Rstudio's bomb icon and no further hint about what has happened.

We tried to debug this issue by printing the session and bundle name first thing inside the for loop where get_trackdata iterates over the seglist. This, however, misled us, because the print was buffered in some way - so the last visible bundle name was not that of the bundle that caused the crash. It was of a bundle that came a couple of rows before the crash-causing one in the seglist.

Am 4. Juni 2022 14:54:35 MESZ schrieb Raphael Winkelmann @.***>:

add_ssffTrackDefinition() when used without "onTheFly" parameters only updates the DBconfig and doesn't perform any file checks. Implementing this shouldn't be 2 difficult though. Does it actually take down the entire R session if this happens? That would be a bit worrying...

-- Reply to this email directly or view it on GitHub: https://github.com/IPS-LMU/emuR/issues/261#issuecomment-1146603909 You are receiving this because you are subscribed to this thread.

Message ID: @.***>