Opened 7 years ago

Closed 2 years ago

Last modified 17 months ago

#11582 closed bug (not reproducible)

BRoster::Launch() mistakenly returns B_OK

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


This returns B_OK:

entry_ref bogus;

And so does this:

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

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 (5)

comment:1 by pulkomandy, 7 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, 3 years ago

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

comment:3 by waddlesplash, 2 years 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");
	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, 2 years 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)));
/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

comment:5 by nielx, 17 months ago

Milestone: R1

Remove milestone for tickets with status = closed and resolution != fixed

Note: See TracTickets for help on using tickets.