LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-23-2010, 07:21 PM   #16
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453

Regarding

Quote:
This code compiles and works on slackware 64 in SHARED linkage...

This code compiles and crashes on slackware 64 in STATIC linkage
- have you tried to disassemble both (static,dynamic) versions and to compare them ?

...

Does optimization level affect the behavior ? I.e. what about -O0, for example ?

Last edited by Sergei Steshenko; 04-23-2010 at 07:23 PM.
 
0 members found this post helpful.
Old 04-23-2010, 07:32 PM   #17
NoStressHQ
Member
 
Registered: Apr 2010
Location: Lausanne - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware Leet - 32/64bit
Posts: 280

Original Poster
Rep: Reputation: 94
Quote:
Originally Posted by Sergei Steshenko View Post
So you are advertising yourself as not a newbie.

I went through previous posts in this thread and I do not see the following info:
  1. Your OS version (just name);
  2. Your 'gcc' version;
  3. Your 'glibc' version;
  4. Your 'binutils' version.

Meanwhile just performing WEB search/browsing I see some 'retq' related bugs. So, maybe your combination of OS + 'gcc' + glibc' + 'binutils' versions is affected by such a bug.
So for you the fact I've never asked a question on a forum makes you understand that I don't know how to trace and pinpoint a bug ?

I said I use Slackware64 (forgot to mention -current, true), "raw" I don't have anything special, I was wondering if other had this bug on their installs.

Again : forum newbie != programming newbie.

FYI : my 'experience' is not my number of posts here, it's the fact that I first used slackware early 90s, I've been programming for more than 20 years, using several languages, on several system, several compilers, and I don't feel the need to post my curriculum vitae if I find a bug in some piece of code. And if I don't post 'often' (3 times in my whole 20years internet/programmer lifespan), it's might be because :
* I google before posting
* I want to avoid "unrelated/pedantic/have you seen that I know better than you on this irrelevant detail?" answers as they are so many around
* I'm used to find a solution myself (with help of docs of course) most of the time.
* ..several minor issues...

For the rest it is still unrelated to a mismatch of pointer size on the return instruction of an empty system callback.

Quote:
Why another thread:
For "the other post", as I think it's a Slackware64 specific build problem I 'asked' the slackware dudes "around". Is there something wrong to try to address the right person who will be able to answer to your problem ?

Cheers.
 
Old 04-23-2010, 07:37 PM   #18
NoStressHQ
Member
 
Registered: Apr 2010
Location: Lausanne - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware Leet - 32/64bit
Posts: 280

Original Poster
Rep: Reputation: 94
Quote:
Originally Posted by Sergei Steshenko View Post
- have you tried to disassemble both (static,dynamic) versions and to compare them ?
Errr... I use a debugger...You know that kind of thing that allows you to trace the assembly, see the registers, watch memory... (gdb through ddd in that case)...

So Yes... I watched everything, I have several compilation settings, and nothing 'magic' with an empty function again, and a simple retq into the kernel...
 
Old 04-23-2010, 10:17 PM   #19
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by NoStressHQ View Post
Errr... I use a debugger...You know that kind of thing that allows you to trace the assembly, see the registers, watch memory... (gdb through ddd in that case)...

So Yes... I watched everything, I have several compilation settings, and nothing 'magic' with an empty function again, and a simple retq into the kernel...
Sure I know. More than twenty years ago my friend and I developed an in-circuit emulator, and I personally wrote for it a debugger.

Also, during VLSI stage of my career, I was developing simulation environments for chips containing CPUs, so had to convert input sources into readable by Verilog hex files. Quite "fun" to find and fix one's errors having simulation speed of one CPU clock per second.

Regarding "I watched everything" - I can tell you what I once read in a novel, which said it was written in a NYC elevator: "If you are so smart, why are you so poor ?".

If you want something constructive, stop bragging and publish disassembly of the static and dynamic versions.
 
0 members found this post helpful.
Old 04-26-2010, 01:17 AM   #20
NoStressHQ
Member
 
Registered: Apr 2010
Location: Lausanne - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware Leet - 32/64bit
Posts: 280

Original Poster
Rep: Reputation: 94
Yeah, I didn't want to compete or start any mind war here.

I was just saying, that the 'hint' was pointless regarding the problem, and I might have over-reacted because it's been several weeks I was trying to understand a bug on my side where it seems it's a distribution build problem (it's been confirmed on the "slackware forum thread"). You didn't have all the infos, I know that, I was just tired of having to explain "from the start" where I was on the stage of asking "why kernel calls me in 32bit whereas I'm a 64bit process"...
(Yes "weeks" might be long but it's on my spare time...And I didn't want to bother anyone while I wasn't 100% sure it was not my fault)

Anyway, I appreciate you've spent time on this. I'm continuing digging this problem on the slackware specific forum...

But... If any of you have an idea how to understand/debug this problem, even if you're not a slacky, you're welcomed .

It implies 64bit static linking and kernel/system call mismatch (possibly glibc)...

Cheers

Garry.
 
Old 04-26-2010, 06:33 AM   #21
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by NoStressHQ View Post
Yeah, I didn't want to compete or start any mind war here.

I was just saying, that the 'hint' was pointless regarding the problem, and I might have over-reacted because it's been several weeks I was trying to understand a bug on my side where it seems it's a distribution build problem (it's been confirmed on the "slackware forum thread"). You didn't have all the infos, I know that, I was just tired of having to explain "from the start" where I was on the stage of asking "why kernel calls me in 32bit whereas I'm a 64bit process"...
(Yes "weeks" might be long but it's on my spare time...And I didn't want to bother anyone while I wasn't 100% sure it was not my fault)

Anyway, I appreciate you've spent time on this. I'm continuing digging this problem on the slackware specific forum...

But... If any of you have an idea how to understand/debug this problem, even if you're not a slacky, you're welcomed .

It implies 64bit static linking and kernel/system call mismatch (possibly glibc)...

Cheers

Garry.
A person with 20 years of experience should have a strong idea that compiler + linker + glibc strongly affect the final code produced.

A person who read the thread carefully could notice that ntubski has checked your code and it worked for him. So, it would be logical to ask ntubski to send the binary he used and try it - since the linking is static, the binary should work more or less out of the box.

If by any chance ntubski's binary works under your system, the problem is most likely in the compiler + linker + glibc combination.

Or you could not ask anybody anything, install (probably in a VM) the same Ubuntu version ntubski used and try it yourself.
 
0 members found this post helpful.
  


Reply

Tags
c++, glibc, link, linux, static


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird problem, can't compile kernel: gcc: Internal error:Segmentation fault (prgm as) abefroman Linux - Software 4 08-01-2006 05:28 PM
Unreal 2004 64bit Segmentation fault phoenix49 Fedora 3 05-13-2006 12:05 AM
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika Suse/Novell 2 12-02-2005 09:34 AM
weird lilo segmentation fault demon666 Linux - Software 3 07-15-2004 01:27 PM
f-prot anti-virus "Segmentation fault" error and other weird stuff dalek Linux - Software 9 10-22-2003 07:37 PM


All times are GMT -5. The time now is 01:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration