Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

pkg_info SegFault

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> pkg_info SegFault Page: [1]
Login
Message << Older Topic   Newer Topic >>
pkg_info SegFault - Jul. 10, '06, 1:09:35 AM   
RingoBell

 

Posts: 4
Joined: Jul. 5, '06,
Status: offline
I receive a "Segmentation fault (core dumped)" error when running pkg_info from a bash shell. I can run "pkg_update" to install packages without getting any errors, but I can't tell which version is installed. I have tried running this as both an Administrator (same account I use to install SFU), and a "regular user" (without any write permissions on the SFU install directory).

I just installed SFU about a week ago, and installed the bootstrapping shell script a few days ago. "pkg_info" seemed to work immediately after the install, but I have since installed bash, updated pkg-config, and updated su. I'm not sure exactly when "pkg_info" stopped working.
Post #: 1
RE: pkg_info SegFault - Jul. 10, '06, 1:45:12 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The option "-V" (that's capital V) to any of the pkg (installer)
utilities will output the version. Normally I ask for it from pkg_info
since if someone types something incorrectly nothing "bad" is going to happen.

Likely the problem is DEP. Not with pkg_info per se since it's built with c89
rather than gcc for a good number of months now. DEP is likely getting kicked off
from bash (which is gcc built. Anyhow, refer to FAQ entry 2.07 for details.

(in reply to RingoBell)
Post #: 2
RE: pkg_info SegFault - Jul. 11, '06, 1:21:15 AM   
RingoBell

 

Posts: 4
Joined: Jul. 5, '06,
Status: offline
I was able to run "pkg_info -V" from bash without any errors. The result was as follows:
version 2.6.3

However, I still get a seg fault when I run pkg_info without parameters.

I read the FAQ entry you described before installing the package tools (actually, before registering an account), but I didn't understand the following line to mean "programs compiled with gcc"; I understood it to mean gcc itself.
quote:

There are some programs, most notably 'gcc', that place some executable code in the stack.

As I was not installing either of the SDK's or gcc, I didn't think it was an issue for me.

If it helps, I am on WinXP Pro SP2. Also, I am using a 32-bit processor (AMD Athlon XP), which obviously doesn't have hardware NX/DEP capabilities. The Windows setting in "C:\boot.ini" is "OptIn", so DEP should not be applied to bash or pkg_info (or posix.exe), unless these programs are compiled to specifically request it.

Rodney, thanks for your help!

PS: I've noticed that the "Preview" button doesn't seem to work on these forums.

< Message edited by RingoBell -- Jul. 11, '06, 1:31:54 AM >

(in reply to Rodney)
Post #: 3
RE: pkg_info SegFault - Jul. 11, '06, 1:42:57 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> As I was not installing either of the SDK's or gcc, I didn't think it was an issue for me.

It's an an issue for everyone. Sorry, you don't get excluded.
Gcc is a compiler. The code that it generates will write executable
code on the stack which triggers DEP to activate.

> which obviously doesn't have hardware NX/DEP capabilities

That doesn't matter. DEP is software based too. So it affects you.
The descriptions about DEP "OptIn" only apply to Win32 programs.
For the SFU/SUA/interix programs it's on or off only. The other
settings don't count. So it applies to bash which is gcc built.
Pkg_info is built with a different compiler that doesn't write
executable code on the stack.

If you run from another shell (/bin/ksh or /bin/csh) you should see that
all of the installer commands you were running before continue to run fine.

Thus you need to turn DEP off as described in the FAQ.

Not all programs compiled with gcc result in code that writes
executable code on the stack. Some programs are more likely to trip DEP.
And gcc itself is one of those programs, so I noted it as an
example. A lot of the GNU based code compiles "best"/easiest with gcc.
So all of these programs are vulnerable. It just depends how they get run.
A subtle change can mean the difference for DEP triggering.

< Message edited by Rodney -- Jul. 13, '06, 12:09:12 AM >

(in reply to RingoBell)
Post #: 4
RE: pkg_info SegFault - Jul. 12, '06, 2:00:39 AM   
RingoBell

 

Posts: 4
Joined: Jul. 5, '06,
Status: offline
quote:

ORIGINAL: Rodney

> As I was not installing either of the SDK's or gcc, I didn't think it was an issue for me.

It's an an issue for everyone. Sorry, you don't get excluded.
Gcc is a compiler. The code that it generates will write executable
code on the stack which triggers DEP to activate.


Right, I understand now; I was trying to explain why I originally didn't think the FAQ entry applied to me (and perhaps that the FAQ should be updated to reflect the fact that programs compiled with gcc are affected as well).

quote:

> which obviously doesn't have hardware NX/DEP capabilities

That doesn't matter. DEP is software based too. So it affects you.


I also understand this (although I didn't know it until I read the Microsoft article link in the FAQ entry).

quote:

The descriptions about DEP "OptIn" only apply to Win32 programs.
For the SFU/SUA/interix programs it's on or off only. The other
settings don't count. So it applies to bash which is gcc built.
Pkg_info is built with a different compiler that doesn't write
executable code on the stack.


This might be the problem, then. I'm not sure I'm willing to turn DEP off completely, though - now that it's a feature of Windows, Microsoft will be relying on it instead of actually implementing security fixes to their software. Why isn't the fact that "OptIn" only applies to Win32 programs documented in the Microsoft article? It seems like DEP should've been implemented kernel-wide, instead of just within the Win32 subsystem. Also, what is SUA?

quote:

If you run from another shell (/bin/ksh or /bin/csh) you should see that
all of the installer commands you were running before continue to run fine.


Actually, no, "pkg_info" (with no parameters) still crashes under C Shell (using the SFU-installed C Shell shortcut to launch it) and Korn Shell. However, I did notice that instead of a segmentation fault, I get "Illegal instruction (core dumped)" as the error message in those shells - is this a feature of the shells? Also, as I described earlier, it seems to be only "pkg_info" that is affected; "pkg_update" works fine (as far as I can tell, anyway).

Is there any way to uninstall all of the software from "/Tools" without having to uninstall and reinstall SFU itself? I'd be willing to try a "clean slate" to see if that solves the problem.

(in reply to Rodney)
Post #: 5
RE: pkg_info SegFault - Jul. 12, '06, 4:01:47 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> Also, what is SUA?

It's the new name for the Interix subsystem as it ships as part of
the Windows OS starting with R2 (and Vista next). It's still Interix
as uname identifies it.

> Why isn't the fact that "OptIn" only applies to Win32 programs documented in the Microsoft article?

I don't know.

> Also, as I described earlier, it seems to be only "pkg_info" that is affected;
> "pkg_update" works fine (as far as I can tell, anyway).

mmm, okay. I look into this.

> is this a feature of the shells?

Not specifically. It's done by the subsystem (the core dump).

> Is there any way to uninstall all of the software from "/Tools" without having to uninstall and reinstall SFU itself?

If pkg_delete is working then the packages can be removed until the "core" of interdependent
packages remains (what the bootstrap install placed). The bootstrap can be re-run with the option
"clobber" given ("sh pkg-current-bin35.sh clobber").

(in reply to RingoBell)
Post #: 6
RE: pkg_info SegFault - Jul. 13, '06, 12:57:32 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> mmm, okay. I look into this.

I've looked through the code for something "obvious" that would cause a SEGV
when pkg_info is called with no options and don't see anything.
Though you hadn't written it specifically, I assumed that there had been no output
at all from pkg_info when it did the SEGV. Is this correct?

(in reply to Rodney)
Post #: 7
RE: pkg_info SegFault - Jul. 14, '06, 3:23:04 AM   
marcdw

 

Posts: 12
Joined: May 12, '05,
Status: offline
Been following this as I have the same problem. Here's what I've noticed, the segfault
only happens for me within the bash and ksh shells. No problem in csh or zsh.
pkg_info segfaults when given an argument/option. pkg_info without arguments does
not segfault and produces a list of installed packages.

Here's what I get in bash/ksh:

=== BEGIN ===
07/13/06 23:55:35 ~ $ pkg_info pkg
gzip: stdin: unexpected end of file
tar: End of archive volume 1 reached
tar: Sorry, unable to determine archive format.
pkg_info(pkg): URL `ftp://ftp.interopsystems.com/pkgs/3.5/pkg.tgz' has unknown filename part!
Segmentation fault (core dumped)
=== END ===

Another test where I pass the full name of a package such as
'pkg_info yacc-1.2-bin'.
In csh/zsh I get the expected output but in bash/ksh it starts doing something
I wasn't expecting so I aborted (ctrl-c) before it finished.

=== BEGIN ===
07/13/06 23:55:47 ~ $ pkg_info yacc-1.2-bin
tar: Unable to create bin/yacc <Permission denied>
tar: Unable to create bin/yyfix <Permission denied>
tar: Unable to create share/man/man1/yacc.1 <No such file or directory>
tar: Unable to create share/man/cat1/yacc.1 <No such file or directory>
tar: Unable to create share/man/man1/yyfix.1 <No such file or directory>
tar: Unable to create share/man/cat1/yyfix.1 <No such file or directory>
tar: Unable to create bin/yacc <Permission denied>
tar: Unable to create bin/yyfix <Permission denied>
tar: Unable to create share/man/man1/yacc.1 <No such file or directory>
tar: Unable to create share/man/cat1/yacc.1 <No such file or directory>
tar: Unable to create share/man/man1/yyfix.1 <No such file or directory>
tar: Unable to create share/man/cat1/yyfix.1 <No such file or directory>
^C
tar: Signal caught, cleaning up.
=== END ===

Adding the '-bin' causes this one otherwise the first error is produced.
Is this a DEP thing or a shell thing?
Is zshell built with c89?

Of course -V works okay.

07/14/06 00:18:11 ~ $ pkg_info -V
version 2.6.3

Marc

< Message edited by marcdw -- Jul. 14, '06, 3:25:58 AM >

(in reply to Rodney)
Post #: 8
RE: pkg_info SegFault - Jul. 14, '06, 11:48:10 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Thanks for the additional information. I'll see what I can do with it

(in reply to marcdw)
Post #: 9
RE: pkg_info SegFault - Jul. 15, '06, 12:14:12 PM   
RingoBell

 

Posts: 4
Joined: Jul. 5, '06,
Status: offline
quote:

ORIGINAL: Rodney

> Is there any way to uninstall all of the software from "/Tools" without having to uninstall and reinstall SFU itself?

If pkg_delete is working then the packages can be removed until the "core" of interdependent
packages remains (what the bootstrap install placed). The bootstrap can be re-run with the option
"clobber" given ("sh pkg-current-bin35.sh clobber").


Thanks! I tried this (although I think I may have deleted too many packages; I removed all of them that were listed in "/var/db/pkg/", as I couldn't remember exactly which ones I had installed and which were installed by the bootstrap process), and ran the bootstrap script with the "clobber" parameter as you specified, and it seems to be working now, in all 3 shells (tcsh, ksh, and bash). I can now run pkg_info, with or without parameters, and pkg_update still seems to be working. Perhaps something went wrong during the original bootstrapping process (I think I may have run it using "./pkg-current-bin35.sh" instead of "sh pkg-current-bin35.sh", and I was using the csh/tcsh included in SFU 3.5 at the time; this time, I ran it using "sh", and I was using ksh instead).

quote:

I've looked through the code for something "obvious" that would cause a SEGV
when pkg_info is called with no options and don't see anything.
Though you hadn't written it specifically, I assumed that there had been no output
at all from pkg_info when it did the SEGV. Is this correct?


Correct; there was no output from pkg_info (other than the segfalut message), except in the case that I ran it with the "-V" parameter (when I did not receive any errors).

quote:

Been following this as I have the same problem. Here's what I've noticed, the segfault
only happens for me within the bash and ksh shells. No problem in csh or zsh.
pkg_info segfaults when given an argument/option. pkg_info without arguments does
not segfault and produces a list of installed packages.


This doesn't sound like the same problem I had; I had the problem in all shells I tried (bash, ksh, and csh/tcsh). Also, I received the segfault when I ran pkg_info without parameters. Hope you're able to get your problem solved, too, though.

(in reply to Rodney)
Post #: 10
RE: pkg_info SegFault - Jul. 21, '06, 1:43:16 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The difficulty of solving this is finding out what's the cause because I haven't replicated it.

When you ran the command "pkg_info" what directory where you in and what was/is that directory at the time?

(in reply to RingoBell)
Post #: 11
RE: pkg_info SegFault - Jul. 21, '06, 5:11:56 PM   
marcdw

 

Posts: 12
Joined: May 12, '05,
Status: offline
Interesting question. For me at the time I was in my home directory.
Today I went to different directories and the segfault/core dump errors were the
same except when I issued the command in the directory where pkg_info lies
(/usr/local/bin). From there the error is:

=== BEGIN ===
07/21/06 13:48:54 ~ $ pkg_info bash
tar: Cannot identify format. Searching...
tar: Cpio file name length 35661 is out of range
tar: Invalid header, starting valid header search.
tar: End of archive volume 1 reached
tar: WARNING! These patterns were not matched:
+*
pkg_info(bash): tar extract of /usr/local/bin/bash failed!
pkg_info(bash): error during unpacking, no info for 'bash' available
=== END ===

If I do 'pkg_info bash-3.0.0.8' then I get the original error messages (segfault).
Suffixing that with '-bin' brings about the messages where tar is being used
mentioned in earlier post.

I also made sure earlier that no other tar utilities were being called
just in case (I have a tar.exe for use with FAR file manager).
Though I don't see what tar has to do with getting pkg_info from /var/db/pkg/.
Why is it that something is trying to be unpacked?
[scratching my head]

Marc
Interix winxp2 3.5 SP-8.0.1969.1 x86 AMD Athlon/Duron

< Message edited by marcdw -- Jul. 21, '06, 5:21:36 PM >

(in reply to Rodney)
Post #: 12
RE: pkg_info SegFault - Jul. 22, '06, 2:26:20 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> Why is it that something is trying to be unpacked?

That's what I was (and still am) wondering too.
You can use pkg_info on a package file to get information its content.
But that's usually with a *.tgz file. The way you've been giving the arg has pkg_info
look for an already installed package. And you've said you already have "bash" installed.
And I'm not able to generate the same error that you are experiencing. So there must be
something specific to your machine that's tripping this problem. So I was thinking that
something might be the directory you are in or its content because of the tar output.
But your response seem to neutralize this idea (because you have tried in several different
directories) or at least put a twist on it.

Only "/bin/tar" is ever invoked with pkg_info.
I ponder more...

(in reply to marcdw)
Post #: 13
RE: pkg_info SegFault - Jul. 22, '06, 2:57:31 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The information is supposed to be drawn from /var/db/pkg or the path
that the env var PKG_DBDIR is set to. SO maybe there something messed
up in that directory...
What directories and files are in your /var/db/pkg (or PKG_DBDIR)?

(in reply to Rodney)
Post #: 14
RE: pkg_info SegFault - Jul. 24, '06, 4:56:41 PM   
marcdw

 

Posts: 12
Joined: May 12, '05,
Status: offline
Oh my, I discovered the problem. When you mentioned PKG_DBDIR I checked to see
what was set and PKG_PATH is the problem.

PKG_PATH=ftp://ftp.interopsystems.com/pkgs/3.5

When I unset that then things are okay in bash/ksh.
(Being in NetBSD pkg mindset I also checked it with a
trailing slash (/) just as a test).
So anyway, having PKG_PATH set is causing the problem.
I added it back as well as PKG_DBDIR but pkg_info is looking at
the ftp site. For instance 'pkg_info rxvt' tries to look for
rxvt.tgz from PKG_PATH.

The reason why everything worked in csh/zsh is because PKG_PATH
isn't set in their startup files. I also just did pkg_update for
the dialog package while in csh and it installed fine without need
for PKG_PATH (using I guess a default ftp PKG_LOCATION).

After rereading the Package Install FAQ I see that PKG_PATH is
best used for pkg_add which I haven't used since my initial
installation.

(During this testing I found core files throughout, too.) :-)

Marc

(in reply to Rodney)
Post #: 15
RE: pkg_info SegFault - Jul. 24, '06, 5:18:41 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Cool.

Just as a note (for anyone reading) the setting of PKG_PATH to the ftp site
shouldn't be needed as a shorthand/default at this point in time. By using the
pkg_update utility that "shorthand" isn't needed anymore for less typing.

I will add some code to treat a URL path with more "sense" in pkg_info if
it's getting picked up from the environment (or at least a message to help debug
this state).

Thanks for being helpful while trying to figure this out.

(in reply to RingoBell)
Post #: 16
RE: pkg_info SegFault - Jul. 26, '06, 6:51:30 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The pkg_info code doesn't every look at the environment variable PKG_PATH.
And setting PKG_PATH as described resulted in no problem behavior.
You mentioned your NetBSD mindset... do you have the NetBSD installer installed as well?

(in reply to Rodney)
Post #: 17
RE: pkg_info SegFault - Jul. 29, '06, 4:21:23 AM   
marcdw

 

Posts: 12
Joined: May 12, '05,
Status: offline
No I don't think so. I mentioned the mindset thing because I was trying to install
NetBSD on an old laptop recently.

It is odd then that pkg_info might not be the problem but as soon as I set
PKG_PATH again it'll head out to the net.
Just in case, what file would this NetBSD installer be, or location?
Heh, knowing me I just might have something lying around and forgot.

[In a few days it looks like I'm gonna be homeless so hopefully I'll find
a reason why my setup is acting strange before then]

(in reply to Rodney)
Post #: 18
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> SFU / Interix - Getting Started >> pkg_info SegFault Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.094