Opened 5 years ago

Closed 4 weeks ago

#11582 closed bug (not reproducible)

BRoster::Launch() mistakenly returns B_OK

Reported by: ttcoder Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Application Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This returns B_OK:

entry_ref bogus;
be_roster->Launch(&bogus);

And so does this:

entry_ref ref;
get_ref_for_path(&ref, path to a non-existing filename in an existing folder);
be_roster->Launch(&ref);

Ran into that while hacking media_server trying to make it launch a custom/debug build of media_addon_server.

At a quick glance, it could be because BRoster::_TranslateRef() mistakenly believes that calling entry.SetTo(ref, false); on a non-existing name will return an error (just a quick guess).

Change History (4)

comment:1 by pulkomandy, 5 years ago

I'm not sure, it seems _TranslateRef would fail a few lines later on creating a BNode from the entry if that was the problem?

comment:2 by ttcoder, 7 months ago

(note to self: BRoster::_LaunchApp() was tweaked in hrev52968)

comment:3 by waddlesplash, 4 weeks ago

I just conjured up this simple test app:

#include <Roster.h>
#include <stdlib.h>
#include <stdio.h>

int main(int, char*[])
{
	entry_ref ref;
	printf("%s\n", strerror(be_roster->Launch(&ref)));
	
	get_ref_for_path("/boot/home/Desktop/no_exists", &ref);
	printf("%s\n", strerror(be_roster->Launch(&ref)));
	
	BEntry entry("/boot/home/Desktop/no_exists");
	entry.GetRef(&ref);
	printf("%s\n", strerror(be_roster->Launch(&ref)));
}

And running it gives:

No such file or directory
No such file or directory
No such file or directory

So, it seems this works now? ttcoder, can you confirm?

comment:4 by ttcoder, 4 weeks ago

Resolution: not reproducible
Status: newclosed

I'm seeing the same thing in hrev52750 (so before the putative fix/tweak I mentionned), which is odd -- maybe I was using a very very old hrev to reproduce that bug, or is there something else at play.

Anyway that makes this ticket "not reproducible" I'd say.

/boot/system/cache/tmp/Nouveau dossier> gcc prog.cpp 
prog.cpp: In function 'int main(int, char**)':
prog.cpp:9:17: error: 'strerror' was not declared in this scope
  printf("%s\n", strerror(be_roster->Launch(&ref)));
                 ^~~~~~~~
prog.cpp:9:17: note: suggested alternative: 'perror'
  printf("%s\n", strerror(be_roster->Launch(&ref)));
                 ^~~~~~~~
                 perror
/boot/system/cache/tmp/Nouveau dossier> uname -a
Haiku shredder 1 hrev52750 Jan 12 2019 05:04:08 x86_64 x86_64 Haiku
/boot/system/cache/tmp/Nouveau dossier> gcc -lbe prog.cpp 
/boot/system/cache/tmp/Nouveau dossier> ./a.out 
No such file or directory
No such file or directory
No such file or directory
Note: See TracTickets for help on using tickets.